-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First compilable version * Fix wrong paths * Fix rst * Update copyright Co-authored-by: Dr. Denis <denis@stoglrobotics.de> * Restructure cmakelists * Add maintainer * Cleanup old paths * Update Dr. Denis' Email and add him as author. * Update maintainer * Use test_nodes from ros2_controllers * Fix trailing whitespaces * Fix rviz display * Add image to readme --------- Co-authored-by: Dr. Denis <denis@stoglrobotics.de>
- Loading branch information
1 parent
0572d28
commit 7902db1
Showing
20 changed files
with
469 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,109 @@ | ||
|
||
|
||
TODO(destogl): This is not adjusted yet!! | ||
**************** | ||
Example 1: RRBot | ||
**************** | ||
|
||
|
||
*RRBot*, or ''Revolute-Revolute Manipulator Robot'', is a simple 3-linkage, 2-joint arm that we will use to demonstrate various features. | ||
It is 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 ``urdf`` folder of ``rrbot_description`` package. | ||
The *RRBot* URDF files can be found in the ``description/urdf`` folder. | ||
|
||
1. To check that *RRBot* descriptions are working properly use following launch commands | ||
|
||
.. code-block:: shell | ||
1. To check that *RRBot* descriptions are working properly use following launch commands: | ||
ros2 launch ros2_control_demo_example_1 view_robot.launch.py | ||
*RRBot* | ||
``` | ||
ros2 launch rrbot_description view_robot.launch.py | ||
``` | ||
**NOTE**: Getting the following output in terminal is OK: ``Warning: Invalid frame ID "odom" passed to canTransform argument target_frame - frame does not exist``. | ||
This happens because ``joint_state_publisher_gui`` node need some time to start. | ||
The ``joint_state_publisher_gui`` provides a GUI to generate a random configuration for rrbot. It is immediately displayed in ``Rviz``. | ||
The ``joint_state_publisher_gui`` provides a GUI to change the configuration for rrbot. It is immediately displayed in *RViz*. | ||
|
||
.. image:: doc/rrbot.png | ||
:width: 400 | ||
:alt: Revolute-Revolute Manipulator Robot | ||
|
||
1. To check that *RRBot* descriptions are working properly use following launch commands: | ||
|
||
*RRBot* | ||
``` | ||
ros2 launch rrbot_description view_robot.launch.py | ||
``` | ||
**NOTE**: Getting the following output in terminal is OK: ``Warning: Invalid frame ID "odom" passed to canTransform argument target_frame - frame does not exist``. | ||
This happens because ``joint_state_publisher_gui`` node need some time to start. | ||
The ``joint_state_publisher_gui`` provides a GUI to generate a random configuration for rrbot. It is immediately displayed in ``Rviz``. | ||
2. To start *RRBot* example open a terminal, source your ROS2-workspace and execute its launch file with | ||
|
||
.. code-block:: shell | ||
1. To start *RRBot* example open a terminal, source your ROS2-workspace and execute its launch file with: | ||
``` | ||
ros2 launch ros2_control_demo_bringup rrbot.launch.py | ||
``` | ||
The launch file loads and starts the robot hardware, controllers and opens ``RViz``. | ||
ros2 launch ros2_control_demo_example_1 rrbot.launch.py | ||
The launch file loads and starts the robot hardware, controllers and opens *RViz*. | ||
In starting terminal you will see a lot of output from the hardware implementation showing its internal states. | ||
This is only of exemplary purposes and should be avoided as much as possible in a hardware interface implementation. | ||
|
||
If you can see two orange and one yellow rectangle in in ``RViz`` everything has started properly. | ||
If you can see two orange and one yellow rectangle in in *RViz* everything has started properly. | ||
Still, to be sure, let's introspect the control system before moving *RRBot*. | ||
|
||
1. Check if the hardware interface loaded properly, by opening another terminal and executing: | ||
``` | ||
ros2 control list_hardware_interfaces | ||
``` | ||
3. Check if the hardware interface loaded properly, by opening another terminal and executing | ||
|
||
.. code-block:: shell | ||
You should get:: | ||
ros2 control list_hardware_interfaces | ||
.. code-block:: shell | ||
command interfaces | ||
joint1/position [claimed] | ||
joint2/position [claimed] | ||
joint1/position [available] [claimed] | ||
joint2/position [available] [claimed] | ||
state interfaces | ||
joint1/position | ||
joint2/position | ||
joint1/position | ||
joint2/position | ||
Marker ``[claimed]`` by command interfaces means that a controller has access to command *RRBot*. | ||
|
||
1. Check is controllers are running: | ||
``` | ||
ros2 control list_controllers | ||
``` | ||
You should get: | ||
``` | ||
joint_state_broadcaster[joint_state_broadcaster/JointStateBroadcaster] active | ||
forward_position_controller[forward_command_controller/ForwardCommandController] active | ||
``` | ||
4. Check is controllers are running by | ||
|
||
.. code-block:: shell | ||
ros2 control list_controllers | ||
.. code-block:: shell | ||
1. If you get output from above you can send commands to *Forward Command Controller*, either: | ||
joint_state_broadcaster[joint_state_broadcaster/JointStateBroadcaster] active | ||
forward_position_controller[forward_command_controller/ForwardCommandController] active | ||
5. If you get output from above you can send commands to *Forward Command Controller*, either: | ||
|
||
a. Manually using ros2 cli interface: | ||
``` | ||
ros2 topic pub /position_commands std_msgs/msg/Float64MultiArray "data: | ||
- 0.5 | ||
- 0.5" | ||
``` | ||
B. Or you can start a demo node which sends two goals every 5 seconds in a loop: | ||
``` | ||
ros2 launch ros2_control_demo_bringup test_forward_position_controller.launch.py | ||
``` | ||
You should now see orange and yellow blocks moving in ``RViz``. | ||
Also, you should see changing states in the terminal where launch file is started. | ||
|
||
|
||
Files used for this demos: | ||
- Launch file: [rrbot.launch.py](ros2_control_demo_bringup/launch/rrbot.launch.py) | ||
- Controllers yaml: [rrbot_controllers.yaml](ros2_control_demo_bringup/config/rrbot_controllers.yaml) | ||
- URDF file: [rrbot.urdf.xacro](ros2_control_demo_description/rrbot_description/urdf/rrbot.urdf.xacro) | ||
- Description: [rrbot_description.urdf.xacro](ros2_control_demo_description/rrbot_description/urdf/rrbot_description.urdf.xacro) | ||
- `ros2_control` tag: [rrbot.ros2_control.xacro](ros2_control_demo_description/rrbot_description/ros2_control/rrbot.ros2_control.xacro) | ||
- RViz configuration: [rrbot.rviz](ros2_control_demo_description/rrbot_description/config/rrbot.rviz) | ||
|
||
- Hardware interface plugin: [rrbot_system_position_only.cpp](ros2_control_demo_hardware/src/rrbot_system_position_only.cpp) | ||
|
||
|
||
Controllers from this demo: | ||
- ``Joint State Broadcaster`` ([``ros2_controllers`` repository](https://github.com/ros-controls/ros2_controllers)): [doc](https://ros-controls.github.io/control.ros.org/ros2_controllers/joint_state_broadcaster/doc/userdoc.html) | ||
- ``Forward Command Controller`` ([``ros2_controllers`` repository](https://github.com/ros-controls/ros2_controllers)): [doc](https://ros-controls.github.io/control.ros.org/ros2_controllers/forward_command_controller/doc/userdoc.html) | ||
|
||
.. code-block:: shell | ||
ros2 topic pub /position_commands std_msgs/msg/Float64MultiArray "data: | ||
- 0.5 | ||
- 0.5" | ||
B. Or you can start a demo node which sends two goals every 5 seconds in a loop | ||
|
||
.. code-block:: shell | ||
ros2 launch ros2_control_demo_example_1 test_forward_position_controller.launch.py | ||
You should now see orange and yellow blocks moving in *RViz*. | ||
Also, you should see changing states in the terminal where launch file is started, e.g. | ||
|
||
.. code-block:: shell | ||
[RRBotSystemPositionOnlyHardware]: Got command 0.50000 for joint 0! | ||
[RRBotSystemPositionOnlyHardware]: Got command 0.50000 for joint 1! | ||
Files used for this demos | ||
######################### | ||
|
||
- Launch file: `rrbot.launch.py <bringup/launch/rrbot.launch.py>`__ | ||
- Controllers yaml: `rrbot_controllers.yaml <bringup/config/rrbot_controllers.yaml>`__ | ||
- URDF file: `rrbot.urdf.xacro <description/urdf/rrbot.urdf.xacro>`__ | ||
|
||
+ Description: `rrbot_description.urdf.xacro <description/urdf/rrbot_description.urdf.xacro>`__ | ||
+ ``ros2_control`` tag: `rrbot.ros2_control.xacro <description/ros2_control/rrbot.ros2_control.xacro>`__ | ||
|
||
- RViz configuration: `rrbot.rviz <description/rviz/rrbot.rviz>`__ | ||
|
||
- Hardware interface plugin: `rrbot.cpp <hardware/rrbot.cpp>`__ | ||
|
||
|
||
Controllers from this demo | ||
########################## | ||
- ``Joint State Broadcaster`` (`ros2_controllers repository <https://github.com/ros-controls/ros2_controllers>`__): `doc <https://control.ros.org/master/doc/ros2_controllers/joint_state_broadcaster/doc/userdoc.html>`__ | ||
- ``Forward Command Controller`` (`ros2_controllers repository <https://github.com/ros-controls/ros2_controllers>`__): `doc <https://control.ros.org/master/doc/ros2_controllers/forward_command_controller/doc/userdoc.html>`__ |
11 changes: 11 additions & 0 deletions
11
example_1/bringup/config/rrbot_forward_position_publisher.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
publisher_forward_position_controller: | ||
ros__parameters: | ||
|
||
wait_sec_between_publish: 5 | ||
publish_topic: "/forward_position_controller/commands" | ||
|
||
goal_names: ["pos1", "pos2", "pos3", "pos4"] | ||
pos1: [0.785, 0.785] | ||
pos2: [0, 0] | ||
pos3: [-0.785, -0.785] | ||
pos4: [0, 0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.