-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse URDF joint hard limits into the HardwareInfo structure #1472
Parse URDF joint hard limits into the HardwareInfo structure #1472
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1472 +/- ##
==========================================
+ Coverage 88.42% 88.53% +0.10%
==========================================
Files 101 101
Lines 8349 8502 +153
Branches 728 759 +31
==========================================
+ Hits 7383 7527 +144
- Misses 703 706 +3
- Partials 263 269 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is clear and the implementation looks fine. However, a couple of lines miss coverage, especially in the update_interface_limits
lambda
Co-authored-by: Christoph Fröhlich <[email protected]>
Sure. if you can, it would be really helpful. Thanks @christophfroehlich |
max_vel = std::min(std::abs(min_vel), max_vel); | ||
limits.max_velocity = std::min(max_vel, limits.max_velocity); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity why you do not do a default initialization of the max_velocity ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean by default initialization? limits
will be filled from the URDF tag, which is mandatory for REVOLUTE and PRISMATIC joints -> max_velocity is already populated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, moreover, there might be a joint without velocity limits, so it doesn't make sense
max_eff = std::min(std::abs(min_eff), max_eff); | ||
limits.max_effort = std::min(max_eff, limits.max_effort); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here wrt to max_effort
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well same as above
{ | ||
limits.max_jerk = std::abs(max_jerk); | ||
limits.has_jerk_limits = true && itr.enable_limits; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here for max_jerk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jerk limits are very familiar as the support in ROS is little, so I think it is better to leave it up to the user
it does not throw on continuous
@christophfroehlich Thanks for helping out and adding very nice tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just let us add some notes about this once #1477 is merged.
Sure. I will do that :) |
{ | ||
limits.max_acceleration = std::fabs(limits.max_deceleration); | ||
} | ||
limits.has_deceleration_limits = true && itr.enable_limits; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed this pattern of true &&
in a couple of places. Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, it can be simply itr.enable_limits
. I will make the modifications soon and let you know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. This is fixed now. 👍
This PR allows to parse the joint_limits into the
HardwareInfo
structure, so that this can be later reused by the ResourceManager to enforce the limits on theJointCommandInterfaces
.The joint limits that are available in the
HardwareInfo
structure are basically parsed from the URDF joint limits, and these joint limits range can be reduced with the<min>
and<max>
tag of each command interface, the idea is to be able to always be able to conservative.There will be a following PR on parsing the
SoftLimits
as well