Skip to content

Add Example 19 for DiffBot with launch_ros2_control#1078

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

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

Conversation

@SuperJappie08
Copy link
Copy Markdown

@SuperJappie08 SuperJappie08 commented Mar 13, 2026

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>
Copy link
Copy Markdown
Member

@destogl destogl left a comment

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.

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?

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?

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