Skip to content

Add Example 19 for DiffBot with launch_ros2_control - #1078

Open
SuperJappie08 wants to merge 2 commits into
ros-controls:masterfrom
SuperJappie08:launch-ext
Open

Add Example 19 for DiffBot with launch_ros2_control#1078
SuperJappie08 wants to merge 2 commits into
ros-controls:masterfrom
SuperJappie08:launch-ext

Conversation

@SuperJappie08

@SuperJappie08 SuperJappie08 commented Mar 13, 2026

Copy link
Copy Markdown

Adds the examples previously found in SuperJappie08/launch_ros2_control.

Requires ros-controls/ros2_control#3122

New Examples (Checklist)

  • The correct folder structure (described in the main README.md)
  • Example has doc/README.rst with description
  • Detailed commands how to run an example
  • [~] Output examples of CLI commands (handled similarly to other examples)

Additional Information

It could probably use a thorough read-through.

Signed-off-by: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com>
Signed-off-by: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com>

@destogl destogl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not load by controller manager. This should become obsolete.

package="controller_manager",
executable="ros2_control_node",
output="both",
parameters=[controller_config_file],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.


<spawn_controller>
<controller name="pid_controller_left_wheel_joint">
<!-- This file can technically be omitted, since it is loaded

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commentas as above.

Comment thread doc/index.rst
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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it 16 or 19?

@@ -0,0 +1,71 @@
# Launch-file for ros2_control_demos Example 16

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

16 or 19?

@SuperJappie08 SuperJappie08 Mar 30, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These examples were originally the examples from my original package.
In which I reimplemented examples 2 and 16 and also introduced the new 2_16, which is setup to such that it can toggle between the two.

controller:
- name: pid_controller_left_wheel_joint
param:
# This file can technically be omitted, since it is loaded

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

#
# Based on ros-controls/ros2_control_demos/example2/bringup/launch/diffbot.launch.py

# Launch-file for ros2_control_demos Example 2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this here?

)

# Use global parameters to ensure parameter overriding happens in the correct order
ld.add_action(SetParametersFromFile(diffbot_controller_parameters))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this?

# controller configs at spawn time
parameters=[
{
"type": "diff_drive_controller/DiffDriveController",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this not in yaml?

@SuperJappie08

Copy link
Copy Markdown
Author

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.

@destogl Thank you for the feedback. Currently this reimplements examples 2 and 16 with the launch extension; would you suggest removing those launch files or replacing their current version in the other examples?

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.

@github-actions github-actions Bot added the stale label May 14, 2026
@SuperJappie08

Copy link
Copy Markdown
Author

Ping, to keep alive (hopefully I have time and energy to look at this soonish)

@github-actions github-actions Bot removed the stale label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants