Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f0d7186
Implementation of RRBot System Headless Hardware with only position j…
destogl Sep 11, 2020
773d0c3
rrbot system position only after first testing.
destogl Sep 11, 2020
89dbaef
Added description of rrbot and example ros2_control_manager.
destogl Sep 11, 2020
e6c9fbf
ROS2 Managers are moved to controller_interface package
destogl Sep 15, 2020
c0e60ab
Update README.md
destogl Sep 23, 2020
f6fddee
Add controlle to example 1 and adapt the hardware to provide more sen…
destogl Oct 1, 2020
8336c52
Merge branch 'add_rrbot_system_position_joints' of https://github.com…
destogl Oct 1, 2020
bb0d4c3
Added controller to install path
destogl Oct 1, 2020
4edaf31
Change parameter names because deprecated
destogl Oct 1, 2020
87bf1fe
Reorganize controller's yaml to have correct parameters' namespace. C…
destogl Oct 2, 2020
8eec4e0
Corrected licence header and add explicit type instead of auto
destogl Oct 2, 2020
81f6551
Update README.md
destogl Oct 6, 2020
ccfb6e5
Update parameter and launch
destogl Oct 7, 2020
ec0f715
Merge branch 'add_rrbot_system_position_joints' of https://github.com…
destogl Oct 7, 2020
de05e13
Update README.md
destogl Oct 7, 2020
75f5625
Reorganize to new RM structure
destogl Nov 15, 2020
79c6323
Merge branch 'add_rrbot_system_position_joints' of https://github.com…
destogl Nov 15, 2020
c8935f0
Update README.md
destogl Nov 15, 2020
0cb4877
Updated to new status
destogl Nov 21, 2020
1e7fbb6
Adapt brances and additional output
destogl Nov 21, 2020
7b818d3
Merge branch 'add_rrbot_system_position_joints' of https://github.com…
destogl Nov 21, 2020
f44d20b
Add parsing robot_description via xacro. (#45)
livanov93 Nov 27, 2020
84def18
Merge branch 'master' into add_rrbot_system_position_joints
destogl Dec 2, 2020
01b428b
Remove URDF file
destogl Dec 2, 2020
8fe9b66
Merge branch 'add_rrbot_system_position_joints' of https://github.com…
destogl Dec 2, 2020
382bc1c
Update description
destogl Dec 2, 2020
bfeeeee
Update linters.yaml
destogl Dec 2, 2020
4f0ddb1
Update ci.yml
destogl Dec 2, 2020
5ba9659
Add dependencies
destogl Dec 2, 2020
5f68b67
Update ci.yml
destogl Dec 2, 2020
f18145a
Update CMakeLists.txt
destogl Dec 3, 2020
ea5be37
Update package.xml
destogl Dec 3, 2020
9f4a384
Delete code_coverage.yml
destogl Dec 3, 2020
b630ceb
Update ci.yml
destogl Dec 3, 2020
c69b80f
Update ci.yml
destogl Dec 3, 2020
881c06a
Update linters.yaml
destogl Dec 3, 2020
9cca40b
Update linters.yaml
destogl Dec 3, 2020
cd977b2
Update ros2_control_demo_hardware/include/ros2_control_demo_hardware/…
destogl Dec 5, 2020
635ed68
Update ros2_control_demo_hardware/src/rrbot_system_position_only.cpp
destogl Dec 5, 2020
732a3bc
Address review comments.
destogl Dec 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 38 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,49 @@ on:
- cron: '28 6 * * *'

jobs:
industrial_ci:
ci_binary:
name: Foxy binary job
runs-on: ubuntu-latest
strategy:
matrix:
env:
- {ROS_DISTRO: foxy, ROS_REPO: testing}
- {ROS_DISTRO: foxy, ROS_REPO: main}
runs-on: ubuntu-latest
- {ROS_DISTRO: foxy, ROS_REPO: testing}
env:
UPSTREAM_WORKSPACE: ros2_control_demos/ros2_control_demos.repos
steps:
- run: sudo apt-get update -qq && sudo apt-get upgrade
- uses: actions/checkout@v1
- uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}

