Add Example 19 for DiffBot with launch_ros2_control#1078
Open
SuperJappie08 wants to merge 2 commits intoros-controls:masterfrom
Open
Add Example 19 for DiffBot with launch_ros2_control#1078SuperJappie08 wants to merge 2 commits intoros-controls:masterfrom
SuperJappie08 wants to merge 2 commits intoros-controls:masterfrom
Conversation
Signed-off-by: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com>
Signed-off-by: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com>
destogl
requested changes
Mar 28, 2026
Member
There was a problem hiding this comment.
Thanks for the contribution. I would avoid copying the launch files but rather cross-reference them. This makes it very confusing and hard to maintain.
Also, I am encouraging that we remove controller manager parameters from the "controllers.yaml" and add type to each controller directly. See #1028 for an example.
| Controller( | ||
| name="pid_controller_left_wheel_joint", | ||
| # This file can technically be omitted, since it is loaded | ||
| # by the controller manager at startup |
Member
There was a problem hiding this comment.
Let's not load by controller manager. This should become obsolete.
| package="controller_manager", | ||
| executable="ros2_control_node", | ||
| output="both", | ||
| parameters=[controller_config_file], |
Member
There was a problem hiding this comment.
Rather set here only update_rate as this is the only required parameter.
| value="$(find-pkg-share ros2_control_demo_example_16)/config/diffbot_chained_controllers.yaml" /> | ||
|
|
||
| <node pkg="controller_manager" exec="ros2_control_node" output="both"> | ||
| <param from="$(var controller_config_file)" /> |
|
|
||
| <spawn_controller> | ||
| <controller name="pid_controller_left_wheel_joint"> | ||
| <!-- This file can technically be omitted, since it is loaded |
| Example 17: "RRBot with Hardware Component that publishes diagnostics" | ||
| This example shows how to publish diagnostics from a hardware component using the Executor passed from Controller Manager. | ||
|
|
||
| Example 19: "DiffBot with Conditionally Chained Controllers" |
| @@ -0,0 +1,71 @@ | |||
| # Launch-file for ros2_control_demos Example 16 | |||
| controller: | ||
| - name: pid_controller_left_wheel_joint | ||
| param: | ||
| # This file can technically be omitted, since it is loaded |
| # | ||
| # Based on ros-controls/ros2_control_demos/example2/bringup/launch/diffbot.launch.py | ||
|
|
||
| # Launch-file for ros2_control_demos Example 2 |
| ) | ||
|
|
||
| # Use global parameters to ensure parameter overriding happens in the correct order | ||
| ld.add_action(SetParametersFromFile(diffbot_controller_parameters)) |
| # controller configs at spawn time | ||
| parameters=[ | ||
| { | ||
| "type": "diff_drive_controller/DiffDriveController", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the examples previously found in
SuperJappie08/launch_ros2_control.Requires ros-controls/ros2_control#3122
New Examples (Checklist)
Additional Information
It could probably use a thorough read-through.