Skip to content

Commit 14ecad8

Browse files
authored
Merge pull request #340 from lbr-stack/backport-339-to-jazzy
Backport 339 to jazzy
2 parents 22b2b61 + 60356f8 commit 14ecad8

Some content is hidden

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

41 files changed

+605
-287
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22
Changelog for package LBR FRI ROS 2 Stack
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
Jazzy v2.4.3 (2025-12-09)
5+
--------------------------
6+
* ``lbr_bringup``: Switched to declarative launch files and removed mixins from launch files: https://github.com/lbr-stack/lbr_fri_ros2_stack/issues/338
7+
48
Jazzy v2.4.2 (2025-12-08)
59
--------------------------
610
* ``lbr_description``: Added ``joint_limits_path`` argument to ``xacro`` files (defaults to KUKA values and user will currently need a custom launch file to configure): https://github.com/lbr-stack/lbr_fri_ros2_stack/issues/333

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ authors:
1919

2020

2121
title: "LBR-Stack: ROS 2 and Python Integration of KUKA FRI for Med and IIWA Robots"
22-
version: 2.4.2
22+
version: 2.4.3
2323
doi: 10.21105/joss.06138
24-
date-released: 2025-12-08
24+
date-released: 2025-12-09

lbr_bringup/doc/lbr_bringup.rst

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,18 @@ The ``lbr_bringup`` package hosts some launch files, which can be included via s
66
77
from launch import LaunchDescription
88
from launch.actions import IncludeLaunchDescription
9-
from launch.launch_description_sources import PythonLaunchDescriptionSource
9+
from launch.substitutions import PathSubstitution
10+
from launch_ros.substitutions import FindPackageShare
11+
1012
1113
def generate_launch_description() -> LaunchDescription:
12-
ld = LaunchDescription()
13-
ld.add_action(
14+
return LaunchDescription(
1415
IncludeLaunchDescription(
15-
PythonLaunchDescriptionSource(
16-
PathJoinSubstitution(
17-
[
18-
FindPackageShare("lbr_bringup"),
19-
"launch",
20-
"mock.launch.py",
21-
]
22-
)
23-
),
16+
PathSubstitution(
17+
FindPackageShare("lbr_bringup") / "launch" / "mock.launch.py"
18+
)
2419
)
2520
)
26-
return ld
2721
2822
The launch files can also be run via the command line, as further described below.
2923

@@ -153,15 +147,9 @@ The below shows an example of the `rviz.launch.py <https://github.com/lbr-stack/
153147
154148
155149
def generate_launch_description() -> LaunchDescription:
156-
ld = LaunchDescription()
157-
158-
# launch arguments
159-
ld.add_action(RVizMixin.arg_rviz_cfg())
160-
ld.add_action(RVizMixin.arg_rviz_cfg_pkg())
161-
162-
# rviz
163-
ld.add_action(RVizMixin.node_rviz())
164-
return ld
150+
return LaunchDescription(
151+
[RVizMixin.arg_rviz_cfg(), RVizMixin.arg_rviz_cfg_pkg(), RVizMixin.node_rviz()]
152+
)
165153
166154
Which is quite compact and easy to read.
167155

@@ -183,5 +171,5 @@ Troubleshooting
183171
---------------
184172
Noisy Execution
185173
~~~~~~~~~~~~~~~
186-
- Frequency: Make sure the ``ros2_control_node`` frequency and the ``FRI send period`` are compatible, consider changing ``update_rate`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/jazzy/lbr_description/ros2_control/lbr_controllers.yaml>`_:octicon:`link-external`.
174+
- Frequency: Make sure the ``ros2_control_node`` frequency and the ``FRI send period`` are compatible, consider changing ``update_rate`` in `hardware_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/jazzy/lbr_description/ros2_control/hardware_controllers.yaml>`_:octicon:`link-external`.
187175
- 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/gazebo.launch.py

Lines changed: 127 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,132 @@
11
from launch import LaunchDescription
2-
from launch.substitutions import LaunchConfiguration
3-
from lbr_bringup.description import LBRDescriptionMixin
4-
from lbr_bringup.gazebo import GazeboMixin
5-
from lbr_bringup.ros2_control import LBRROS2ControlMixin
2+
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
3+
from launch.substitutions import (
4+
Command,
5+
FindExecutable,
6+
LaunchConfiguration,
7+
PathSubstitution,
8+
)
9+
from launch_ros.actions import Node
10+
from launch_ros.substitutions import FindPackageShare
611

712

813
def generate_launch_description() -> LaunchDescription:
9-
ld = LaunchDescription()
10-
11-
# launch arguments
12-
ld.add_action(LBRDescriptionMixin.arg_model())
13-
ld.add_action(LBRDescriptionMixin.arg_robot_name())
14-
ld.add_action(LBRROS2ControlMixin.arg_init_jnt_pos())
15-
ld.add_action(
16-
LBRROS2ControlMixin.arg_ctrl()
17-
) # Gazebo loads controller configuration through lbr_description/gazebo/*.xacro from lbr_description/ros2_control/lbr_controllers.yaml
18-
19-
# robot description
20-
robot_description = LBRDescriptionMixin.param_robot_description(mode="gazebo")
21-
22-
# robot state publisher
23-
robot_state_publisher = LBRROS2ControlMixin.node_robot_state_publisher(
24-
robot_description=robot_description, use_sim_time=True
25-
)
26-
ld.add_action(
27-
robot_state_publisher
28-
) # Do not condition robot state publisher on joint state broadcaster as Gazebo uses robot state publisher to retrieve robot description
29-
30-
# Gazebo
31-
ld.add_action(GazeboMixin.include_gazebo()) # Gazebo has its own controller manager
32-
ld.add_action(GazeboMixin.node_clock_bridge())
33-
ld.add_action(
34-
GazeboMixin.node_create()
35-
) # spawns robot in Gazebo through robot_description topic of robot_state_publisher
36-
37-
# spawn controllers
38-
ld.add_action(
39-
LBRROS2ControlMixin.node_controller_spawner(
40-
controllers=["joint_state_broadcaster", LaunchConfiguration("ctrl")]
41-
)
14+
return LaunchDescription(
15+
[
16+
DeclareLaunchArgument(
17+
name="model",
18+
default_value="iiwa7",
19+
description="The LBR model in use.",
20+
choices=["iiwa7", "iiwa14", "med7", "med14"],
21+
),
22+
DeclareLaunchArgument(
23+
name="robot_name",
24+
default_value="lbr",
25+
description="The robot's name.",
26+
),
27+
DeclareLaunchArgument(
28+
name="init_jnt_pos_pkg",
29+
default_value="lbr_description",
30+
description="Package containing the initial_joint_positions.yaml file.",
31+
),
32+
DeclareLaunchArgument(
33+
name="init_jnt_pos",
34+
default_value="ros2_control/initial_joint_positions.yaml",
35+
description="The relative path from sys_cfg_pkg to the initial_joint_positions.yaml file.",
36+
),
37+
DeclareLaunchArgument(
38+
name="ctrl",
39+
default_value="joint_trajectory_controller",
40+
description="Desired default controller. Gazebo loads controller configuration through lbr_description/gazebo/*.xacro from lbr_description/ros2_control/gazebo_controllers.yaml.",
41+
choices=[
42+
"forward_position_controller",
43+
"joint_trajectory_controller",
44+
],
45+
),
46+
Node(
47+
package="robot_state_publisher",
48+
executable="robot_state_publisher",
49+
output="screen",
50+
parameters=[
51+
{
52+
"robot_description": Command(
53+
[
54+
FindExecutable(name="xacro"),
55+
" ",
56+
PathSubstitution(FindPackageShare("lbr_description"))
57+
/ "urdf"
58+
/ LaunchConfiguration("model")
59+
/ LaunchConfiguration("model"),
60+
".xacro",
61+
" robot_name:=",
62+
LaunchConfiguration("robot_name"),
63+
" mode:=gazebo",
64+
" initial_joint_positions_path:=",
65+
PathSubstitution(
66+
FindPackageShare(
67+
LaunchConfiguration("init_jnt_pos_pkg")
68+
)
69+
)
70+
/ LaunchConfiguration(
71+
"init_jnt_pos",
72+
),
73+
]
74+
)
75+
},
76+
{"use_sim_time": True},
77+
],
78+
namespace=LaunchConfiguration("robot_name"),
79+
),
80+
IncludeLaunchDescription(
81+
PathSubstitution(
82+
FindPackageShare("ros_gz_sim"),
83+
)
84+
/ "launch"
85+
/ "gz_sim.launch.py",
86+
launch_arguments={"gz_args": "-r empty.sdf"}.items(),
87+
), # Gazebo has its own controller manager
88+
Node(
89+
package="ros_gz_bridge",
90+
executable="parameter_bridge",
91+
arguments=["/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock"],
92+
output="screen",
93+
),
94+
Node(
95+
package="ros_gz_sim",
96+
executable="create",
97+
arguments=[
98+
"-topic",
99+
"robot_description",
100+
"-name",
101+
LaunchConfiguration("robot_name"),
102+
"-allow_renaming",
103+
"-x",
104+
"0.0",
105+
"-y",
106+
"0.0",
107+
"-z",
108+
"0.0",
109+
"-R",
110+
"0.0",
111+
"-P",
112+
"0.0",
113+
"-Y",
114+
"0.0",
115+
],
116+
output="screen",
117+
namespace=LaunchConfiguration("robot_name"),
118+
), # spawns robot in Gazebo through robot_description topic of robot_state_publisher
119+
Node(
120+
package="controller_manager",
121+
executable="spawner",
122+
output="screen",
123+
arguments=[
124+
"--controller-manager",
125+
"controller_manager",
126+
"joint_state_broadcaster",
127+
LaunchConfiguration("ctrl"),
128+
],
129+
namespace=LaunchConfiguration("robot_name"),
130+
),
131+
]
42132
)
43-
return ld

0 commit comments

Comments
 (0)