-
Notifications
You must be signed in to change notification settings - Fork 369
Added Swerve Drive Controller Package #1694
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
base: master
Are you sure you want to change the base?
Added Swerve Drive Controller Package #1694
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for your contribution. Could you please fix the failing tests? A very quick first review below.
Do you mind add a brief section in the kinematics section of the docs, even in a new PR to get it merged faster? Thanks!
ament_target_dependencies(swerve_drive_controller | ||
builtin_interfaces | ||
controller_interface | ||
geometry_msgs | ||
hardware_interface | ||
nav_msgs | ||
pluginlib | ||
rclcpp | ||
rclcpp_lifecycle | ||
realtime_tools | ||
tf2 | ||
tf2_msgs | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately, this won't work any more on rolling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll refactor it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to include the license file here as we have it in the top level of the repo, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
|
||
Parameters | ||
,,,,,,,,,,, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use GPL to render the docs
This controller uses the `generate_parameter_library <https://github.com/PickNikRobotics/generate_parameter_library>`_ to handle its parameters. The parameter `definition file located in the src folder <https://github.com/ros-controls/ros2_controllers/blob/{REPOS_FILE_BRANCH}/swerve_drive_controller/src/swerve_drive_controller_parameters.yaml>`_ contains descriptions for all the parameters used by the controller. | |
.. generate_parameter_library_details:: | |
../src/swerve_drive_controller_parameters.yaml | |
An example parameter file could be |
@@ -0,0 +1,192 @@ | |||
// Copyright 2025 (your name or organization) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fill out, if you don't have an affiliation just add ros2_control development team
@@ -0,0 +1,99 @@ | |||
// Copyright 2025 (your name or organization) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fill me
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
<buildtool_depend>ament_cmake_ros</buildtool_depend> | ||
<!-- <build_depend>generate_parameter_library</build_depend> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why uncommented? should be of <depend>
level
https://github.com/PickNikRobotics/generate_parameter_library?tab=readme-ov-file#add-parameter-library-generation-to-project
@@ -0,0 +1,743 @@ | |||
// Copyright 2025 (your name or organization) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fill me
@@ -0,0 +1,108 @@ | |||
// Copyright 2025 (your name or organization) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fill me
@@ -0,0 +1,58 @@ | |||
// Copyright 2025 (your name or organization) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fill me
@@ -0,0 +1,457 @@ | |||
// Copyright 2025 (your name or organization) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fill me
I'll make changes and push. |
Description
This PR introduces the swerve_drive_controller, a new controller for swerve drive robots with four independently steerable wheels, enabling omnidirectional motion in ROS 2. It complements controllers like diff_drive_controller by supporting advanced mobile robot platforms.
Features
Supports geometry_msgs/msg/Twist or TwistStamped velocity inputs (x, y linear; z angular).
Publishes raw nav_msgs/msg/Odometry for user-defined post-processing.
Publishes /tf transforms (optional, if enable_odom_tf=true).
Configurable via YAML for wheel geometry and kinematic constraints.
Changes
Added swerve_drive_controller package (src/, include/, test/).
Exported as a pluginlib plugin (swerve_drive_controller_plugin.xml).
Updated ros2_controllers CMakeLists.txt and package.xml.
Included gtest tests (test/test_swerve_drive_controller.cpp) and config (test/config/test_swerve_drive_controller.yaml).