ros2_controllers icon indicating copy to clipboard operation
ros2_controllers copied to clipboard

ackerman drive controller odometry rotation changes continuously

Open luxapana opened this issue 1 year ago • 6 comments

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

luxapana avatar Jul 27 '24 12:07 luxapana

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 avatar Aug 07 '24 20:08 christophfroehlich

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

you mean the robot state publisher?

christophfroehlich avatar Aug 07 '24 20:08 christophfroehlich

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

luxapana avatar Aug 08 '24 01:08 luxapana

~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 avatar Aug 08 '24 06:08 christophfroehlich

I will shares the files, no problem.

luxapana avatar Aug 10 '24 01:08 luxapana

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.

luxapana avatar Aug 10 '24 01:08 luxapana

This issue is being labeled as stale because it has been open 45 days with no activity. It will be automatically closed after another 45 days without follow-ups.

github-actions[bot] avatar Mar 27 '25 12:03 github-actions[bot]

This issue was closed because it has been stalled for 45 days with no activity.

github-actions[bot] avatar May 12 '25 12:05 github-actions[bot]