Swerve Steering ROS Controller

Please give proper credits to the repository if you use it in your work. :)

This is a ros_controller package, part of ROS control, that can be used to control omnidirectional non-holonomic robotic platforms with any number of regular wheels (AKA not mecanum wheels) and configurations (radius, position, steering limitations, offset from its axis).

The controller converts given velocity commands and converts it to wheels steering angles and speeds. It also takes care of each wheel's steering angle limitation (if any) and calculates the closest position considering the steering angle's supplementary value (i.e. if the wheel is ordered to steer to 90 and its closer to -90, it chooses the -90 and flips the direction of rotation to match the required position).

Each wheel has its own configuration parameters. They are all set through the parameters server. Some parameters (like the wheels' position relative to the base frame) can be taken from the /tf tree.

But what can it do more than four_wheel_Steering ros controller?
  • It can handle any number of wheels with any irregular configurations such as different steering angle limitations, different radii, and different locations with respect to base frame.
  • It can take static or dynamic configuration from a yaml file or from /tf, which means if, for any reason, the robot's wheels positons are changing, the controller will keep track and calculate proper speed and steering angle.
  • The base frame is variable and can be configured on the fly. The base frame is defines the pivot point that remains stationary under pure rotation. This gives the platform a lot of flexibility (as shown in the videos below).
Given these points, a four wheels swerve steering robot can be a differential robot, with the same controller!!

Here are some videos showing the package working.

As I've said, the base frame of the robot can be changed to anywhere. In the video above, the base frame was the center of the link holding the two robots together. In the upcoming video, the base frame is moved to the center of the rear platform.


There is also an odometry node. It can work with any number of wheels. It takes two joints for each wheel; the steering joint to get the steering angle , and the wheel joint to get the wheel angular velocity. This video is a demo of the node showing the odometry published from gazebo (/odom) and the calculated odometry (/odom2).
In order for this node to work correctly, the child_frame_id of the odom topic will be the base frame of the robot. So it has to be set correctly along with the wheels configurations (if set via a yaml file).

the videos above have been added to YouTube.