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

Add TF publishing in MecanumDrive system #1619

Open
cccleon opened this issue Jul 29, 2022 · 7 comments
Open

Add TF publishing in MecanumDrive system #1619

cccleon opened this issue Jul 29, 2022 · 7 comments
Labels
enhancement New feature or request help wanted We accept pull requests!

Comments

@cccleon
Copy link

cccleon commented Jul 29, 2022

Thanks for your excellent work!
I use the mecanum plugin in my sdf file:
<plugin filename="ignition-gazebo-mecanum-drive-system" name="ignition::gazebo::systems::MecanumDrive"> <front_left_joint>front_left_wheel_joint</front_left_joint> <front_right_joint>front_right_wheel_joint</front_right_joint> <back_left_joint>rear_left_wheel_joint</back_left_joint> <back_right_joint>rear_right_wheel_joint</back_right_joint> <min_acceleration>-5</min_acceleration> <max_acceleration>5</max_acceleration> </plugin>
By running 'ign topic -l', I can see the topic "/model/xxx/odometry", but I get nothing when I echo this topic.
Additionally, "odom" frame is not in the TF tree, and there is no element like "publish_odom_tf" or "odom_frame" in MecanumDrive.cc, which can be found in the source code of navigation2 tutorial(diff-drive) .The tutorial uses 'libgazebo_ros_diff_drive.so', but I can't find the mecanum_drive.so

@cccleon cccleon added the enhancement New feature or request label Jul 29, 2022
@chapulina
Copy link
Contributor

Hi @cccleon , can you please update your feature request to follow the template?

<!-- If you're not sure on the specifics of the feature or would like a broader
discussion, please consider posting a proposal to
http://community.gazebosim.org/ instead.-->

## Desired behavior
<!-- Describe the current problem and the feature you want implemented.-->

## Alternatives considered
<!-- Describe alternate solutions or features you've considered.-->

## Implementation suggestion
<!-- Provide a suggestion on how to implement this feature, which could help us
expedite this implementation.-->

## Additional context
<!-- Provide any other additional context (e.g., screenshots) about your feature
request.-->

@andyblarblar
Copy link
Contributor

It looks like the MecanumDrive system lacks an updateOdometry function unlike the ackermann and diffDrive systems. To get odom and TF you'll need to first calculate accurate odom for a Mec drive, and then copy that odom message exactly over to a Pose_V message for Tf. The publishers are in the mec drive file, but unused.

@cccleon
Copy link
Author

cccleon commented Aug 1, 2022

It looks like the MecanumDrive system lacks an updateOdometry function unlike the ackermann and diffDrive systems. To get odom and TF you'll need to first calculate accurate odom for a Mec drive, and then copy that odom message exactly over to a Pose_V message for Tf. The publishers are in the mec drive file, but unused.

Thanks for your reply. You are right. The publisher is defined in line 308 but unused.

@cccleon
Copy link
Author

cccleon commented Aug 1, 2022

Desired behavior

Add updateOdometry function in MecanumDrive.cc

Implementation suggestion

Caculate the odometry message from joint states and publish.

Additional context

Maybe users can specify the <robot_base_frame> and <odom_frame> in sdf, thus the plugin can publish the TF between odom frame and robot_base frame as they want.

Hi @cccleon , can you please update your feature request to follow the template?

<!-- If you're not sure on the specifics of the feature or would like a broader
discussion, please consider posting a proposal to
http://community.gazebosim.org/ instead.-->

## Desired behavior
<!-- Describe the current problem and the feature you want implemented.-->

## Alternatives considered
<!-- Describe alternate solutions or features you've considered.-->

## Implementation suggestion
<!-- Provide a suggestion on how to implement this feature, which could help us
expedite this implementation.-->

## Additional context
<!-- Provide any other additional context (e.g., screenshots) about your feature
request.-->

Thanks for your reply! I think the problem is the lack of updateOdometry function as @andyblarblar mentioned.

Desired behavior

Add updateOdometry function in MecanumDrive.cc

Implementation suggestion

Caculate the odometry message from joint states and publish.

Additional context

Maybe users can specify the <robot_base_frame> and <odom_frame> in sdf, thus the plugin can publish the TF between odom frame and robot_base frame as they want.

@chapulina chapulina added the help wanted We accept pull requests! label Aug 8, 2022
@danilogsch
Copy link

danilogsch commented Aug 25, 2022

Hello everyone, I´ve been using this sim for some time now, awesome work by the way. I did 2 PRs to contribute on this issue:
#486
#1665

they are my first ones ever, please go easy on me. Does we need a TEST.cc?

@ahcorde
Copy link
Contributor

ahcorde commented Aug 25, 2022

Hi @danilogsch,

thank you for your contributions! I added some comments in the gz-math PR gazebosim/gz-math#486

Feel free to ask any question you have!

@danilogsch
Copy link

HI @ahcorde ,
I resolved most of it, on the gz-sim PR I am not able to rebase and sign off the commit, I am closing that to open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted We accept pull requests!
Projects
None yet
Development

No branches or pull requests

5 participants