Skip to content

Commit

Permalink
Use PathJoinSubstitution instead of concatenating paths by hand
Browse files Browse the repository at this point in the history
  • Loading branch information
fmauch committed Jun 11, 2024
1 parent 917c8ac commit 32ddbf1
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions ur_simulation_gz/launch/ur_sim_moveit.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, OpaqueFunction
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare


Expand All @@ -49,7 +49,9 @@ def launch_setup(context, *args, **kwargs):

ur_control_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[FindPackageShare("ur_simulation_gz"), "/launch", "/ur_sim_control.launch.py"]
PathJoinSubstitution(
[FindPackageShare("ur_simulation_gz"), "launch", "ur_sim_control.launch.py"]
)
),
launch_arguments={
"ur_type": ur_type,
Expand Down Expand Up @@ -132,11 +134,13 @@ def generate_launch_description():
declared_arguments.append(
DeclareLaunchArgument(
"moveit_launch_file",
default_value=[
FindPackageShare("ur_moveit_config"),
"/launch",
"/ur_moveit.launch.py",
],
default_value=PathJoinSubstitution(
[
FindPackageShare("ur_moveit_config"),
"launch",
"ur_moveit.launch.py",
]
),
description="Absolute path for MoveIt launch file, part of a config package with robot SRDF/XACRO files. Usually the argument "
"is not set, it enables use of a custom moveit config.",
)
Expand Down

0 comments on commit 32ddbf1

Please sign in to comment.