Skip to content

Add multi_omni_wheel_drive_controller #1535

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 41 commits into
base: master
Choose a base branch
from

Conversation

Amronos
Copy link
Contributor

@Amronos Amronos commented Feb 12, 2025

This is a controller for mobile robots with omnidirectional drive. It supports using 3 or more omni wheels spaced at an equal angle from each other in a circular formation.

I have added many tests similar to other controllers and updated the docs.
Please review this controller and tell me if you have any doubts regarding its working.

I will be updating mobile_robot_kinematics.rst for the kinematics of this controller and for that wanted to ask what software has been used to make the diagrams in that doc. 😄

@christophfroehlich

This comment was marked as outdated.

@Amronos

This comment was marked as outdated.

@christophfroehlich

This comment was marked as outdated.

@Amronos
Copy link
Contributor Author

Amronos commented Feb 12, 2025

82b6d87 should fix some of the failures, the other ones I am not too sure on how to fix ff32b2d should fix the others.

@Amronos

This comment was marked as outdated.

@Amronos

This comment was marked as outdated.

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your contribution.

Why you named your controller multi_omni_wheel_drive_controller? why not just omni_wheel_drive_controller, or omni_drive_controller like our friends at PAL do call it?

The first review round, where I only had a look at the docs and the description. I just added some stylistic comments as well as changes to use standard nomenclature (like state interfaces instead of feedback). Just in case you don't know, you can commit them all at once from the "Files Changed" tab here.

Amronos and others added 2 commits February 15, 2025 09:37
Co-authored-by: Christoph Fröhlich <[email protected]>
Co-authored-by: Christoph Fröhlich <[email protected]>
@Amronos
Copy link
Contributor Author

Amronos commented Feb 15, 2025

Why you named your controller multi_omni_wheel_drive_controller? why not just omni_wheel_drive_controller, or omni_drive_controller like our friends at PAL do call it?

I didn't name it omni_drive_controller because I didn't want someone to get confused that it is based on mecanum wheels. I named it multi_omni_wheel_drive_controller instead of omni_wheel_drive_controller because I wanted to emphasize the fact that it can work with as many omni wheels as one would like, but now that I think about it omni_wheel_drive_controller would have also been nice.

@Amronos
Copy link
Contributor Author

Amronos commented Apr 6, 2025

Please review!

@christophfroehlich
Copy link
Contributor

May I cite our contribution guidelines:

Even if you are not a maintainer, you are still encouraged to review pull requests. This helps us increase the review pace and increase code quality. Also, you are very likely to find some issues/limitations nobody else is seeing.

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

@Amronos I did a quick partial review of the PR. Thanks for the great work. I've highlighted a couple of things in my review.

Apart from that, there are not many tests for your different robot cases. Please correct me if I'm wrong. It being a very generic controller, i think it would make sense to split the main kinematics logic into a different library within the same package that is completely ROS-Free and then use that API from within the controller

This should help you to write more test cases easily and also gives us a nice self contained library. What do you think?

<name>multi_omni_wheel_drive_controller</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="[email protected]">Aarav Gupta</maintainer>
Copy link
Member

Choose a reason for hiding this comment

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

Please add all other maintainers here as well + Add yourself as author.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 96c4aa1

{
type: string,
default_value: "",
description: "(optional) Prefix to be appended to the tf frames, will be added to odom_id and base_frame_id before publishing. If the parameter is empty, controller's namespace will be used.",
Copy link
Member

Choose a reason for hiding this comment

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

Why use the controller's namespace? Do you have any usecase for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I often use the robot_localization package, which allows me to fuse the odometry from this controller with, for example, the data from an IMU. I like the ekf_node from that package to publish on the /odom topic and listen to the /<controller_name>/odom topic.

Comment on lines +89 to +94
publish_rate:
{
type: double,
default_value: 50.0, # Hz
description: "Publishing rate (Hz) of the odometry and TF messages.",
}
Copy link
Member

Choose a reason for hiding this comment

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

@Amronos does it make sense to have a seperation between Odometry and tf publish rates?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suppose it does make some sense to have them separated, but I would also like to see a use case for this.
The whole concept of publish_rate probably requires a larger discussion.

Comment on lines 53 to 63
pose_covariance_diagonal:
{
type: double_array,
default_value: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
description: "Odometry covariance for the encoder output of the robot for the pose. These values should be tuned to your robot's sample odometry data, but these values are a good place to start: ``[0.001, 0.001, 0.001, 0.001, 0.001, 0.01]``.",
}
twist_covariance_diagonal:
{
type: double_array,
default_value: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
description: "Odometry covariance for the encoder output of the robot for the speed. These values should be tuned to your robot's sample odometry data, but these values are a good place to start: ``[0.001, 0.001, 0.001, 0.001, 0.001, 0.01]``.",
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to have a structure like

diagonal_covariance:

   pose: ....
   twist: ....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 96c4aa1

Amronos and others added 2 commits April 12, 2025 13:36
Co-authored-by: Sai Kishor Kothakota <[email protected]>
Co-authored-by: Sai Kishor Kothakota <[email protected]>
@Amronos
Copy link
Contributor Author

Amronos commented Apr 12, 2025

May I cite our contribution guidelines:

Even if you are not a maintainer, you are still encouraged to review pull requests. This helps us increase the review pace and increase code quality. Also, you are very likely to find some issues/limitations nobody else is seeing.

I try my best to do so whenever I get the time. I have reviewed 3 or 4 PRs here and there. I don't review most of them as I lack the necessary skills/knowledge about the ros-controls codebase Will try to do more reviews in the future.

@Amronos
Copy link
Contributor Author

Amronos commented Apr 12, 2025

@Amronos I did a quick partial review of the PR. Thanks for the great work. I've highlighted a couple of things in my review.

Thank you so much for the review!

Apart from that, there are not many tests for your different robot cases. Please correct me if I'm wrong. It being a very generic controller, i think it would make sense to split the main kinematics logic into a different library within the same package that is completely ROS-Free and then use that API from within the controller
This should help you to write more test cases easily and also gives us a nice self contained library. What do you think?

Will work on both of these things.

@saikishor
Copy link
Member

@Amronos please next time apply the suggestion directly from our suggestions. If not, we'll have to recheck things and this will be easier for both parties. I hope you understand.

Thank you

@Amronos
Copy link
Contributor Author

Amronos commented Apr 12, 2025

@Amronos please next time apply the suggestion directly from our suggestions. If not, we'll have to recheck things and this will be easier for both parties. I hope you understand.

Thank you

I do think that's what I did, by going to the files changed tab, adding suggestions to batch and then commiting. Please do tell if I needed to do something else.

@saikishor
Copy link
Member

saikishor commented Apr 12, 2025

I do think that's what I did, by going to the files changed tab, adding suggestions to batch and then commiting. Please do tell if I needed to do something else.

I apologise. From my mobile it looked different. Thanks for confirming :)

@Amronos
Copy link
Contributor Author

Amronos commented Apr 15, 2025

Apart from that, there are not many tests for your different robot cases. Please correct me if I'm wrong. It being a very generic controller, i think it would make sense to split the main kinematics logic into a different library within the same package that is completely ROS-Free and then use that API from within the controller

This should help you to write more test cases easily and also gives us a nice self contained library. What do you think?

@saikishor Thinking about this more:
Regarding the tests, I don't feel there is a need for more, as all the tests will just be testing the kinematics calculations for different robots. If they are working for one robot, I don't see why the same calculations won't work for another one, as the generic part of the controller is the generic kinematics.

For the library, I don't think it makes sense (if there are no additional tests to write) to have a different library within this package, as anyone who will want to be using the kinematics will need to download the ros2_control stack either way; in that regard, the library won't have a lot of benefits. There is already a separate odometry.hpp header that can be used. It will be helpful, though, to create a library that is completely independent of the ROS ecosystem for the kinematics of various robot drives, something which I may consider doing in the future.

Please tell me your opinion on this!

@Amronos Amronos requested a review from saikishor April 15, 2025 12:04
@saikishor
Copy link
Member

@saikishor Thinking about this more: Regarding the tests, I don't feel there is a need for more, as all the tests will just be testing the kinematics calculations for different robots. If they are working for one robot, I don't see why the same calculations won't work for another one, as the generic part of the controller is the generic kinematics.

I understand that if it works for one robot, it should work for others too, but as the package specifies it is a multi_omni_wheel_drive_controller. I expect atleast tests with 3 different base configurations and their odometry properly tested.

For the library, I don't think it makes sense (if there are no additional tests to write) to have a different library within this package, as anyone who will want to be using the kinematics will need to download the ros2_control stack either way; in that regard, the library won't have a lot of benefits. There is already a separate odometry.hpp header that can be used. It will be helpful, though, to create a library that is completely independent of the ROS ecosystem for the kinematics of various robot drives, something which I may consider doing in the future.

I'm talking for the sake of tests to use something like this as a ROS independent library. Sure, if you are fine to do it in future, we can leave it for future, but please add tests for more configurations of the base kinematics and odometry tests.

@Amronos
Copy link
Contributor Author

Amronos commented Apr 15, 2025

Thanks a lot for understanding! I will go ahead and add 3-4 more tests but it will take some time as I won't be at home for a few days.

@Amronos
Copy link
Contributor Author

Amronos commented Apr 25, 2025

@saikishor I have added the tests requested with 86b351e

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.

[ROS2_controller] Add community controllers in "Controllers for Mobile Robots" list on ROS2_control doc
3 participants