Skip to content

Commit

Permalink
back-port use_fake_hardware parameter in ur_moveit.launch.py to Galac…
Browse files Browse the repository at this point in the history
…tic (#464) (#470)

* add ur_moveit.launch.py parameter to use working controller when using fake hardware (#464)

add script parameter to use correct controller when using fake hardware

* Fix selecting the right controller given fake_hw

This was falsely introduced earlier. This is a working version.

Co-authored-by: adverley <[email protected]>
Co-authored-by: Felix Exner <[email protected]>
  • Loading branch information
3 people authored Oct 11, 2022
1 parent 600c1d0 commit 8d0d022
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ur_moveit_config/launch/ur_moveit.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def launch_setup(context, *args, **kwargs):

# Initialize Arguments
ur_type = LaunchConfiguration("ur_type")
use_fake_hardware = LaunchConfiguration("use_fake_hardware")
safety_limits = LaunchConfiguration("safety_limits")
safety_pos_margin = LaunchConfiguration("safety_pos_margin")
safety_k_position = LaunchConfiguration("safety_k_position")
Expand Down Expand Up @@ -159,6 +160,12 @@ def launch_setup(context, *args, **kwargs):

# Trajectory Execution Configuration
controllers_yaml = load_yaml("ur_moveit_config", "config/controllers.yaml")
# the scaled_joint_trajectory_controller does not work on fake hardware
change_controllers = context.perform_substitution(use_fake_hardware)
if change_controllers == "true":
controllers_yaml["scaled_joint_trajectory_controller"]["default"] = False
controllers_yaml["joint_trajectory_controller"]["default"] = True

moveit_controllers = {
"moveit_simple_controller_manager": controllers_yaml,
"moveit_controller_manager": "moveit_simple_controller_manager/MoveItSimpleControllerManager",
Expand Down Expand Up @@ -262,6 +269,13 @@ def generate_launch_description():
choices=["ur3", "ur3e", "ur5", "ur5e", "ur10", "ur10e", "ur16e"],
)
)
declared_arguments.append(
DeclareLaunchArgument(
"use_fake_hardware",
default_value="false",
description="Indicate whether robot is running with fake hardware mirroring command to its states.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"safety_limits",
Expand Down

0 comments on commit 8d0d022

Please sign in to comment.