ci_source:
name: Foxy source job
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: ros-tooling/[email protected]
with:
required-ros-distributions: foxy
- uses: ros-tooling/[email protected]
with:
target-ros2-distro: foxy
# build all packages listed in the meta package
package-name:
ros2_control_demo_hardware
ros2_control_demo_robot
ros2_control_demos
vcs-repo-file-url: |
https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/ros2_control_demos/ros2_control_demos.repos
colcon-mixin-name: coverage-gcc
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
- uses: codecov/[email protected]
with:
file: ros_ws/lcov/total_coverage.info
flags: unittests
name: codecov-umbrella
- uses: actions/upload-artifact@v1
with:
name: colcon-logs-${{ matrix.os }}
path: ros_ws/log
34 changes: 0 additions & 34 deletions .github/workflows/code_coverage.yml

This file was deleted.

30 changes: 18 additions & 12 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
name: Linters
on:
pull_request:
push:
branches:
- master

jobs:
ament_copyright:
name: ament_copyright
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: ros-tooling/[email protected].13
- uses: ros-tooling/[email protected].5
- uses: ros-tooling/[email protected].26
- uses: ros-tooling/[email protected].6
with:
linter: copyright
package-name: ros2_control_demo_communication_gazebo ros2_control_demo_communication_headless ros2_control_demo_hardware ros2_control_demo_robot
package-name:
ros2_control_demo_hardware
ros2_control_demo_robot
ros2_control_demos

ament_xmllint:
name: ament_xmllint
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: ros-tooling/[email protected].13
- uses: ros-tooling/[email protected].5
- uses: ros-tooling/[email protected].26
- uses: ros-tooling/[email protected].6
with:
linter: xmllint
package-name: ros2_control_demo_communication_gazebo ros2_control_demo_communication_headless ros2_control_demo_hardware ros2_control_demo_robot
package-name:
ros2_control_demo_hardware
ros2_control_demo_robot
ros2_control_demos

ament_lint_cpp:
name: ament_${{ matrix.linter }}
Expand All @@ -37,8 +40,11 @@ jobs:
linter: [cppcheck, cpplint, uncrustify]
steps:
- uses: actions/checkout@v1
- uses: ros-tooling/[email protected].13
- uses: ros-tooling/[email protected].5
- uses: ros-tooling/[email protected].26
- uses: ros-tooling/[email protected].6
with:
linter: ${{ matrix.linter }}
package-name: ros2_control_demo_communication_gazebo ros2_control_demo_communication_headless ros2_control_demo_hardware ros2_control_demo_robot
package-name:
ros2_control_demo_hardware
ros2_control_demo_robot
ros2_control_demos
126 changes: 123 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,127 @@ This repository provides templates for the development of `ros2_control`-enabled

## Goals

