Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add a controller for afour wheel independent steering / drive mobile base, aka a swerve drive #1425

Open
pvandervelde opened this issue Dec 15, 2024 · 11 comments

Comments

@pvandervelde
Copy link

I would like to add a controller for a 4 wheel independent steering and independent drive (aka swerve drive) mobile base. In this kind of mobile base each wheel has two degrees of freedom, one for moving the wheel around its axle and one for the steering motion of the wheel. Each wheel is independently controllable from the other wheels.

There have been several attempts at creating ROS controllers for such a system, e.g. ros-controls/ros_controllers#441, https://github.com/MarkNaeem/ros_controllers/tree/noetic-devel/swerve_steering_controller and #1148.

I have created a proof of concept for one such drive in python. Additionally I have created a simple simulation tool to test different control algorithms.

If there is interest I would like to implement a swerve controller for ROS2 control.

@christophfroehlich
Copy link
Contributor

Hi @pvandervelde!
Your contribution would be highly appreciated. I see that you started documenting the kinematics, as a first step you could add your documentation here and then build your controller upon that nomenclature.

@pvandervelde
Copy link
Author

@christophfroehlich That does sound like a good place to start. For the implementation process I was aiming to follow the process suggested in this comment by bmagyar. I'll reference this issue in all PRs.

I might have some questions about some parts of the library. Would those best be asked in the ROS discourse or just in this issue?

@christophfroehlich
Copy link
Contributor

Either on robotics stack exchange or here.

@Forsyth-Creations
Copy link

Hello! I would also like to work on this. What's the status on this @pvandervelde? I have a fork that I just started on, but wanted to check in here first. Thought I might start to port your work in

@Forsyth-Creations
Copy link

Oh yeah, I also have this. Been working on this for my masters research thesis:
https://github.com/Forsyth-Creations/ros_rigor
I have a basic controller written in python, but it for speed it would be nice to have it in C. Something I'm considering as apart of the research

@christophfroehlich
Copy link
Contributor

@Forsyth-Creations you are very welcome to submit a PR if @pvandervelde does not respond any more within the next days.

@pvandervelde
Copy link
Author

Hello! I would also like to work on this. What's the status on this @pvandervelde? I have a fork that I just started on, but wanted to check in here first. Thought I might start to port your work in

To be honest I have been hit with life and work and have been snowed under. I should have some spare time coming up in the next few weeks but if you have something that works then you should put it in.

@Forsyth-Creations
Copy link

I have two big questions as I work on this:

  1. How do you all go about testing these controllers? Is there documentation on this?
  2. How is this controller subsequently used for something like Gazebo? Is there a plugin schema I would need to write?

@Amronos
Copy link
Contributor

Amronos commented Feb 20, 2025

1. How do you all go about testing these controllers? Is there documentation on this?

I made a Gazebo simulation to test mine and then tested it in real life with a custom robot. Also, have a look at Mock Components

2. How is this controller subsequently used for something like Gazebo? Is there a plugin schema I would need to write?

Have a look at the gz_ros2_control documentation.

@christophfroehlich
Copy link
Contributor

  1. We write also unit tests to ensure everything works properly.
  2. I suggest that you have a look at the already available controllers, like the mecanum_drive_controller, and use this as a template.

@Forsyth-Creations
Copy link

Sweet, thank you!

Built this last night as a test of the kinematics:

https://www.forsythcreations.com/swerve_drive

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants