Skip to content

Commit

Permalink
Update for new ur_moveit_config (#31)
Browse files Browse the repository at this point in the history
* Removed useless argument and added moveit_launch_file

* Fix formatting

* Use PathJoinSubstitution instead of concatenating paths by hand

---------

Co-authored-by: Felix Exner <[email protected]>
  • Loading branch information
VinDp and fmauch authored Jun 11, 2024
1 parent e9fdcfa commit c08d05e
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 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 @@ -44,13 +44,14 @@ def launch_setup(context, *args, **kwargs):
controllers_file = LaunchConfiguration("controllers_file")
description_package = LaunchConfiguration("description_package")
description_file = LaunchConfiguration("description_file")
moveit_config_package = LaunchConfiguration("moveit_config_package")
moveit_config_file = LaunchConfiguration("moveit_config_file")
moveit_launch_file = LaunchConfiguration("moveit_launch_file")
prefix = LaunchConfiguration("prefix")

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 All @@ -65,17 +66,9 @@ def launch_setup(context, *args, **kwargs):
)

ur_moveit_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[FindPackageShare("ur_moveit_config"), "/launch", "/ur_moveit.launch.py"]
),
PythonLaunchDescriptionSource(moveit_launch_file),
launch_arguments={
"ur_type": ur_type,
"safety_limits": safety_limits,
"description_package": description_package,
"description_file": description_file,
"moveit_config_package": moveit_config_package,
"moveit_config_file": moveit_config_file,
"prefix": prefix,
"use_sim_time": "true",
"launch_rviz": "true",
}.items(),
Expand Down Expand Up @@ -140,19 +133,18 @@ def generate_launch_description():
)
declared_arguments.append(
DeclareLaunchArgument(
"moveit_config_package",
default_value="ur_moveit_config",
description="MoveIt config package with robot SRDF/XACRO files. Usually the argument "
"moveit_launch_file",
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.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"moveit_config_file",
default_value="ur.srdf.xacro",
description="MoveIt SRDF/XACRO description file with the robot.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"prefix",
Expand Down

0 comments on commit c08d05e

Please sign in to comment.