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

ackerman drive controller odometry rotation changes continuously #1244

Open
luxapana opened this issue Jul 27, 2024 · 6 comments
Open

ackerman drive controller odometry rotation changes continuously #1244

luxapana opened this issue Jul 27, 2024 · 6 comments

Comments

@luxapana
Copy link

luxapana commented Jul 27, 2024

I have setup an ackerman controller based on the demo's mentioned in the repo - https://github.com/ros-controls/gz_ros2_control/tree/master.

The controller is used in non chained mode. I have setup the plugin to remap tf_odometry messages as follows:
<remapping>/ackermann_steering_controller/tf_odometry:=/tf</remapping>

In addition to the controller, the joint state braodcaster also publisher messages to /tf topic.

When viewed in rviz2, everything works when things are stationary. When the car is moved linearly by publishing twist messages as below with only a linear velocity, the Rviz properly shows the movement and it is in sync with what is shown in gazebo.

ros2 topic pub /ackermann_steering_controller/reference_unstamped geometry_msgs/msg/Twist '{linear: {x: 1.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}'

If I include a steering angle component in the twist message, the movement is not in sync with gazebo. When these is only a steering angle component as below, in Rviz, the car rotates.

ros2 topic pub /ackermann_steering_controller/reference_unstamped geometry_msgs/msg/Twist '{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.1}}'

Please see below for a video. Also, when inspected /tf topic with ros2 topic echo, I can see that odom to base_link transform changes continuously. This agrees with what is shown in RViz.

Since what is set is steering angle and the vehicle movement is zero, can there be a continuous change in odom to base_link?

Screencast.from.07-27-2024.06.23.35.PM.webm
@christophfroehlich
Copy link
Contributor

christophfroehlich commented Aug 7, 2024

Can you share your controller parameters? Are you using open_loop mode? Could you change that parameter and see if the behavior changes?

Which version are you using? ros2 pkg xml -t version steering_controllers_library

@christophfroehlich
Copy link
Contributor

In addition to the controller, the joint state braodcaster also publisher messages to /tf topic.

you mean the robot state publisher?

@luxapana
Copy link
Author

luxapana commented Aug 8, 2024

The version is 2.35.0.
I tried open loop control, but still its the same. However rotation now is much slower. Please see below video in which I sent only a rotational element as follows:

ros2 topic pub /ackermann_steering_controller/reference_unstamped geometry_msgs/msg/Twist '{linear: {x: -0.00, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.2}}'

Screencast.from.08-08-2024.06.45.06.AM.webm

@christophfroehlich
Copy link
Contributor

christophfroehlich commented Aug 8, 2024

Would you like to share your robot, or maybe even contribute them to gz_ros2_control_demos?
Do you have the same behavior with the ackermann drive example from the demos?

But actually, this should be reproducible with Mock Hardware as well if you have the same behavior with open loop control.

@christophfroehlich christophfroehlich transferred this issue from ros-controls/gz_ros2_control Aug 8, 2024
@luxapana
Copy link
Author

I will shares the files, no problem.

@luxapana
Copy link
Author

luxapana commented Aug 10, 2024

files.zip
Please see the urdf, launch and controller config files attached.
Although I am also running slam, navigation and ekf fusion nodes, this issue is present without them also.

I have not tried the ackerman drive example from demos yet.

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

2 participants