Skip to content

Commit

Permalink
Add robot family arg to startup (#121)
Browse files Browse the repository at this point in the history
* Add robot family arg to startup

* capture launch stderr output

---------

Co-authored-by: Aron Svastits <svastits1@gmail.com>
  • Loading branch information
Svastits and Aron Svastits authored Dec 13, 2023
1 parent 81108c2 commit 0244938
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ joint_trajectory_controller:
- position
state_interfaces:
- position
state_publish_rate: 250.0
state_publish_rate: 50.0
action_monitor_rate: 20.0
allow_nonzero_velocity_at_trajectory_end: True
2 changes: 1 addition & 1 deletion kuka_iiqka_eac_driver/launch/startup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def launch_setup(context, *args, **kwargs):
"urdf", robot_model.perform(context) + ".urdf.xacro"]
),
" ",
]
], on_stderr='capture'
)

# Get URDF via xacro
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ joint_trajectory_controller:
- position
state_publish_rate: 50.0
action_monitor_rate: 20.0
allow_nonzero_velocity_at_trajectory_end: True

20 changes: 7 additions & 13 deletions kuka_kss_rsi_driver/launch/startup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,22 @@

def launch_setup(context, *args, **kwargs):
robot_model = LaunchConfiguration('robot_model')
robot_family = LaunchConfiguration('robot_family')
use_fake_hardware = LaunchConfiguration('use_fake_hardware')

# TODO(Svastits):better way to handle supported robot models and families
if robot_model.perform(context) in ["kr6_r700_sixx", "kr6_r900_sixx"]:
robot_family = "agilus"
elif robot_model.perform(context) in ["kr16_r2010_2"]:
robot_family = "cybertech"
elif robot_model.perform(context) in ["kr210_r2700_2", "kr210_r3100_2"]:
robot_family = "quantec"
else:
print("[ERROR] [launch]: robot model not recognized")
raise Exception

# Get URDF via xacro
robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare('kuka_{}_support'.format(robot_family)),
[FindPackageShare('kuka_{}_support'.format(robot_family.perform(context))),
"urdf", robot_model.perform(context) + ".urdf.xacro"]
),
" ",
"use_fake_hardware:=",
use_fake_hardware,
]
], on_stderr='capture'
)

robot_description = {'robot_description': robot_description_content}
Expand Down Expand Up @@ -116,6 +106,10 @@ def generate_launch_description():
'robot_model',
default_value='kr6_r700_sixx'
))
launch_arguments.append(DeclareLaunchArgument(
'robot_family',
default_value='agilus'
))
launch_arguments.append(DeclareLaunchArgument(
'use_fake_hardware',
default_value="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ joint_trajectory_controller:
- position
state_interfaces:
- position
state_publish_rate: 100.0
state_publish_rate: 50.0
action_monitor_rate: 20.0
allow_nonzero_velocity_at_trajectory_end: True

2 changes: 1 addition & 1 deletion kuka_sunrise_fri_driver/launch/startup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def launch_setup(context, *args, **kwargs):
"urdf", robot_model.perform(context) + ".urdf.xacro"]
),
" ",
]
], on_stderr='capture'
)

# Get URDF via xacro
Expand Down

0 comments on commit 0244938

Please sign in to comment.