Skip to content

Commit

Permalink
Corrected launch of position_only example
Browse files Browse the repository at this point in the history
  • Loading branch information
destogl committed May 28, 2021
1 parent 30f3f94 commit a550d90
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 31 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ The repository has three goals:

The repository is inspired by the [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.
1. The first package, `ros2_control_demo_bringup`, holds launch files and runtime configurations for demo robots.
2. The second package, `ros2_control_demo_description`, stored URDF-description files, rviz configurations and meshes for the demo robots.
3. The third package, `ros2_control_demo_hardware`, implements the hardware interfaces described in the roadmap.
The examples simulate a simple *RRbot* internally to provide sufficient test and demonstration data and reduce external dependencies.
This package does not have any dependencies except `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.

This repository demonstrates the following `ros2_control` concepts:

Expand Down Expand Up @@ -80,19 +79,19 @@ Each example is started with a single launch file which starts up the robot hard
The `rviz2` setup can be recreated following these steps:

- The robot models can be visualized using `RobotModel` display using `/robot_description` topic.
- Or you can simply open the configuration from `rviz` folder in `ros2_control_demo_robot` package manually or directly by executing:
- Or you can simply open the configuration from `rviz` folder in `ros2_control_demo_description` package manually or directly by executing:
```
rviz2 --display-config `ros2 pkg prefix ros2_control_demo_robot`/share/ros2_control_demo_robot/rviz/rrbot.rviz
rviz2 --display-config `ros2 pkg prefix ros2_control_demo_description`/share/ros2_control_demo_description/rviz/rrbot.rviz
```

*RRBot*, or ''Revolute-Revolute Manipulator Robot'', is a simple 3-linkage, 2-joint arm that we will use to demonstrate various features. It essentially a double inverted pendulum and demonstrates some fun control concepts within a simulator and was originally introduced for Gazebo tutorials.
The *RRbot* URDF files can be found in the `description` folder of `ros2_control_demo_robot` package.
The *RRbot* URDF files can be found in the `urdf` folder of `ros2_control_demo_description` package.

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

1. Open another terminal and start the roslaunch file:
```
ros2 launch ros2_control_demo_robot rrbot_system_position_only.launch.py
ros2 launch ros2_control_demo_bringup rrbot_system_position_only.launch.py
```

2. Open another terminal and check that `RRBotSystemPositionOnlyHardware` loaded properly:
Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Start up the multi interface rrbot system:

.. code-block:: bash
ros2 launch ros2_control_demo_robot rrbot_system_multi_interface.launch.py
ros2 launch ros2_control_demo_bringup rrbot_system_multi_interface.launch.py
List the available interfaces

Expand Down
6 changes: 3 additions & 3 deletions ros2_control_demo_bringup/launch/diffbot_system.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ def generate_launch_description():

# Get URDF via xacro
robot_description_path = os.path.join(
get_package_share_directory("ros2_control_demo_robot"),
"description",
get_package_share_directory("ros2_control_demo_description"),
"urdf",
"diffbot_system.urdf.xacro",
)
robot_description_config = xacro.process_file(robot_description_path)
robot_description = {"robot_description": robot_description_config.toxml()}

diffbot_diff_drive_controller = os.path.join(
get_package_share_directory("ros2_control_demo_robot"),
get_package_share_directory("ros2_control_demo_bringup"),
"config",
"diffbot_diff_drive_controller.yaml",
)
Expand Down
21 changes: 9 additions & 12 deletions ros2_control_demo_bringup/launch/rrbot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def generate_launch_description():
declared_arguments.append(
DeclareLaunchArgument(
"description_file",
default_value="",
description="URDF/XACRO description file with the robot.",
)
)
Expand Down Expand Up @@ -182,14 +181,12 @@ def generate_launch_description():
arguments=[robot_controller, "-c", "/controller_manager"],
)

return LaunchDescription(
declared_arguments.append(
[
control_node,
robot_state_pub_node,
rviz_node,
joint_state_broadcaster_spawner,
robot_controller_spawner,
]
)
)
nodes = [
control_node,
robot_state_pub_node,
rviz_node,
joint_state_broadcaster_spawner,
robot_controller_spawner,
]

return LaunchDescription(declared_arguments + nodes)
2 changes: 1 addition & 1 deletion ros2_control_demo_description/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif()
find_package(ament_cmake REQUIRED)

install(
DIRECTORY launch rviz urdf
DIRECTORY launch meshes rviz urdf
DESTINATION share/${PROJECT_NAME}
)

Expand Down
8 changes: 4 additions & 4 deletions ros2_control_demo_description/urdf/diffbot_system.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ https://github.com/ros-simulation/gazebo_ros_demos/blob/kinetic-devel/diffbot_de
-->
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="2dof_robot">

<xacro:include filename="$(find ros2_control_demo_robot)/description/diffbot/diffbot.urdf.xacro" />
<xacro:include filename="$(find ros2_control_demo_description)/urdf/diffbot/diffbot.urdf.xacro" />

<!-- Import all Gazebo-customization elements, including Gazebo colors -->
<xacro:include filename="$(find ros2_control_demo_robot)/description/diffbot/diffbot.gazebo.xacro" />
<xacro:include filename="$(find ros2_control_demo_description)/urdf/diffbot/diffbot.gazebo.xacro" />

<!-- Import Rviz colors -->
<xacro:include filename="$(find ros2_control_demo_robot)/description/diffbot/diffbot.materials.xacro" />
<xacro:include filename="$(find ros2_control_demo_description)/urdf/diffbot/diffbot.materials.xacro" />

<!-- Import diffbot ros2_control description -->
<xacro:include filename="$(find ros2_control_demo_robot)/description/diffbot/diffbot_system.ros2_control.xacro" />
<xacro:include filename="$(find ros2_control_demo_description)/urdf/diffbot/diffbot_system.ros2_control.xacro" />

<xacro:diffbot prefix="" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ https://github.com/ros-simulation/gazebo_ros_demos/blob/kinetic-devel/rrbot_desc
<!-- ros_control plugin -->
<gazebo>
<plugin name="gazebo_ros2_control" filename="libgazebo_ros2_control.so">
<parameters>$(find ros2_control_demo_robot)/config/rrbot_gazebo_forward_controller_position.yaml</parameters>
<parameters>$(find ros2_control_demo_bringup)/config/rrbot_gazebo_forward_controller_position.yaml</parameters>
</plugin>
</gazebo>

Expand Down
2 changes: 1 addition & 1 deletion ros2_control_demo_hardware/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package format="3">
<name>ros2_control_demo_hardware</name>
<version>0.0.0</version>
<description>Demo package of `ros2_control` Hardware. This package provides example on how to define hardware of your own robot for ROS2 control. The package is used with `demo_robot` from package `ros2_control_demo_robot`.</description>
<description>Demo package of `ros2_control` Hardware. This package provides example on how to define hardware of your own robot for ROS2 control. The package is used with `demo_robot` from package `ros2_control_demo_description`.</description>

<maintainer email="denis@stogl.de">Denis Štogl</maintainer>

Expand Down

0 comments on commit a550d90

Please sign in to comment.