Skip to content

Commit 8fd40b1

Browse files
authored
Merge pull request #96 from KCL-BMEIS/dev-humble-moveit
Humble v1.2.0 Brings back MoveIt 2 🥳 Closes: #52 #60
2 parents dea9191 + 1af56dc commit 8fd40b1

File tree

218 files changed

+2692
-833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+2692
-833
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
.vscode
12
**/__pycache__

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
1919
Next, launch the simulation via
2020
```shell
2121
source install/setup.bash
22-
ros2 launch lbr_bringup lbr_bringup.launch.py model:=med7 sim:=true # model:=[iiwa7/iiwa14/med7/med14]
22+
ros2 launch lbr_bringup bringup.launch.py model:=med7 sim:=true # model:=[iiwa7/iiwa14/med7/med14]
2323
```
2424

2525
Now, run the [demos](https://lbr-fri-ros2-stack-doc.readthedocs.io/en/humble/lbr_fri_ros2_stack/lbr_demos/doc/lbr_demos.html). To get started with the real robot, checkout the [Documentation](https://lbr-fri-ros2-stack-doc.readthedocs.io/en/humble/index.html) above.

lbr_bringup/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ endif()
77

88
# find dependencies
99
find_package(ament_cmake REQUIRED)
10-
find_package(ament_cmake_python REQUIRED)
1110

1211
install(
1312
DIRECTORY config launch
1413
DESTINATION share/${PROJECT_NAME}
1514
)
1615

16+
# Launch mixins
1717
ament_python_install_package(${PROJECT_NAME})
1818

1919
ament_package()

lbr_bringup/doc/lbr_bringup.rst

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
LBR Bringup
2+
===========
3+
The ``lbr_fri_ros2_stack`` is designed for research **and** deployment. It runs standalone, with ``ros2_control``, and thus also with ``MoveIt 2``. Details are described in below sections
4+
5+
- :ref:`ROS 2 Control and MoveIt 2 Launch`
6+
- :ref:`Standalone Launch`
7+
8+
Users may also refer to :ref:`Software Architecture` for a better understanding of the underlying ``lbr_fri_ros2`` package.
9+
10+
.. note::
11+
For the real robot, make sure you have followed :ref:`Robot Setup` first.
12+
13+
.. warning::
14+
On the real robot, do always execute in ``T1`` mode first.
15+
16+
General Information on the FRI
17+
------------------------------
18+
The ``FRI`` lets the user select a ``FRI control mode`` and a ``FRI client command mode``. When running the ``LBRServer``:
19+
20+
- .. dropdown:: Select ``FRI control mode``
21+
22+
.. thumbnail:: ../../lbr_fri_ros2_stack/doc/img/controller/raw/lbr_server_control_mode.png
23+
24+
- .. dropdown:: Select ``FRI client command mode``
25+
26+
.. thumbnail:: ../../lbr_fri_ros2_stack/doc/img/controller/raw/lbr_server_client_command_mode.png
27+
28+
The ``FRI control mode`` specifies the mode in which the robot is controlled, and the ``FRI client command mode`` specifies the commands that the user sends.
29+
30+
ROS 2 Control and MoveIt 2 Launch
31+
---------------------------------
32+
The ``lbr_bringup`` works for the simulation and the real robot. Run:
33+
34+
.. code:: bash
35+
36+
ros2 launch lbr_bringup bringup.launch.py \
37+
model:=iiwa7 # [iiwa7, iiwa14, med7, med14] \
38+
sim:=true # [true, false] \
39+
rviz:=true # [true, false] \
40+
moveit:=true # [true, false]
41+
42+
.. note::
43+
For a list of available parameters, call ``ros2 launch lbr_bringup bringup.launch.py -s``.
44+
45+
When using the real robot
46+
47+
.. dropdown:: Launch the ``LBRServer`` application on the ``KUKA smartPAD``
48+
49+
.. thumbnail:: ../../lbr_demos/doc/img/applications_lbr_server.png
50+
51+
and select:
52+
53+
- ``FRI send period``: ``10 ms``
54+
- ``IP address``: ``your configuration``
55+
- ``FRI control mode``: ``POSITION_CONTROL`` or ``JOINT_IMPEDANCE_CONTROL`` (will put the robot into a compliant mode)
56+
- ``FRI client command mode``: ``POSITION``
57+
58+
Make sure that the ``update_rate`` in `lbr_controllers.yml <https://github.com/KCL-BMEIS/lbr_fri_ros2_stack/tree/humble/lbr_hardware_interface/config/lbr_controllers.yml>`_ is greater or equal ``100`` (``FRI send period``).
59+
60+
For using other ``FRI send period``, also change the ``sample_time`` in the `lbr.ros2_control.xacro <https://github.com/KCL-BMEIS/lbr_fri_ros2_stack/blob/humble/lbr_description/ros2_control/lbr.ros2_control.xacro>`_ (automated in the future).
61+
62+
Standalone Launch
63+
-----------------
64+
Standalone launch is great for research. Only the the real robot is supported. It can be launched through:
65+
66+
.. code:: bash
67+
68+
ros2 launch lbr_fri_ros2 lbr_app.launch.py \
69+
model:=iiwa7 # [iiwa7, iiwa14, med7, med14] \
70+
robot_name:=lbr # any robot name
71+
72+
This runs the :lbr_fri_ros2:`LBRAppComponentLBRApp <lbr_fri_ros2::LBRAppComponent>`, which creates 2 topics, ``/robot_name/command`` for commands and ``/robot_name/state``. See :ref:`LBR Demos FRI ROS 2` for more examples and :ref:`LBR FRI ROS 2` for more documentation.
73+
74+
.. note::
75+
For a list of available parameters, call ``ros2 launch lbr_fri_ros2 lbr_app.launch.py -s``.
76+
77+
Troubleshooting
78+
---------------
79+
Noisy Execution
80+
~~~~~~~~~~~~~~~
81+
Three main causes:
82+
83+
- Frequency: Make sure the ``ros2_control_node`` runs at the same or a higher rate of the ``FRI send period``, change ``update_rate`` in `lbr_controllers.yml <https://github.com/KCL-BMEIS/lbr_fri_ros2_stack/tree/humble/lbr_hardware_interface/config/lbr_controllers.yml>`_.
84+
- Standalone noise: Smoothing might be required, see :ref:`LBR Demos FRI ROS 2`.
85+
- Realtime priority: Set real time priority in ``code /etc/security/limits.conf``, add the line: ``user - rtprio 99``, where user is your username.

lbr_bringup/launch/bringup.launch.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
from launch import LaunchDescription
2+
from launch.actions import IncludeLaunchDescription, RegisterEventHandler
3+
from launch.conditions import IfCondition, UnlessCondition
4+
from launch.event_handlers import OnIncludeLaunchDescription
5+
from launch.launch_description_sources import PythonLaunchDescriptionSource
6+
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
7+
from launch_ros.substitutions import FindPackageShare
8+
9+
from lbr_description import LBRDescriptionMixin, RVizMixin
10+
11+
12+
def generate_launch_description() -> LaunchDescription:
13+
ld = LaunchDescription()
14+
15+
ld.add_action(LBRDescriptionMixin.arg_sim())
16+
17+
ld.add_action(
18+
IncludeLaunchDescription(
19+
PythonLaunchDescriptionSource(
20+
PathJoinSubstitution(
21+
[
22+
FindPackageShare("lbr_bringup"),
23+
"launch",
24+
"sim.launch.py",
25+
]
26+
)
27+
),
28+
condition=IfCondition(LaunchConfiguration("sim")),
29+
)
30+
)
31+
32+
ld.add_action(
33+
IncludeLaunchDescription(
34+
PythonLaunchDescriptionSource(
35+
PathJoinSubstitution(
36+
[
37+
FindPackageShare("lbr_bringup"),
38+
"launch",
39+
"real.launch.py",
40+
]
41+
)
42+
),
43+
condition=UnlessCondition(LaunchConfiguration("sim")),
44+
)
45+
)
46+
47+
return ld

lbr_bringup/launch/lbr_bringup.launch.py

Lines changed: 0 additions & 77 deletions
This file was deleted.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
from typing import List
2+
3+
from launch import LaunchDescription, LaunchDescriptionEntity
4+
from launch.actions import OpaqueFunction
5+
from launch.substitutions import LaunchConfiguration
6+
7+
from lbr_bringup import LBRMoveGroupMixin
8+
from lbr_description import LBRDescriptionMixin, RVizMixin
9+
10+
11+
def launch_setup(context) -> List[LaunchDescriptionEntity]:
12+
ld = LaunchDescription()
13+
14+
ld.add_action(LBRMoveGroupMixin.arg_allow_trajectory_execution())
15+
ld.add_action(LBRMoveGroupMixin.arg_capabilities())
16+
ld.add_action(LBRMoveGroupMixin.arg_disable_capabilities())
17+
ld.add_action(LBRMoveGroupMixin.arg_monitor_dynamics())
18+
ld.add_action(LBRMoveGroupMixin.args_publish_monitored_planning_scene())
19+
20+
model = LaunchConfiguration("model").perform(context)
21+
moveit_configs_builder = LBRMoveGroupMixin.moveit_configs_builder(
22+
model,
23+
package_name=f"{model}_moveit_config",
24+
)
25+
movegroup_params = LBRMoveGroupMixin.params_move_group()
26+
27+
# MoveGroup
28+
ld.add_action(
29+
LBRMoveGroupMixin.node_move_group(
30+
parameters=[
31+
moveit_configs_builder.to_dict(),
32+
movegroup_params,
33+
{"use_sim_time": LaunchConfiguration("sim")},
34+
],
35+
)
36+
)
37+
38+
# RViz
39+
rviz = RVizMixin.node_rviz(
40+
rviz_config_pkg=f"{model}_moveit_config",
41+
rviz_config="config/moveit.rviz",
42+
parameters=LBRMoveGroupMixin.params_rviz(
43+
moveit_configs=moveit_configs_builder.to_moveit_configs()
44+
),
45+
)
46+
47+
ld.add_action(rviz)
48+
49+
return ld.entities
50+
51+
52+
def generate_launch_description() -> LaunchDescription:
53+
ld = LaunchDescription()
54+
55+
ld.add_action(LBRDescriptionMixin.arg_model())
56+
ld.add_action(LBRDescriptionMixin.arg_robot_name())
57+
ld.add_action(LBRDescriptionMixin.arg_sim())
58+
59+
ld.add_action(OpaqueFunction(function=launch_setup))
60+
61+
return ld

0 commit comments

Comments
 (0)