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

Ackermann preceding reference command interfaces are not correct #1167

Closed
wittenator opened this issue Jun 9, 2024 · 3 comments · Fixed by #1168
Closed

Ackermann preceding reference command interfaces are not correct #1167

wittenator opened this issue Jun 9, 2024 · 3 comments · Fixed by #1168
Labels

Comments

@wittenator
Copy link

wittenator commented Jun 9, 2024

Describe the bug
I am building a ackermann-controlled vehicle and would like to control the mobile base via steering angle and linear velocity instead of a twist since I have a preceding pure pursuit controller. In the documentation (Ackermann Controller it says that the references are linear velocity and angular position of the steering. Setting these references via ForwardController reveals that the angular position command interface is in fact a angular velocity command interface. Since the steering library is worked on rn anyway: Would it be an idea to let people switch between controlling the vehicle via Twist or AckermannDrive messages? This would remove the slightly awkward setup of having to separate ForwardCommand controllers or a completely self-written controller just to set steering angle and velocity instead of a Twist.

To Reproduce
Steps to reproduce the behavior:

  1. Start an Ackermann vehicle
  2. Attach two forward command controllers to the Ackermann controller e.g.
 ros__parameters:
   joints:
     - ackermann_steering_controller/angular

forward_velocity_controller:
 ros__parameters:
   joints:
     - ackermann_steering_controller/linear 
  1. Set a steering command and a linear velocity command

Expected behavior
Setting a steering angle should be passed on to the angle commands and not be correlated with the velocity.

Screenshots
MicrosoftTeams-image(2)
The blue line is the commanded steering angle and the orange one is the true steering angle. Changing the linear velocity also influences the steering angle.

Environment (please complete the following information):

  • OS: Ubuntu 22
  • Version Iron

Additional context
Add any other context about the problem here, especially include any modifications to any ros2_controllers that relate to this issue.

@christophfroehlich
Copy link
Contributor

You are right, the reference interfaces have the same meaning than body twist -> #1168

If you have your own controller, why do you need the ackermann steering ctrl at all? Just for odometry calculations?

The author of the lib mentioned support ackermann_msg reference messages as missing feature. You want to implement this and submit a PR?

There are other issues with this controller, see #1150. As you are working with it currently, maybe you can have a look and review it?

@wittenator
Copy link
Author

wittenator commented Jun 9, 2024

We have two controllers mostly for separation of concerns reasons and for the odometry that comes for free (also I want to push the usage of ros2_control and ros2_controllers internally and maybe push people to migrate their controllers like pure pursuit and MPCs to ros2_control :) ). I already started implementing a switch parameter in the steering library that allows switching between Twist and AckermannDrive messages. I forked the repo and branched off #1150 for this, so I think that I'll get some experiences with the new changes. I'll report once I have something to useful to say (I just have to migrate our project to Jazzy first)^^ But thanks for the clarification already!

@wittenator
Copy link
Author

For reference: I added a WIP PR here in #1171 . I still need to add tests for the new code though, but our simulated car drives very well with the changes. I will add a video to the PR as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants