├── gz_ros2_control_tests
├── rolling.ignored
├── CMakeLists.txt
├── tests
│ ├── CMakeLists.txt
│ ├── effort_test.py
│ ├── position_test.py
│ ├── velocity_custom_plugin_test.py
│ ├── velocity_test.py
│ └── ft_sensor_test.py
├── package.xml
└── CHANGELOG.rst
├── doc
└── img
│ ├── diff_drive.gif
│ ├── gz_gripper.gif
│ ├── gz_ros2_control.gif
│ └── ign_ros2_control.gif
├── Dockerfile
├── entrypoint.sh
└── Dockerfile
├── .github
├── CODEOWNERS
├── workflows
│ ├── update-pre-commit.yml
│ ├── triage.yml
│ ├── ci-format.yaml
│ ├── jazzy-check-docs.yml
│ ├── humble-check-docs.yml
│ ├── kilted-check-docs.yml
│ ├── rolling-check-docs.yml
│ ├── stale.yml
│ ├── ci-rolling.yaml
│ ├── ci-jazzy.yaml
│ ├── ci-kilted.yaml
│ └── ci-humble.yaml
└── dependabot.yml
├── gz_ros2_control
├── gz_hardware_plugins.xml
├── package.xml
├── include
│ └── gz_ros2_control
│ │ ├── gz_ros2_control_plugin.hpp
│ │ ├── gz_system.hpp
│ │ └── gz_system_interface.hpp
└── CMakeLists.txt
├── gz_ros2_control_demos
├── config
│ ├── gripper_controller_effort.yaml
│ ├── gripper_controller_position.yaml
│ ├── cart_controller_position.yaml
│ ├── cart_controller_effort.yaml
│ ├── cart_controller_ft_sensor.yaml
│ ├── cart_controller_velocity.yaml
│ ├── mecanum_drive_controller.yaml
│ ├── ackermann_drive_controller.yaml
│ ├── diff_drive_controller.yaml
│ └── tricycle_drive_controller.yaml
├── gz_custom_hardware_plugins.xml
├── examples
│ ├── example_mobile_robots.cpp
│ └── example_gripper.cpp
├── package.xml
├── urdf
│ ├── test_cart_effort.xacro.urdf
│ ├── test_cart_position.xacro.urdf
│ ├── test_cart_velocity_custom_plugin.xacro.urdf
│ ├── test_gripper_mimic_joint_effort.xacro.urdf
│ ├── test_gripper_mimic_joint_position.xacro.urdf
│ ├── test_cart_ft_sensor.xacro.urdf
│ ├── test_pendulum_effort.xacro.urdf
│ ├── test_pendulum_position.xacro.urdf
│ ├── test_diff_drive.xacro.urdf
│ ├── test_tricycle_drive.xacro.urdf
│ └── test_cart_velocity.xacro.urdf
├── launch
│ ├── gripper_mimic_joint_example_effort.launch.xml
│ ├── gripper_mimic_joint_example_position.launch.xml
│ ├── pendulum_example_effort.launch.py
│ ├── pendulum_example_position.launch.py
│ ├── cart_example_effort.launch.py
│ ├── gripper_mimic_joint_example_effort.launch.py
│ ├── gripper_mimic_joint_example_position.launch.py
│ ├── cart_example_position.launch.py
│ ├── cart_example_velocity_custom_plugin.launch.py
│ ├── tricycle_drive_example.launch.py
│ ├── mecanum_drive_example.launch.py
│ ├── diff_drive_example_namespaced.launch.py
│ ├── cart_example_velocity.launch.py
│ ├── diff_drive_example.launch.py
│ ├── ackermann_drive_example.launch.py
│ └── cart_example_ft_sensor.launch.py
├── include
│ └── gz_ros2_control_demos
│ │ └── gz_custom_system.hpp
├── CMakeLists.txt
└── worlds
│ └── empty_ft_sensor.sdf
├── gz_ros2_control.humble.repos
├── gz_ros2_control.jazzy.repos
├── gz_ros2_control.kilted.repos
├── gz_ros2_control.rolling.repos
├── .pre-commit-config.yaml
└── README.md
/gz_ros2_control_tests/rolling.ignored:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/doc/img/diff_drive.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-controls/gz_ros2_control/HEAD/doc/img/diff_drive.gif
--------------------------------------------------------------------------------
/doc/img/gz_gripper.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-controls/gz_ros2_control/HEAD/doc/img/gz_gripper.gif
--------------------------------------------------------------------------------
/doc/img/gz_ros2_control.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-controls/gz_ros2_control/HEAD/doc/img/gz_ros2_control.gif
--------------------------------------------------------------------------------
/doc/img/ign_ros2_control.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-controls/gz_ros2_control/HEAD/doc/img/ign_ros2_control.gif
--------------------------------------------------------------------------------
/Dockerfile/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | . /opt/ros/"${ROS_DISTRO}"/setup.sh
4 | . /home/ros2_ws/install/setup.sh
5 | exec "$@"
6 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # More info:
2 | # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
3 |
4 | * @ahcorde
5 |
--------------------------------------------------------------------------------
/gz_ros2_control_tests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.10)
2 | project(gz_ros2_control_tests)
3 |
4 | find_package(ament_cmake REQUIRED)
5 |
6 | if(BUILD_TESTING)
7 | find_package(ament_lint_auto REQUIRED)
8 | ament_lint_auto_find_test_dependencies()
9 |
10 | add_subdirectory(tests)
11 | endif()
12 |
13 | ament_package()
14 |
--------------------------------------------------------------------------------
/gz_ros2_control/gz_hardware_plugins.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | ros2_control hardware component to be loaded by the gazebo plugin.
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/gz_ros2_control_tests/tests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | find_package(launch_testing_ament_cmake REQUIRED)
2 |
3 | add_launch_test(position_test.py
4 | TIMEOUT 50
5 | )
6 | add_launch_test(velocity_test.py
7 | TIMEOUT 50
8 | )
9 | add_launch_test(velocity_custom_plugin_test.py
10 | TIMEOUT 50
11 | )
12 | add_launch_test(effort_test.py
13 | TIMEOUT 50
14 | )
15 |
16 | add_launch_test(ft_sensor_test.py
17 | TIMEOUT 50
18 | )
19 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/config/gripper_controller_effort.yaml:
--------------------------------------------------------------------------------
1 | controller_manager:
2 | ros__parameters:
3 | update_rate: 100 # Hz
4 |
5 | joint_state_broadcaster:
6 | type: joint_state_broadcaster/JointStateBroadcaster
7 |
8 | gripper_controller:
9 | ros__parameters:
10 | type: forward_command_controller/ForwardCommandController
11 | joints:
12 | - right_finger_joint
13 | interface_name: effort
14 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/config/gripper_controller_position.yaml:
--------------------------------------------------------------------------------
1 | controller_manager:
2 | ros__parameters:
3 | update_rate: 100 # Hz
4 |
5 | joint_state_broadcaster:
6 | type: joint_state_broadcaster/JointStateBroadcaster
7 |
8 | gripper_controller:
9 | ros__parameters:
10 | type: forward_command_controller/ForwardCommandController
11 | joints:
12 | - right_finger_joint
13 | interface_name: position
14 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/gz_custom_hardware_plugins.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | Custom ros2_control hardware component to be loaded by the gazebo plugin.
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.github/workflows/update-pre-commit.yml:
--------------------------------------------------------------------------------
1 | name: Auto Update pre-commit
2 | # Update pre-commit config and create PR if changes are detected
3 | # author: Christoph Fröhlich
4 |
5 | on:
6 | workflow_dispatch:
7 | schedule:
8 | - cron: '0 0 1 * *' # Runs at 00:00, on day 1 of the month
9 |
10 | jobs:
11 | auto_update_and_create_pr:
12 | uses: ros-controls/ros2_control_ci/.github/workflows/reusable-update-pre-commit.yml@master
13 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/config/cart_controller_position.yaml:
--------------------------------------------------------------------------------
1 | controller_manager:
2 | ros__parameters:
3 | update_rate: 1000 # Hz
4 |
5 | joint_state_broadcaster:
6 | type: joint_state_broadcaster/JointStateBroadcaster
7 |
8 | joint_trajectory_controller:
9 | ros__parameters:
10 | type: joint_trajectory_controller/JointTrajectoryController
11 | joints:
12 | - slider_to_cart
13 | command_interfaces:
14 | - position
15 | state_interfaces:
16 | - position
17 | - velocity
18 |
--------------------------------------------------------------------------------
/.github/workflows/triage.yml:
--------------------------------------------------------------------------------
1 | on:
2 | issues:
3 | types: [opened]
4 | pull_request_target:
5 | types: [opened]
6 | name: Ticket opened
7 | jobs:
8 | assign:
9 | name: Add ticket to inbox
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Add ticket to inbox
13 | uses: technote-space/create-project-card-action@v1
14 | with:
15 | PROJECT: Core development
16 | COLUMN: Inbox
17 | GITHUB_TOKEN: ${{ secrets.TRIAGE_TOKEN }}
18 | CHECK_ORG_PROJECT: true
19 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/config/cart_controller_effort.yaml:
--------------------------------------------------------------------------------
1 | controller_manager:
2 | ros__parameters:
3 | update_rate: 1000 # Hz
4 |
5 | joint_state_broadcaster:
6 | type: joint_state_broadcaster/JointStateBroadcaster
7 |
8 | joint_trajectory_controller:
9 | ros__parameters:
10 | type: joint_trajectory_controller/JointTrajectoryController
11 | joints:
12 | - slider_to_cart
13 | command_interfaces:
14 | - effort
15 | state_interfaces:
16 | - position
17 | - velocity
18 | gains:
19 | slider_to_cart:
20 | p: 100.0
21 | i: 0.0
22 | d: 10.0
23 | i_clamp: 0.0
24 | antiwindup: false
25 |
--------------------------------------------------------------------------------
/.github/workflows/ci-format.yaml:
--------------------------------------------------------------------------------
1 | # This is a format job. Pre-commit has a first-party GitHub action, so we use
2 | # that: https://github.com/pre-commit/action
3 |
4 | name: Format
5 |
6 | on:
7 | workflow_dispatch:
8 | pull_request:
9 |
10 | jobs:
11 | pre-commit:
12 | name: Format
13 | runs-on: ubuntu-22.04
14 | steps:
15 | - uses: actions/checkout@v6
16 | - uses: actions/setup-python@v6
17 | with:
18 | python-version: 3.10.6
19 | - name: Install system hooks
20 | run: sudo apt install -qq cppcheck ament-cmake-uncrustify ament-cmake-pep257
21 | - uses: pre-commit/action@v3.0.1
22 | with:
23 | extra_args: --all-files --hook-stage manual
24 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/config/cart_controller_ft_sensor.yaml:
--------------------------------------------------------------------------------
1 | controller_manager:
2 | ros__parameters:
3 | update_rate: 1000 # Hz
4 |
5 | joint_state_broadcaster:
6 | type: joint_state_broadcaster/JointStateBroadcaster
7 |
8 | joint_trajectory_controller:
9 | ros__parameters:
10 | type: joint_trajectory_controller/JointTrajectoryController
11 | joints:
12 | - slider_to_cart
13 | command_interfaces:
14 | - position
15 | state_interfaces:
16 | - position
17 | - velocity
18 |
19 | force_torque_sensor_broadcaster:
20 | ros__parameters:
21 | type: force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster
22 | sensor_name: "force_torque_sensor"
23 | frame_id: "slider_to_cart"
24 |
--------------------------------------------------------------------------------
/.github/workflows/jazzy-check-docs.yml:
--------------------------------------------------------------------------------
1 | name: Check Docs - Jazzy
2 |
3 | on:
4 | workflow_dispatch:
5 | pull_request:
6 | branches:
7 | - jazzy
8 | paths:
9 | - '**.rst'
10 | - '**.md'
11 | - '**.jpg'
12 | - '**.jpeg'
13 | - '**.png'
14 | - '**.svg'
15 | - '**.yml'
16 | - '**.yaml'
17 | - '!.github/**' # exclude yaml files in .github directory
18 | - '.github/workflows/jazzy-check-docs.yml'
19 |
20 | concurrency:
21 | group: ${{ github.workflow }}-${{ github.ref }}
22 | cancel-in-progress: true
23 |
24 | jobs:
25 | check-docs:
26 | name: Check Docs
27 | uses: ros-controls/control.ros.org/.github/workflows/reusable-sphinx-check-single-version.yml@jazzy
28 | with:
29 | GZ_ROS2_CONTROL_PR: ${{ github.ref }}
30 |
--------------------------------------------------------------------------------
/.github/workflows/humble-check-docs.yml:
--------------------------------------------------------------------------------
1 | name: Check Docs - Humble
2 |
3 | on:
4 | workflow_dispatch:
5 | pull_request:
6 | branches:
7 | - humble
8 | paths:
9 | - '**.rst'
10 | - '**.md'
11 | - '**.jpg'
12 | - '**.jpeg'
13 | - '**.png'
14 | - '**.svg'
15 | - '**.yml'
16 | - '**.yaml'
17 | - '!.github/**' # exclude yaml files in .github directory
18 | - '.github/workflows/humble-check-docs.yml'
19 |
20 | concurrency:
21 | group: ${{ github.workflow }}-${{ github.ref }}
22 | cancel-in-progress: true
23 |
24 | jobs:
25 | check-docs:
26 | name: Check Docs
27 | uses: ros-controls/control.ros.org/.github/workflows/reusable-sphinx-check-single-version.yml@humble
28 | with:
29 | GZ_ROS2_CONTROL_PR: ${{ github.ref }}
30 |
--------------------------------------------------------------------------------
/.github/workflows/kilted-check-docs.yml:
--------------------------------------------------------------------------------
1 | name: Check Docs - Kilted
2 |
3 | on:
4 | workflow_dispatch:
5 | pull_request:
6 | branches:
7 | - kilted
8 | paths:
9 | - '**.rst'
10 | - '**.md'
11 | - '**.jpg'
12 | - '**.jpeg'
13 | - '**.png'
14 | - '**.svg'
15 | - '**.yml'
16 | - '**.yaml'
17 | - '!.github/**' # exclude yaml files in .github directory
18 | - '.github/workflows/kilted-check-docs.yml'
19 |
20 | concurrency:
21 | group: ${{ github.workflow }}-${{ github.ref }}
22 | cancel-in-progress: true
23 |
24 | jobs:
25 | check-docs:
26 | name: Check Docs
27 | uses: ros-controls/control.ros.org/.github/workflows/reusable-sphinx-check-single-version.yml@kilted
28 | with:
29 | GZ_ROS2_CONTROL_PR: ${{ github.ref }}
30 |
--------------------------------------------------------------------------------
/.github/workflows/rolling-check-docs.yml:
--------------------------------------------------------------------------------
1 | name: Check Docs - Rolling
2 |
3 | on:
4 | workflow_dispatch:
5 | pull_request:
6 | branches:
7 | - rolling
8 | paths:
9 | - '**.rst'
10 | - '**.md'
11 | - '**.jpg'
12 | - '**.jpeg'
13 | - '**.png'
14 | - '**.svg'
15 | - '**.yml'
16 | - '**.yaml'
17 | - '!.github/**' # exclude yaml files in .github directory
18 | - '.github/workflows/rolling-check-docs.yml'
19 |
20 | concurrency:
21 | group: ${{ github.workflow }}-${{ github.ref }}
22 | cancel-in-progress: true
23 |
24 | jobs:
25 | check-docs:
26 | name: Check Docs
27 | uses: ros-controls/control.ros.org/.github/workflows/reusable-sphinx-check-single-version.yml@rolling
28 | with:
29 | GZ_ROS2_CONTROL_PR: ${{ github.ref }}
30 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/config/cart_controller_velocity.yaml:
--------------------------------------------------------------------------------
1 | controller_manager:
2 | ros__parameters:
3 | update_rate: 1000 # Hz
4 |
5 | joint_state_broadcaster:
6 | type: joint_state_broadcaster/JointStateBroadcaster
7 |
8 | joint_trajectory_controller:
9 | ros__parameters:
10 | type: joint_trajectory_controller/JointTrajectoryController
11 | joints:
12 | - slider_to_cart
13 | command_interfaces:
14 | - velocity
15 | state_interfaces:
16 | - position
17 | - velocity
18 | gains:
19 | slider_to_cart:
20 | p: 100.0
21 | i: 0.0
22 | d: 0.0
23 | i_clamp: 0.0
24 | antiwindup: false
25 |
26 | imu_sensor_broadcaster:
27 | ros__parameters:
28 | type: imu_sensor_broadcaster/IMUSensorBroadcaster
29 | sensor_name: cart_imu_sensor
30 | frame_id: imu
31 |
--------------------------------------------------------------------------------
/gz_ros2_control.humble.repos:
--------------------------------------------------------------------------------
1 | repositories:
2 | ros-controls/control_msgs:
3 | type: git
4 | url: https://github.com/ros-controls/control_msgs.git
5 | version: humble
6 | ros-controls/control_toolbox:
7 | type: git
8 | url: https://github.com/ros-controls/control_toolbox.git
9 | version: humble
10 | ros-controls/kinematics_interface:
11 | type: git
12 | url: https://github.com/ros-controls/kinematics_interface.git
13 | version: humble
14 | ros-controls/realtime_tools:
15 | type: git
16 | url: https://github.com/ros-controls/realtime_tools.git
17 | version: humble
18 | ros-controls/ros2_control:
19 | type: git
20 | url: https://github.com/ros-controls/ros2_control.git
21 | version: humble
22 | ros-controls/ros2_controllers:
23 | type: git
24 | url: https://github.com/ros-controls/ros2_controllers.git
25 | version: humble
26 |
--------------------------------------------------------------------------------
/gz_ros2_control.jazzy.repos:
--------------------------------------------------------------------------------
1 | repositories:
2 | ros-controls/control_msgs:
3 | type: git
4 | url: https://github.com/ros-controls/control_msgs.git
5 | version: jazzy
6 | ros-controls/control_toolbox:
7 | type: git
8 | url: https://github.com/ros-controls/control_toolbox.git
9 | version: jazzy
10 | ros-controls/kinematics_interface:
11 | type: git
12 | url: https://github.com/ros-controls/kinematics_interface.git
13 | version: jazzy
14 | ros-controls/realtime_tools:
15 | type: git
16 | url: https://github.com/ros-controls/realtime_tools.git
17 | version: jazzy
18 | ros-controls/ros2_control:
19 | type: git
20 | url: https://github.com/ros-controls/ros2_control.git
21 | version: jazzy
22 | ros-controls/ros2_controllers:
23 | type: git
24 | url: https://github.com/ros-controls/ros2_controllers.git
25 | version: jazzy
26 | ros-controls/ros2_control_cmake:
27 | type: git
28 | url: https://github.com/ros-controls/ros2_control_cmake.git
29 | version: master
30 |
--------------------------------------------------------------------------------
/gz_ros2_control.kilted.repos:
--------------------------------------------------------------------------------
1 | repositories:
2 | ros-controls/control_msgs:
3 | type: git
4 | url: https://github.com/ros-controls/control_msgs.git
5 | version: master
6 | ros-controls/control_toolbox:
7 | type: git
8 | url: https://github.com/ros-controls/control_toolbox.git
9 | version: kilted
10 | ros-controls/kinematics_interface:
11 | type: git
12 | url: https://github.com/ros-controls/kinematics_interface.git
13 | version: master
14 | ros-controls/realtime_tools:
15 | type: git
16 | url: https://github.com/ros-controls/realtime_tools.git
17 | version: kilted
18 | ros-controls/ros2_control:
19 | type: git
20 | url: https://github.com/ros-controls/ros2_control.git
21 | version: kilted
22 | ros-controls/ros2_controllers:
23 | type: git
24 | url: https://github.com/ros-controls/ros2_controllers.git
25 | version: kilted
26 | ros-controls/ros2_control_cmake:
27 | type: git
28 | url: https://github.com/ros-controls/ros2_control_cmake.git
29 | version: master
30 |
--------------------------------------------------------------------------------
/gz_ros2_control.rolling.repos:
--------------------------------------------------------------------------------
1 | repositories:
2 | ros-controls/control_msgs:
3 | type: git
4 | url: https://github.com/ros-controls/control_msgs.git
5 | version: master
6 | ros-controls/control_toolbox:
7 | type: git
8 | url: https://github.com/ros-controls/control_toolbox.git
9 | version: master
10 | ros-controls/kinematics_interface:
11 | type: git
12 | url: https://github.com/ros-controls/kinematics_interface.git
13 | version: master
14 | ros-controls/realtime_tools:
15 | type: git
16 | url: https://github.com/ros-controls/realtime_tools.git
17 | version: master
18 | ros-controls/ros2_control:
19 | type: git
20 | url: https://github.com/ros-controls/ros2_control.git
21 | version: master
22 | ros-controls/ros2_control_demos:
23 | type: git
24 | url: https://github.com/ros-controls/ros2_control_demos.git
25 | version: master
26 | ros-controls/ros2_control_cmake:
27 | type: git
28 | url: https://github.com/ros-controls/ros2_control_cmake.git
29 | version: master
30 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "github-actions"
9 | # Workflow files stored in the
10 | # default location of `.github/workflows`
11 | directory: "/"
12 | schedule:
13 | interval: "weekly"
14 | - package-ecosystem: "github-actions"
15 | # Workflow files stored in the
16 | # default location of `.github/workflows`
17 | directory: "/"
18 | schedule:
19 | interval: "weekly"
20 | target-branch: "humble"
21 | - package-ecosystem: "github-actions"
22 | # Workflow files stored in the
23 | # default location of `.github/workflows`
24 | directory: "/"
25 | schedule:
26 | interval: "weekly"
27 | target-branch: "jazzy"
28 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/config/mecanum_drive_controller.yaml:
--------------------------------------------------------------------------------
1 | controller_manager:
2 | ros__parameters:
3 | update_rate: 100 # Hz
4 | use_sim_time: true
5 |
6 | joint_state_broadcaster:
7 | type: joint_state_broadcaster/JointStateBroadcaster
8 |
9 | mecanum_drive_controller:
10 | type: mecanum_drive_controller/MecanumDriveController
11 |
12 | mecanum_drive_controller:
13 | ros__parameters:
14 | reference_timeout: 1.0 # max time between command messages before the vehicle should stop
15 | front_left_wheel_command_joint_name: "front_left_wheel_joint"
16 | front_right_wheel_command_joint_name: "front_right_wheel_joint"
17 | rear_right_wheel_command_joint_name: "rear_right_wheel_joint"
18 | rear_left_wheel_command_joint_name: "rear_left_wheel_joint"
19 | kinematics:
20 | base_frame_offset: { x: 0.0, y: 0.0, theta: 0.0 }
21 | wheels_radius: 0.3
22 | sum_of_robot_center_projection_on_X_Y_axis: 1.1
23 | base_frame_id: "base_link"
24 | odom_frame_id: "odom"
25 | enable_odom_tf: true
26 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/config/ackermann_drive_controller.yaml:
--------------------------------------------------------------------------------
1 | controller_manager:
2 | ros__parameters:
3 | update_rate: 100 # Hz
4 |
5 | joint_state_broadcaster:
6 | type: joint_state_broadcaster/JointStateBroadcaster
7 |
8 | ackermann_steering_controller:
9 | ros__parameters:
10 | type: 'ackermann_steering_controller/AckermannSteeringController'
11 | wheelbase: 1.7
12 | traction_track_width: 1.0
13 | steering_track_width: 1.0
14 | traction_wheels_radius: 0.3
15 | steering_wheels_radius: 0.3
16 | reference_timeout: 2.0 # In s. Timeout to stop if no cmd_vel is received
17 | traction_joints_names: ['rear_right_wheel_joint', 'rear_left_wheel_joint']
18 | steering_joints_names: ['right_wheel_steering_joint', 'left_wheel_steering_joint']
19 | open_loop: false
20 | velocity_rolling_window_size: 10
21 | base_frame_id: base_link
22 | odom_frame_id: odom
23 | enable_odom_tf: true
24 | twist_covariance_diagonal: [0.0, 7.0, 14.0, 21.0, 28.0, 35.0]
25 | pose_covariance_diagonal: [0.0, 7.0, 14.0, 21.0, 28.0, 35.0]
26 | position_feedback: false
27 |
--------------------------------------------------------------------------------
/gz_ros2_control/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | gz_ros2_control
4 | 3.0.5
5 | Gazebo ros2_control package allows to control simulated robots using ros2_control framework.
6 | Alejandro Hernández
7 | Bence Magyar
8 | Alejandro Hernández
9 | Apache 2
10 |
11 | ament_cmake
12 |
13 | ament_index_cpp
14 | gz_sim_vendor
15 | gz_plugin_vendor
16 | pluginlib
17 | rclcpp
18 | yaml_cpp_vendor
19 | rclcpp_lifecycle
20 |
21 | controller_manager
22 | hardware_interface
23 | ros2_control_cmake
24 |
25 | ament_lint_auto
26 | ament_lint_common
27 |
28 |
29 | ament_cmake
30 |
31 |
32 |
--------------------------------------------------------------------------------
/.github/workflows/stale.yml:
--------------------------------------------------------------------------------
1 | name: 'Stale issues and PRs'
2 | on:
3 | workflow_dispatch:
4 | schedule:
5 | # UTC noon every workday
6 | - cron: '0 12 * * MON-FRI'
7 |
8 | jobs:
9 | stale:
10 | runs-on: ubuntu-latest
11 | permissions:
12 | issues: write
13 | pull-requests: write
14 | steps:
15 | - uses: actions/stale@v10
16 | with:
17 | stale-issue-label: 'stale'
18 | stale-pr-label: 'stale'
19 | stale-issue-message: 'This issue is being labeled as stale because it has been open 45 days with no activity. It will be automatically closed after another 45 days without follow-ups.'
20 | close-issue-message: 'This issue was closed because it has been stalled for 45 days with no activity.'
21 | stale-pr-message: '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.'
22 | days-before-stale: 45
23 | days-before-close: 45
24 | days-before-pr-close: -1
25 | exempt-all-milestones: true
26 | exempt-issue-labels: good first issue,good second issue,persistent,release,roadmap,Epic
27 | operations-per-run: 100
28 |
--------------------------------------------------------------------------------
/gz_ros2_control_tests/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | gz_ros2_control_tests
5 | 3.0.5
6 | Gazebo ros2 control tests
7 | Alejandro Hernández
8 | Apache License 2.0
9 |
10 | ament_cmake
11 |
12 | ament_index_python
13 | ament_lint_auto
14 | ament_lint_common
15 | gz_ros2_control_demos
16 | launch_ros
17 | launch_testing_ament_cmake
18 | launch_testing_ros
19 | launch
20 | python3-psutil
21 | python3-pytest
22 | rclpy
23 | controller_manager
24 | ros2launch
25 | rosgraph_msgs
26 |
27 |
28 | ament_cmake
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Dockerfile/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:24.04
2 |
3 | ENV DEBIAN_FRONTEND noninteractive
4 | ENV ROS_DISTRO rolling
5 |
6 | # Make sure everything is up to date before building from source
7 | RUN apt-get update \
8 | && apt-get upgrade -y \
9 | && apt-get update && apt-get install -q -y --no-install-recommends \
10 | dirmngr \
11 | gnupg \
12 | lsb-release \
13 | wget \
14 | curl \
15 | git \
16 | ca-certificates \
17 | build-essential \
18 | cmake \
19 | && apt-get clean
20 |
21 | RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
22 | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
23 | apt-get update && apt-get install -q -y --no-install-recommends \
24 | python3-colcon-ros \
25 | python3-colcon-common-extensions \
26 | python3-rosdep \
27 | && apt-get clean
28 |
29 | RUN mkdir -p /home/ros2_ws/src \
30 | && cd /home/ros2_ws/src \
31 | && if [ "${ROS_DISTRO}" = "rolling" ] ; then \
32 | git clone https://github.com/ros-controls/gz_ros2_control/; \
33 | else \
34 | git clone https://github.com/ros-controls/gz_ros2_control/ -b ${ROS_DISTRO}; \
35 | fi \
36 | && rosdep init && rosdep update \
37 | && rosdep install --from-paths ./ -i -y --rosdistro ${ROS_DISTRO}
38 |
39 | RUN cd /home/ros2_ws/ \
40 | && . /opt/ros/"${ROS_DISTRO}"/setup.sh \
41 | && colcon build --merge-install
42 |
43 | COPY entrypoint.sh /entrypoint.sh
44 | ENTRYPOINT ["/entrypoint.sh"]
45 |
46 | CMD ros2 launch gz_ros2_control_demos cart_example_position.launch.py
47 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/config/diff_drive_controller.yaml:
--------------------------------------------------------------------------------
1 | /**/controller_manager:
2 | ros__parameters:
3 | update_rate: 100 # Hz
4 |
5 | joint_state_broadcaster:
6 | type: joint_state_broadcaster/JointStateBroadcaster
7 |
8 | /**/diff_drive_base_controller:
9 | ros__parameters:
10 | type: diff_drive_controller/DiffDriveController
11 | left_wheel_names: ["left_wheel_joint"]
12 | right_wheel_names: ["right_wheel_joint"]
13 |
14 | wheel_separation: 1.25
15 | #wheels_per_side: 1 # actually 2, but both are controlled by 1 signal
16 | wheel_radius: 0.3
17 |
18 | wheel_separation_multiplier: 1.0
19 | left_wheel_radius_multiplier: 1.0
20 | right_wheel_radius_multiplier: 1.0
21 |
22 | publish_rate: 50.0
23 | odom_frame_id: odom
24 | base_frame_id: chassis
25 | pose_covariance_diagonal : [0.001, 0.001, 0.0, 0.0, 0.0, 0.01]
26 | twist_covariance_diagonal: [0.001, 0.0, 0.0, 0.0, 0.0, 0.01]
27 |
28 | open_loop: false
29 | enable_odom_tf: true
30 |
31 | cmd_vel_timeout: 0.5
32 | #publish_limited_velocity: true
33 | #velocity_rolling_window_size: 10
34 |
35 | # Velocity and acceleration limits
36 | # Whenever a min_* is unspecified, default to -max_*
37 | linear.x.has_velocity_limits: true
38 | linear.x.has_acceleration_limits: true
39 | linear.x.max_velocity: 1.0
40 | linear.x.min_velocity: -1.0
41 | linear.x.max_acceleration: 1.0
42 | linear.x.max_jerk: .NAN
43 | linear.x.min_jerk: .NAN
44 |
45 | angular.z.has_velocity_limits: true
46 | angular.z.has_acceleration_limits: true
47 | angular.z.max_velocity: 1.0
48 | angular.z.min_velocity: -1.0
49 | angular.z.max_acceleration: 1.0
50 | angular.z.min_acceleration: -1.0
51 | angular.z.max_jerk: .NAN
52 | angular.z.min_jerk: .NAN
53 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/examples/example_mobile_robots.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2022 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #include
16 |
17 | #include
18 |
19 | #include
20 |
21 | using namespace std::chrono_literals;
22 |
23 | int main(int argc, char * argv[])
24 | {
25 | rclcpp::init(argc, argv);
26 |
27 | std::shared_ptr node =
28 | std::make_shared("example_mobile_robots_node");
29 |
30 | rclcpp::executors::SingleThreadedExecutor executor;
31 | executor.add_node(node);
32 |
33 | auto publisher = node->create_publisher(
34 | "/cmd_vel", 10);
35 |
36 | RCLCPP_INFO(node->get_logger(), "node created");
37 |
38 | geometry_msgs::msg::TwistStamped command;
39 |
40 | command.twist.linear.x = 0.1;
41 | command.twist.linear.y = 0.0;
42 | command.twist.linear.z = 0.0;
43 |
44 | command.twist.angular.x = 0.0;
45 | command.twist.angular.y = 0.0;
46 | command.twist.angular.z = 0.1;
47 |
48 | while (1) {
49 | command.header.stamp = node->now();
50 | publisher->publish(command);
51 | std::this_thread::sleep_for(50ms);
52 | executor.spin_some();
53 | }
54 | rclcpp::shutdown();
55 |
56 | return 0;
57 | }
58 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/examples/example_gripper.cpp:
--------------------------------------------------------------------------------
1 | // Copyright 2022 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 | //
15 | // Author: Denis Štogl (Stogl Robotics Consulting)
16 | //
17 |
18 | #include
19 | #include
20 | #include
21 |
22 | #include "rclcpp/rclcpp.hpp"
23 |
24 | #include "std_msgs/msg/float64_multi_array.hpp"
25 |
26 | int main(int argc, char * argv[])
27 | {
28 | rclcpp::init(argc, argv);
29 |
30 | std::shared_ptr node = std::make_shared("gripper_test_node");
31 |
32 | auto publisher = node->create_publisher(
33 | "/gripper_controller/commands", 10);
34 |
35 | RCLCPP_INFO(node->get_logger(), "node created");
36 |
37 | std_msgs::msg::Float64MultiArray commands;
38 |
39 | using namespace std::chrono_literals;
40 |
41 | commands.data.push_back(0);
42 | publisher->publish(commands);
43 | std::this_thread::sleep_for(1s);
44 |
45 | commands.data[0] = 0.38;
46 | publisher->publish(commands);
47 | std::this_thread::sleep_for(1s);
48 |
49 | commands.data[0] = 0.19;
50 | publisher->publish(commands);
51 | std::this_thread::sleep_for(1s);
52 |
53 | commands.data[0] = 0;
54 | publisher->publish(commands);
55 | std::this_thread::sleep_for(1s);
56 | rclcpp::shutdown();
57 |
58 | return 0;
59 | }
60 |
--------------------------------------------------------------------------------
/.github/workflows/ci-rolling.yaml:
--------------------------------------------------------------------------------
1 | name: gz_ros2_control CI - Rolling
2 |
3 | on:
4 | workflow_dispatch:
5 | pull_request:
6 | branches: [ rolling ]
7 | push:
8 | branches: [ rolling ]
9 | schedule:
10 | # Run every morning to detect flakiness and broken dependencies
11 | - cron: '03 5 * * MON-FRI'
12 |
13 | jobs:
14 | build:
15 | runs-on: ubuntu-latest
16 | strategy:
17 | fail-fast: false
18 | matrix:
19 | include:
20 | - ros-distro: "rolling"
21 | ros-repo-packages: "-testing"
22 | upstream-repos: "gz_ros2_control.rolling.repos"
23 | - ros-distro: "rolling"
24 | ros-repo-packages: "-testing"
25 | upstream-repos: ""
26 | - ros-distro: "rolling"
27 | ros-repo-packages: ""
28 | upstream-repos: ""
29 | env:
30 | ROS_DISTRO: ${{ matrix.ros-distro }}
31 | container:
32 | image: ghcr.io/ros-controls/ros:${{ matrix.ros-distro }}-ubuntu${{ matrix.ros-repo-packages }}
33 | steps:
34 | - uses: actions/checkout@v6
35 | - name: Checkout ros2_control framework for semi-binary builds
36 | if: ${{ matrix.upstream-repos != '' }}
37 | run: vcs import --input ${{ matrix.upstream-repos }}
38 | - name: Setup colcon workspace
39 | id: configure
40 | shell: bash
41 | run: |
42 | apt-get update
43 | rosdep update
44 | rosdep install --from-paths ./ -i -y --rosdistro ${ROS_DISTRO}
45 | - name: Build project
46 | id: build
47 | run: |
48 | . /opt/ros/${ROS_DISTRO}/local_setup.sh
49 | colcon build --packages-up-to gz_ros2_control_demos gz_ros2_control_tests
50 | - name: Run tests
51 | id: test
52 | run: |
53 | . /opt/ros/${ROS_DISTRO}/local_setup.sh
54 | colcon test --event-handlers console_direct+ --packages-select gz_ros2_control gz_ros2_control_demos gz_ros2_control_tests
55 | colcon test-result
56 |
--------------------------------------------------------------------------------
/.github/workflows/ci-jazzy.yaml:
--------------------------------------------------------------------------------
1 | name: gz_ros2_control CI - Jazzy
2 |
3 | on:
4 | workflow_dispatch:
5 | pull_request:
6 | branches: [ jazzy ]
7 | push:
8 | branches: [ jazzy ]
9 | schedule:
10 | # Run every morning to detect flakiness and broken dependencies
11 | - cron: '03 4 * * MON-FRI'
12 |
13 | jobs:
14 | build:
15 | runs-on: ubuntu-latest
16 | strategy:
17 | fail-fast: false
18 | matrix:
19 | include:
20 | - ros-repo-packages: "-testing"
21 | upstream-repos: ""
22 | - ros-repo-packages: ""
23 | upstream-repos: ""
24 | - ros-repo-packages: "-testing"
25 | upstream-repos: "gz_ros2_control.jazzy.repos"
26 | env:
27 | ROS_DISTRO: jazzy
28 | container:
29 | image: ghcr.io/ros-controls/ros:jazzy-ubuntu${{ matrix.ros-repo-packages }}
30 | steps:
31 | - name: Checkout code
32 | if: github.event_name != 'schedule'
33 | uses: actions/checkout@v6
34 | - name: Checkout code for scheduled workflow
35 | if: github.event_name == 'schedule'
36 | uses: actions/checkout@v6
37 | with:
38 | ref: jazzy
39 | - name: Checkout ros2_control framework for semi-binary builds
40 | if: ${{ matrix.upstream-repos != '' }}
41 | run: vcs import --input ${{ matrix.upstream-repos }}
42 | - name: Setup colcon workspace
43 | id: configure
44 | shell: bash
45 | run: |
46 | apt-get update
47 | rosdep update
48 | rosdep install --from-paths ./ -i -y --rosdistro ${ROS_DISTRO}
49 | - name: Build project
50 | id: build
51 | run: |
52 | . /opt/ros/${ROS_DISTRO}/local_setup.sh
53 | colcon build --packages-up-to gz_ros2_control_demos gz_ros2_control_tests
54 | - name: Run tests
55 | id: test
56 | run: |
57 | . /opt/ros/${ROS_DISTRO}/local_setup.sh
58 | colcon test --event-handlers console_direct+ --packages-select gz_ros2_control gz_ros2_control_demos gz_ros2_control_tests
59 | colcon test-result
60 |
--------------------------------------------------------------------------------
/.github/workflows/ci-kilted.yaml:
--------------------------------------------------------------------------------
1 | name: gz_ros2_control CI - Kilted
2 |
3 | on:
4 | workflow_dispatch:
5 | pull_request:
6 | branches: [ kilted ]
7 | push:
8 | branches: [ kilted ]
9 | schedule:
10 | # Run every morning to detect flakiness and broken dependencies
11 | - cron: '03 5 * * MON-FRI'
12 |
13 | jobs:
14 | build:
15 | runs-on: ubuntu-latest
16 | strategy:
17 | fail-fast: false
18 | matrix:
19 | include:
20 | - ros-repo-packages: "-testing"
21 | upstream-repos: ""
22 | - ros-repo-packages: ""
23 | upstream-repos: ""
24 | - ros-repo-packages: "-testing"
25 | upstream-repos: "gz_ros2_control.kilted.repos"
26 | env:
27 | ROS_DISTRO: kilted
28 | container:
29 | image: ghcr.io/ros-controls/ros:kilted-ubuntu${{ matrix.ros-repo-packages }}
30 | steps:
31 | - name: Checkout code
32 | if: github.event_name != 'schedule'
33 | uses: actions/checkout@v6
34 | - name: Checkout code for scheduled workflow
35 | if: github.event_name == 'schedule'
36 | uses: actions/checkout@v6
37 | with:
38 | ref: kilted
39 | - name: Checkout ros2_control framework for semi-binary builds
40 | if: ${{ matrix.upstream-repos != '' }}
41 | run: vcs import --input ${{ matrix.upstream-repos }}
42 | - name: Setup colcon workspace
43 | id: configure
44 | shell: bash
45 | run: |
46 | apt-get update
47 | rosdep update
48 | rosdep install --from-paths ./ -i -y --rosdistro ${ROS_DISTRO}
49 | - name: Build project
50 | id: build
51 | run: |
52 | . /opt/ros/${ROS_DISTRO}/local_setup.sh
53 | colcon build --packages-up-to gz_ros2_control_demos gz_ros2_control_tests
54 | - name: Run tests
55 | id: test
56 | run: |
57 | . /opt/ros/${ROS_DISTRO}/local_setup.sh
58 | colcon test --event-handlers console_direct+ --packages-select gz_ros2_control gz_ros2_control_demos gz_ros2_control_tests
59 | colcon test-result
60 |
--------------------------------------------------------------------------------
/gz_ros2_control/include/gz_ros2_control/gz_ros2_control_plugin.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2021 Open Source Robotics Foundation, Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef GZ_ROS2_CONTROL__GZ_ROS2_CONTROL_PLUGIN_HPP_
16 | #define GZ_ROS2_CONTROL__GZ_ROS2_CONTROL_PLUGIN_HPP_
17 |
18 | #include
19 |
20 | #include
21 | namespace sim = gz::sim;
22 |
23 | namespace gz_ros2_control
24 | {
25 | // Forward declarations.
26 | class GazeboSimROS2ControlPluginPrivate;
27 |
28 | class GazeboSimROS2ControlPlugin
29 | : public sim::System,
30 | public sim::ISystemConfigure,
31 | public sim::ISystemPreUpdate,
32 | public sim::ISystemPostUpdate
33 | {
34 | public:
35 | /// \brief Constructor
36 | GazeboSimROS2ControlPlugin();
37 |
38 | /// \brief Destructor
39 | ~GazeboSimROS2ControlPlugin() override;
40 |
41 | // Documentation inherited
42 | void Configure(
43 | const sim::Entity & _entity,
44 | const std::shared_ptr & _sdf,
45 | sim::EntityComponentManager & _ecm,
46 | sim::EventManager & _eventMgr) override;
47 |
48 | // Documentation inherited
49 | void PreUpdate(
50 | const sim::UpdateInfo & _info,
51 | sim::EntityComponentManager & _ecm) override;
52 |
53 | void PostUpdate(
54 | const sim::UpdateInfo & _info,
55 | const sim::EntityComponentManager & _ecm) override;
56 |
57 | private:
58 | /// \brief Private data pointer.
59 | std::unique_ptr dataPtr;
60 | };
61 | } // namespace gz_ros2_control
62 |
63 | #endif // GZ_ROS2_CONTROL__GZ_ROS2_CONTROL_PLUGIN_HPP_
64 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/config/tricycle_drive_controller.yaml:
--------------------------------------------------------------------------------
1 | controller_manager:
2 | ros__parameters:
3 | update_rate: 50 # Hz
4 |
5 | joint_state_broadcaster:
6 | ros__parameters:
7 | type: joint_state_broadcaster/JointStateBroadcaster
8 | extra_joints: ["right_wheel_joint", "left_wheel_joint"]
9 |
10 | tricycle_controller:
11 | ros__parameters:
12 | type: tricycle_controller/TricycleController
13 |
14 | # Model
15 | traction_joint_name: traction_joint # Name of traction joint in URDF
16 | steering_joint_name: steering_joint # Name of steering joint in URDF
17 | wheel_radius: 0.3 # Radius of front wheel
18 | wheelbase: 1.7 # Distance between center of back wheels and front wheel
19 |
20 | # Odometry
21 | odom_frame_id: odom
22 | base_frame_id: base_link
23 | open_loop: false # if True, uses cmd_vel instead of hardware interface feedback to compute odometry
24 | enable_odom_tf: true # If True, publishes odom<-base_link TF
25 | odom_only_twist: false # If True, publishes on /odom only linear.x and angular.z; Useful for computing odometry in another node, e.g robot_localization's ekf
26 | pose_covariance_diagonal: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # Need to be set if fusing odom with other localization source
27 | twist_covariance_diagonal: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # Need to be set if fusing odom with other localization source
28 | velocity_rolling_window_size: 10 # Rolling window size of rcppmath::RollingMeanAccumulator applied on linear and angular speeds published on odom
29 |
30 | # Rate Limiting
31 | traction: # All values should be positive
32 | # min_velocity: 0.0
33 | # max_velocity: 1000.0
34 | # min_acceleration: 0.0
35 | max_acceleration: 5.0
36 | # min_deceleration: 0.0
37 | max_deceleration: 8.0
38 | # min_jerk: 0.0
39 | # max_jerk: 1000.0
40 | steering:
41 | min_position: -1.57
42 | max_position: 1.57
43 | # min_velocity: 0.0
44 | max_velocity: 1.0
45 | # min_acceleration: 0.0
46 | # max_acceleration: 1000.0
47 |
48 | # cmd_vel input
49 | cmd_vel_timeout: 500 # In milliseconds. Timeout to stop if no cmd_vel is received
50 |
51 | # Debug
52 | publish_ackermann_command: true # Publishes AckermannDrive. The speed does not comply to the msg definition, it the wheel angular speed in rad/s.
53 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | gz_ros2_control_demos
4 | 3.0.5
5 | gz_ros2_control_demos
6 |
7 | Alejandro Hernandez
8 |
9 | Apache License 2.0
10 |
11 | https://github.com/ros-controls/gz_ros2_control/blob/master/README.md
12 | https://github.com/ros-controls/gz_ros2_control/issues
13 | https://github.com/ros-controls/gz_ros2_control
14 |
15 | Alejandro Hernández
16 |
17 | ament_cmake
18 |
19 | geometry_msgs
20 | pluginlib
21 | rclcpp
22 | rclcpp_action
23 | std_msgs
24 |
25 | gz_sim_vendor
26 | rclcpp_lifecycle
27 |
28 | ament_index_python
29 | geometry_msgs
30 | launch_ros
31 | launch
32 | rclcpp
33 | robot_state_publisher
34 | ros_gz_bridge
35 | ros_gz_sim
36 | ros2launch
37 | std_msgs
38 | xacro
39 |
40 |
41 | control_msgs
42 | control_toolbox
43 | gz_ros2_control
44 | hardware_interface
45 | ros2_control_cmake
46 | ackermann_steering_controller
47 | diff_drive_controller
48 | effort_controllers
49 | force_torque_sensor_broadcaster
50 | imu_sensor_broadcaster
51 | joint_state_broadcaster
52 | joint_trajectory_controller
53 | mecanum_drive_controller
54 | ros2controlcli
55 | tricycle_steering_controller
56 | velocity_controllers
57 |
58 | ament_lint_auto
59 | ament_lint_common
60 |
61 |
62 | ament_cmake
63 |
64 |
65 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/urdf/test_cart_effort.xacro.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | gz_ros2_control/GazeboSimSystem
45 |
46 |
47 |
48 | -15
49 | 15
50 |
51 |
52 | 1.0
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | 0 0.8 0 1
63 | 0 0.8 0 1
64 | 0 0.8 0 1
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | 0 0 0.8 1
73 | 0 0 0.8 1
74 | 0 0 0.8 1
75 |
76 |
77 |
78 |
79 |
80 |
81 | $(find gz_ros2_control_demos)/config/cart_controller_effort.yaml
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.xml:
--------------------------------------------------------------------------------
1 |
21 |
22 |
23 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/launch/gripper_mimic_joint_example_position.launch.xml:
--------------------------------------------------------------------------------
1 |
21 |
22 |
23 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/urdf/test_cart_position.xacro.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | gz_ros2_control/GazeboSimSystem
57 |
58 |
59 |
60 | -15
61 | 15
62 |
63 |
64 | 1.0
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | 0 0.8 0 1
75 | 0 0.8 0 1
76 | 0 0.8 0 1
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | 0 0 0.8 1
85 | 0 0 0.8 1
86 | 0 0 0.8 1
87 |
88 |
89 |
90 |
91 |
92 |
93 | $(find gz_ros2_control_demos)/config/cart_controller_position.yaml
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/urdf/test_cart_velocity_custom_plugin.xacro.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | gz_ros2_control_demos/GazeboCustomSimSystem
57 |
58 |
59 |
60 | 0.5
61 | 1.0
62 |
63 |
64 | 1.0
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | 0 0.8 0 1
75 | 0 0.8 0 1
76 | 0 0.8 0 1
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | 0 0 0.8 1
85 | 0 0 0.8 1
86 | 0 0 0.8 1
87 |
88 |
89 |
90 |
91 |
92 |
93 | $(find gz_ros2_control_demos)/config/cart_controller_velocity.yaml
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/gz_ros2_control/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.10)
2 | project(gz_ros2_control)
3 |
4 | find_package(ros2_control_cmake REQUIRED)
5 | set_compiler_options()
6 | export_windows_symbols()
7 |
8 | # Compiler options
9 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
10 | add_compile_options(-Wall -Wextra -Wpedantic)
11 | endif()
12 |
13 | # Find dependencies
14 | find_package(ament_cmake REQUIRED)
15 | find_package(ament_index_cpp REQUIRED)
16 | find_package(controller_manager REQUIRED)
17 | find_package(hardware_interface REQUIRED)
18 | find_package(pluginlib REQUIRED)
19 | find_package(rclcpp REQUIRED)
20 | find_package(rclcpp_lifecycle REQUIRED)
21 | find_package(yaml_cpp_vendor REQUIRED)
22 |
23 | find_package(gz_sim_vendor REQUIRED)
24 | find_package(gz-sim REQUIRED)
25 |
26 | find_package(gz_plugin_vendor REQUIRED)
27 | find_package(gz-plugin REQUIRED)
28 |
29 | include_directories(include)
30 |
31 | add_library(${PROJECT_NAME}-system SHARED
32 | src/gz_ros2_control_plugin.cpp
33 | )
34 | add_library(${PROJECT_NAME}-system::${PROJECT_NAME}-system ALIAS ${PROJECT_NAME}-system)
35 |
36 | target_link_libraries(${PROJECT_NAME}-system
37 | PUBLIC
38 | gz-sim::gz-sim
39 | gz-plugin::register
40 | ament_index_cpp::ament_index_cpp
41 | controller_manager::controller_manager
42 | hardware_interface::hardware_interface
43 | ${pluginlib_TARGETS}
44 | rclcpp::rclcpp
45 | rclcpp_lifecycle::rclcpp_lifecycle
46 | )
47 | target_include_directories(${PROJECT_NAME}-system PUBLIC
48 | $
49 | $
50 | )
51 |
52 | #########
53 |
54 | add_library(gz_hardware_plugins SHARED
55 | src/gz_system.cpp
56 | )
57 | target_link_libraries(gz_hardware_plugins
58 | PUBLIC
59 | gz-sim::gz-sim
60 | hardware_interface::hardware_interface
61 | rclcpp::rclcpp
62 | rclcpp_lifecycle::rclcpp_lifecycle
63 | )
64 |
65 | # Install headers
66 | install(DIRECTORY include/
67 | DESTINATION include/${PROJECT_NAME}
68 | )
69 |
70 | # Install library and export targets
71 | install(TARGETS
72 | ${PROJECT_NAME}-system
73 | gz_hardware_plugins
74 | EXPORT export_${PROJECT_NAME}
75 | ARCHIVE DESTINATION lib
76 | LIBRARY DESTINATION lib
77 | RUNTIME DESTINATION bin
78 | )
79 |
80 | install(EXPORT export_${PROJECT_NAME}
81 | NAMESPACE ${PROJECT_NAME}::
82 | DESTINATION share/${PROJECT_NAME}/cmake
83 | )
84 |
85 | # Testing and linting
86 | if(BUILD_TESTING)
87 | find_package(ament_lint_auto REQUIRED)
88 | ament_lint_auto_find_test_dependencies()
89 | endif()
90 |
91 | # Export old-style CMake variables
92 | ament_export_include_directories(include)
93 | ament_export_libraries(${PROJECT_NAME}-system gz_hardware_plugins)
94 |
95 | # Export modern CMake targets
96 | ament_export_targets(
97 | export_${PROJECT_NAME}
98 | )
99 |
100 | ament_export_dependencies(
101 | controller_manager
102 | hardware_interface
103 | )
104 |
105 | pluginlib_export_plugin_description_file(gz_ros2_control gz_hardware_plugins.xml)
106 |
107 | # Setup the project
108 | ament_package()
109 |
--------------------------------------------------------------------------------
/gz_ros2_control_demos/include/gz_ros2_control_demos/gz_custom_system.hpp:
--------------------------------------------------------------------------------
1 | // Copyright 2025 AIT Austrian Institute of Technology GmbH
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 |
16 | #ifndef GZ_ROS2_CONTROL_DEMOS__GZ_CUSTOM_SYSTEM_HPP_
17 | #define GZ_ROS2_CONTROL_DEMOS__GZ_CUSTOM_SYSTEM_HPP_
18 |
19 | #include