Read and apply limits from the URDF - #35
Conversation
…l to coupled coordinates - this needed an additional function added to the kinematics translator
pvonwirth
left a comment
There was a problem hiding this comment.
You do not verify or ensure maximum joint limits within the couplend_..._interface class.
Please correct me, if I'm wrong.
But with only the motors observing / limiting themselves, this does not observe the actual maximum joint velocities. (Due to coupled kinematics)
Thus, I would first of all suggest to limit the joint commands where we still have joint commands.
The second issue is more critical: If one motor limits its commanded velocity and others do not, this may lead to involuntary absolutely uncommanded and undesired movements, especially with coupled kinematics, making the system unpredictable.
This is a state that we, i.m.h.o. should absolutely avoid.
A better approach is to detect 'overvelocity' and limit the entire robot equally, so that the entire robot becomes slower but the position trajectory stays invariant.
Limiting torques is even a more difficult problem to discuss.
I would put the hardware limits (with safety margin as already is intended) as absolute error barrier, freezing the robot if a violation is detected on that level. Because it should have be handled before.
Maybe this is worse a discussion. Maybe also together with @nferber to define actions the robot is allowed to take and the ones it should never do when applying safety limits.
| { | ||
| // Factor by which we extend the hard limits so that what an application uses as limit for the input and what we use as | ||
| // hard safe factors is a bit scaled | ||
| inline constexpr double velocity_range_extension_factor = 1.1; |
There was a problem hiding this comment.
Do you think 10% is "a bit" scaled ?
| if (!drive_->getGearboxRatio(configured_gear_ratio_)) { | ||
| RCLCPP_ERROR_STREAM(logger_, "Failed to obtain gear ratio"); | ||
| // Throw as this is critical because we cannot use it to calculate the proper maximum motor velocity | ||
| throw std::runtime_error("Failed to btain the gear box ration of drive: " + get_name()); |
There was a problem hiding this comment.
- type: "obtain"
- I think that drive internals such as gearbox ration should not be exposed to the outside. This is something for the drive and its firmware and noone else ...
Added features
Notes
driverpackages (added transform)Discussion points
I don't really like the urdf tags as they are fixed in what we can pass there. For example adding a power limit would not be possible right now but somewhat desirable ?