Skip to content

Commit

Permalink
Migrating to absolute paths (UniversalRobots#32)
Browse files Browse the repository at this point in the history
* Added description_file argument

* Added rviz_config_file as argument

* Removed useless description_package argument
  • Loading branch information
VinDp authored Jun 12, 2024
1 parent c08d05e commit e2acca2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
28 changes: 21 additions & 7 deletions ur_simulation_gz/launch/ur_sim_control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,20 @@ def launch_setup(context, *args, **kwargs):
prefix = LaunchConfiguration("prefix")
activate_joint_controller = LaunchConfiguration("activate_joint_controller")
initial_joint_controller = LaunchConfiguration("initial_joint_controller")
description_file = LaunchConfiguration("description_file")
launch_rviz = LaunchConfiguration("launch_rviz")
rviz_config_file = LaunchConfiguration("rviz_config_file")
gazebo_gui = LaunchConfiguration("gazebo_gui")

initial_joint_controllers = PathJoinSubstitution(
[FindPackageShare(runtime_config_package), "config", controllers_file]
)

rviz_config_file = PathJoinSubstitution(
[FindPackageShare("ur_description"), "rviz", "view_robot.rviz"]
)

robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare("ur_simulation_gz"), "urdf", "ur_gz.urdf.xacro"]
),
description_file,
" ",
"safety_limits:=",
safety_limits,
Expand Down Expand Up @@ -259,9 +255,27 @@ def generate_launch_description():
description="Robot controller to start.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"description_file",
default_value=PathJoinSubstitution(
[FindPackageShare("ur_simulation_gz"), "urdf", "ur_gz.urdf.xacro"]
),
description="URDF/XACRO description file (absolute path) with the robot.",
)
)
declared_arguments.append(
DeclareLaunchArgument("launch_rviz", default_value="true", description="Launch RViz?")
)
declared_arguments.append(
DeclareLaunchArgument(
"rviz_config_file",
default_value=PathJoinSubstitution(
[FindPackageShare("ur_description"), "rviz", "view_robot.rviz"]
),
description="Rviz config file (absolute path) to use when launching rviz.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"gazebo_gui", default_value="true", description="Start gazebo with GUI?"
Expand Down
16 changes: 4 additions & 12 deletions ur_simulation_gz/launch/ur_sim_moveit.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def launch_setup(context, *args, **kwargs):
# General arguments
runtime_config_package = LaunchConfiguration("runtime_config_package")
controllers_file = LaunchConfiguration("controllers_file")
description_package = LaunchConfiguration("description_package")
description_file = LaunchConfiguration("description_file")
moveit_launch_file = LaunchConfiguration("moveit_launch_file")
prefix = LaunchConfiguration("prefix")
Expand All @@ -58,7 +57,6 @@ def launch_setup(context, *args, **kwargs):
"safety_limits": safety_limits,
"runtime_config_package": runtime_config_package,
"controllers_file": controllers_file,
"description_package": description_package,
"description_file": description_file,
"prefix": prefix,
"launch_rviz": "false",
Expand Down Expand Up @@ -116,19 +114,13 @@ def generate_launch_description():
description="YAML file with the controllers configuration.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"description_package",
default_value="ur_description",
description="Description package with robot URDF/XACRO files. Usually the argument "
"is not set, it enables use of a custom description.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"description_file",
default_value="ur.urdf.xacro",
description="URDF/XACRO description file with the robot.",
default_value=PathJoinSubstitution(
[FindPackageShare("ur_simulation_gz"), "urdf", "ur_gz.urdf.xacro"]
),
description="URDF/XACRO description file (absolute path) with the robot.",
)
)
declared_arguments.append(
Expand Down

0 comments on commit e2acca2

Please sign in to comment.