The repository has two goals:
The repository has three goals:
1. Implements the example configuration described in the `ros-controls/roadmap` repository file [components_architecture_and_urdf_examples](https://github.com/ros-controls/roadmap/blob/master/design_drafts/components_architecture_and_urdf_examples.md).
2. It provides templates for faster start of implementing own hardware and controllers;
3. The repository is a validation environment for `ros2_control` concepts, which can only be tested during run-time (e.g., execution of controllers by the controller manager, communication between robot hardware and controllers).

1. It provides templates for faster start of implementing own hardware and controllers;
2. The repository is a validation environment for `ros2_control` concepts, which can only be tested during run-time (e.g., execution of controllers by the controller manager, communication between robot hardware and controllers).

## Description

The repository is inspired by [ros_control_boilerplate](https://github.com/PickNikRobotics/ros_control_boilerplate) repository from Dave Coleman.
The simulation has three parts/packages:
1. The first package, `ros2_control_demo_hardware`, implements the hardware interfaces described in the roadmap.
This implemented examples simulate *RRbot* internally to provide sufficient test and demonstration data, but to reduce amount of package dependencies.
This package does not have any dependencies except on the `ros2` core packages and can, therefore, be used on SoC-hardware of headless systems.
2. The second package, `ros2_control_demo_hardware_gazebo`, uses a gazebo simulator to simulate the *RRBot* and its physics.
This package is useful to test the connection of `ros2_control` to the gazebo simulator and to detect any missing plugins.
3. The third package `ros2_control_demo_robot` holds examples for *RRbot* URDF-description, launch files and controllers.
The intention of those files is to simplify start with `ros2_control` and to enable faster integration of new robots and controllers.

This repository demonstrates the following `ros2_control` concepts:

* Creating of `*HardwareInterface` for a System, Sensor, and Actuator.
* Creating a robot description in the form of URDF files
* Loading configuration and starting robot using launch files
* Control of two joints of *RRBot*
* Using simulated robots and starting `ros_control` with gazebo simulator
* Implementing of controller switching strategy for a robot
* Using joint limits and transmission concepts in `ros2_control`
* TBD...

# Test of the Scenario Before the First Release
* Checkout [ros-controls/ros2_control](https://github.com/ros-controls/ros2_control) to get the core.
* Checkout [ros-controls/ros2_controllers](https://github.com/ros-controls/ros2_controllers) to get all the controllers.
* Checkout [ros-controls/ros2_control_demos](https://github.com/ros-controls/ros2_control_demos) to get example hardware and robot launch files.

* Install dependencies (maybe you need `sudo`):
```
apt install ros-foxy-realtime-tools ros-foxy-xacro ros-foxy-angles
```

* Build everything, e.g. with:
```
colcon build --symlink-install
```

* Do not forget to source `setup.bash` from the `install` folder!


# Getting Started with ROS2 Control

Each of the described example cases from the roadmap has its own launch and URDF file.

## Example 1: "Industrial Robots with only one interface"

1. Start the roslaunch file:
```
ros2 launch ros2_control_demo_robot rrbot_system_position_only.launch.py
```

2. Open another terminal and check if `RRBotSystemPositionOnlyHardware` is loaded properly:
```
ros2 control list_hardware_interfaces
```
You should get something like:
```
command interfaces
joint1/position [unclaimed]
joint2/position [unclaimed]
state interfaces
joint1/position
joint2/position
```

3. Open another terminal and load controllers:
```
ros2 control load joint_state_controller
ros2 control load forward_command_controller_position
```

Check if controller is loaded properly:
```
ros2 control list
```
You should get the response:
```
joint_state_controller[joint_state_controller/JointStateController] inactive
forward_command_controller_position[forward_command_controller/ForwardCommandController] inactive
```

4. Starting controller:
```
ros2 control switch --start-controllers joint_state_controller forward_command_controller_position
```

Check if controllers are activated:
```
ros2 control list
```
You should get `active` in the response:
```
joint_state_controller[joint_state_controller/JointStateController] active
forward_command_controller_position[forward_command_controller/ForwardCommandController] active
```

5. Open another terminal and send a message to the controller:
```
ros2 topic pub /forward_command_controller_position/commands std_msgs/msg/Float64MultiArray "data:
- 0.5
- 0.5"
```

You should see how the example output changes. Look for the following lines
```
[RRBotSystemPositionOnlyHardware]: Got state 0.0 for joint 0!
[RRBotSystemPositionOnlyHardware]: Got state 0.0 for joint 1!
```

If you echo the `/joint_states` or `/dynamic_joint_states` topics you should also get similar values.
```
ros2 topic echo /joint_states
ros2 topic echo /dynamic_joint_states
```

The other launch-files have corresponding names to their coresponding example.
The URDF files can be found in the `description` folder.
34 changes: 34 additions & 0 deletions ros2_control_demo_hardware/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,35 @@ endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(hardware_interface REQUIRED)
find_package(pluginlib REQUIRED)
find_package(rclcpp REQUIRED)

## COMPILE
add_library(
${PROJECT_NAME}
SHARED
src/rrbot_system_position_only.cpp
)
target_include_directories(
${PROJECT_NAME}
PRIVATE
include
)
ament_target_dependencies(
${PROJECT_NAME}
hardware_interface
pluginlib
rclcpp
)

pluginlib_export_plugin_description_file(hardware_interface ros2_control_demo_hardware.xml)

# INSTALL
install(
TARGETS ${PROJECT_NAME}
DESTINATION lib
)
install(
DIRECTORY include/
DESTINATION include
Expand All @@ -22,10 +50,16 @@ if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
endif()

## EXPORTS
ament_export_include_directories(
include
)
ament_export_libraries(
${PROJECT_NAME}
)
ament_export_dependencies(
hardware_interface
pluginlib
rclcpp
)
ament_package()
Loading