Closed knickels closed 5 months ago
I'm trying to adapt the tricycle example to use the ackermann steering controller. I'm surprised how many folks are trying this same thing with various versions of ROS, various versions of Gazebo, etc.... but haven't been able to find a good full example that uses the AckermannSteeringController. Even example_11 in https://github.com/ros-controls/ros2_control_demos/tree/humble uses a bicycle onctroller not an ackermann for their CarLike robot!
I discussed this here: Ackermann steering is a setup where the two steering wheels can set their steering angle independently. Why should the car-like robot from example_11 not use the bicycle controller? What you mention, a mimicked steering wheel, does not make any sense physically? But the URDF you posted seems to have independent steering -> this should be fine. But numenclature from literature: car-like is not Ackermann!
Be aware that the tricycle controller from the demo of this repo has steering and traction on the same wheel, why the current ackermann steering controller implementation supports only traction on the other axle than steering.
Nevertheless, I was able to reproduce your segfault.
Use the correct joint names (left_rear_wheel_joint
instead of rear_left_wheel_joint
) and it launches successfully. Additionally, use the correct controller name in your launch file and also your controller will be activated:
$ ros2 control list_controllers
joint_state_broadcaster[joint_state_broadcaster/JointStateBroadcaster] active
ackermann_steering_controller[ackermann_steering_controller/AckermannSteeringController] active
Summarized, ign_ros2_control should not crash with a segfault but give useful feedback if wrong joints are configure. I'll open a new issue for that.
Thanks for the extra eyeballs! I had checked those link names several times and somehow missed it. It's working now. I'll take a look at the kinematics references you gave, thanks for those pointers.
OK, I've read up on the kinematics. I see that the example_11 car has a virtual front wheel, which is controlled by the controller. It also has two visible wheels who mimic the turning angle. If all three wheels have friction, and point the same direction, why don't two of them slip against the ground?
In my model I had some wonky mass numbers, which may have contributed to the strange steering behavior, but I attributed it to this comment you make in ackermann-steering - "To prevent the front wheels from slipping, the steering angle of the front wheels cannot be equal. This is the so-called Ackermann steering." This model doesn't have the linkage you mention right below there.
But since this model doesn't run in gazebo, but rather publish it's own odometry, that doesn't matter so much? So the wheels in a physical car-like robot won't exactly match the wheel directions in this model?
Example 11 is just for exemplary purpose. The virtual_front_wheel wouldn't be necessary, it is just a virtual controller output instead of choosing the left or right one. You are right, physically mimicked steering wheels with linear kinematics would not work, but this was not the claim of this example.
Got it. Wasn't complaining, just checking my comprehension. Thanks again for the help.
I've installed the binary packages for ros-humble-ign-ros2-control-demos, and prerequisites, through apt, on Ubuntu 22.04. I'm using Gazebo Fortress (6.16.0) (installed via apt - ignition-tools).
I'm trying to adapt the tricycle example to use the ackermann steering controller. I'm surprised how many folks are trying this same thing with various versions of ROS, various versions of Gazebo, etc.... but haven't been able to find a good full example that uses the AckermannSteeringController. Even example_11 in https://github.com/ros-controls/ros2_control_demos/tree/humble uses a bicycle onctroller not an ackermann for their CarLike robot!
I first added a fourth wheel (mimic to other front wheel) to the tricycle demo from ign_ros2_control_demos, still using the tricycle controller but with the two front wheels at the same angle and speed it drug the car sideways - which makes sense kinematically. I then set mu1=mu2=0 to make the new wheel frictionless and it works just fine. So now I'm trying to use the ackermann steering controller.
I'm getting a segfault from gazebo, I think from the control plugin. I'm not sure how to get more verbosity from ignition/gazebo to see what it's unhappy with (I'm guessing in the controller parameters, that's the biggest change from my four-wheel-tricycle which works just fine).
Any debugging advise would be welcome! Gory details and copies of files below. --kn
Here is my setup, starting with my launch file (my package is in rover_description and rover_gazebo):
$ ros2 launch rover_gazebo carlike_ackermann.launch.py
With the response of:
Here is the launch file, not much changed from
tricycle_drive_example.launch.py
in the ign_ros2_control_demos repo: carlike_ackerman_launch_py.txtThe URDF it pulls in: carlike_ackermann_urdf.txt
And finally the steering controller parameters. ackermann_steering_controller_yaml.txt