Skip to content

Extend parsing of acceleration, deceleration and jerk limits from limit tag #212

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

saikishor
Copy link

@saikishor saikishor commented Feb 16, 2025

Needs ros/urdfdom_headers#83

This is needed to be able to parse the newly added limits of acceleration, deceleration and jerk, this would be pretty much useful to integrate them into the ros2_control architecture

@ros-discourse
Copy link

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/allow-for-more-complex-joints-in-urdf/42234/3

@ros-discourse
Copy link

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/proposal-to-extend-jointlimits-in-urdf/42831/1

const char* deceleration_str = config->Attribute("deceleration");
if (deceleration_str == NULL){
CONSOLE_BRIDGE_logDebug("urdfdom.joint_limit: no deceleration, using default value");
jl.deceleration = std::numeric_limits<double>::infinity();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a full review, but an isolated comment. If the deceleration is unspecified, wouldn't it make more sense to default to the acceleration value?

Unrelated nit: Bracing and spacing style is inconsistent in this changeset.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. That's a very good point. I'll do the changes soon

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@saikishor saikishor force-pushed the extend/joint/limits branch from 998b548 to 22d0e79 Compare March 27, 2025 08:37
@saikishor saikishor requested a review from adolfo-rt March 27, 2025 08:38
Copy link

@forrest-rm forrest-rm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is someone working on enforcing these in ros2_control? Otherwise these new limits will just confuse folks.

(@bmagyar)

@@ -156,12 +161,80 @@ bool parseJointLimits(JointLimits &jl, tinyxml2::XMLElement* config)
{
try {
jl.velocity = strToDouble(velocity_str);
if (jl.velocity < 0.0)
{
CONSOLE_BRIDGE_logError("velocity value (%s) is negative", velocity_str);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that it would help parsing the error logs to say velocity limit instead of velocity value but the rest of the fie seems to already be written that way.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@@ -156,12 +161,80 @@ bool parseJointLimits(JointLimits &jl, tinyxml2::XMLElement* config)
{
try {
jl.velocity = strToDouble(velocity_str);
if (jl.velocity < 0.0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a value of zero valid for velocity, acceleration, and jerk limits? Seems to only make sense as a backward way of disabling the joint.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, by default the velocity limit is set to zero, that's the reason I'm only checking for the negative values

@saikishor
Copy link
Author

saikishor commented Apr 18, 2025

Is someone working on enforcing these in ros2_control? Otherwise these new limits will just confuse folks.

@forrest-rm We already have the first version of the limit enforcement already integrated into the ros2_control (ros-controls/ros2_control#2047). Once this is merged, we will add support for considering the acceleration, deceleration and jerk limits too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants