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

One motor runs in wrong direction with diff drive #29

Open
davidstart09 opened this issue Jan 18, 2023 · 5 comments
Open

One motor runs in wrong direction with diff drive #29

davidstart09 opened this issue Jan 18, 2023 · 5 comments

Comments

@davidstart09
Copy link

I have probably missed something but the problem i have is with a diff drive robot using ros2 control under ros2 foxy. rviz shows wheels rotating correctly but when going forward both motors rotate in the same direction which means one wheel is going in the wrong direction due to motors bing mirrored.

@davidstart09
Copy link
Author

Also when trying to rotate robot the motors don't really move

@borongyuan
Copy link
Member

Hi, if you set up transformations according to the convention, the reference frames of wheels should all be parallel. This means that all wheel joints should rotate in the same direction as the robot moves forward.
tf_full_tree
Of course, if you use a symmetrical motor layout, the motors on both sides should rotate in opposite directions. However, the ros2_control framework hopes that upper-level developers can look at problems from the perspective of joints, without considering the specific implementation of actuators. There was a PR (#23) that added the rotation direction configuration, but I don't quite agree with this approach. The mapping between actuator and joint space should be handled by transmission interface.

@avibrown
Copy link

avibrown commented Apr 3, 2023

Hi, if you set up transformations according to the convention, the reference frames of wheels should all be parallel. This means that all wheel joints should rotate in the same direction as the robot moves forward. tf_full_tree Of course, if you use a symmetrical motor layout, the motors on both sides should rotate in opposite directions. However, the ros2_control framework hopes that upper-level developers can look at problems from the perspective of joints, without considering the specific implementation of actuators. There was a PR (#23) that added the rotation direction configuration, but I don't quite agree with this approach. The mapping between actuator and joint space should be handled by transmission interface.

Hi,

Could you please offer a clear guide as to how to use transmissions? For someone new to this stuff it is pretty hard to grasp at first. I personally have been stuck on this issue for hours trying to get the wheel directions to match those of my physical robot (they are reversed as in the case of OP).

If you can show a simple setup for a differential drive robot it would be super helpful. Thank you!

@borongyuan
Copy link
Member

Sorry for the late reply. The ros2_control_demos packages are restructed and have quite a few updates. A demo for transmission interface was added in ros-controls/ros2_control_demos#226. I'll check compatibility and update demos later.

@MichaelT800
Copy link

I have the same problem,
when I change right_wheel_radius_multiplier to -1 in the file diff_drive_controller.yaml then the motor can rotate in reverse
and
-0.1 will respond correctly to the speed control according to the 1:10 reduction ratio.
Hope this helps!

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

No branches or pull requests

4 participants