Skip to content
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

[ROS 2] Fix how wheel properties are retrieved in Ackermann Plugin #1427

Open
wants to merge 4 commits into
base: ros2
Choose a base branch
from

Conversation

Yadunund
Copy link

This PR fixes #1239 by retrieving all required geometric parameters from SDF params as opposed to calculating them from meshes with certain implicit assumptions of mesh geometry. The parameter name track_width was chosen instead of wheel_separation as this usually nomenclature for automobiles which the ackermann plugin will most likely be used with.

The current implementation has implicit assumptions of what the collision mesh of the wheel should be but this is not apparent to users who may spend a lot of time figuring out why their gazebo model is not responding as required.

Other plugins in this repo like the diff_drive also gets the parameters from the SDF and not via meshes.

Signed-off-by: Yadunund [email protected]

Copy link
Contributor

@j-rivero j-rivero left a comment

Choose a reason for hiding this comment

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

The current implementation has implicit assumptions of what the collision mesh of the wheel should be but this is not apparent to users who may spend a lot of time figuring out why their gazebo model is not responding as required.

I agree with this and also think that @siverhavso is right on issue #1239 about a total silent in the presence of errors. The PR looks to me like quite disrupting with the current behavior supported (getting info from meshes) so a more conservative approaches could be:

  1. Check if kinematic information is provided in the SDF (current pr code) and if not fallback to the old behavior and implement an error message if both fail.
  2. Try using the current approach of getting info from meshes and fallback to this PR code if GetRadius fails.
  3. Implement a ROS param to tell the plugin if someone wants the current approach or the new one in this PR.

Not an strong opinion but going with 3 defaulting with current code could help us to keep compatibility and consistency with diff_drive.

<!-- kinematics -->
<wheel_radius>0.3</front_left_joint>
<wheel_base>2.0</wheel_base>
<track_width>1.2</track_width>
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we please include a comment to indicate that this means "wheel_seperation" in ackermann language? Should help people to understand what really is just from reading.

Copy link
Author

Choose a reason for hiding this comment

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

Done 7410afe

@Yadunund Yadunund force-pushed the fix_ackermann_wheel_radius branch from 32cde1e to 7410afe Compare June 11, 2023 15:38
@Yadunund
Copy link
Author

Sorry for the long overdue changes @j-rivero.

I refactored the implementation to default to the existing behavior of inferring properties from the collision mesh file. If the radius computation fails, an error is printed to inform the users that we only support collision meshes that are cylinders or spheres. Alternatively, they can set wheel_params_from_collision_mesh param to false and manually specify the values that the plugin needs.

Copy link

@cschindlbeck cschindlbeck left a comment

Choose a reason for hiding this comment

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

In the hpp the tag wheel_radius is not correct, see below

the values of the wheel params below. -->
<wheel_params_from_collision_mesh>true</wheel_params_from_collision_mesh>
<!-- The radius of the wheel in meters. Used when wheel_params_from_collision_mesh is false. -->
<wheel_radius>0.3</front_left_joint>
Copy link

@cschindlbeck cschindlbeck Aug 13, 2024

Choose a reason for hiding this comment

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

This should be

Suggested change
<wheel_radius>0.3</front_left_joint>
<wheel_radius>0.3</wheel_radius>

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.

3 participants