Skip to content

Commit

Permalink
Added the empty gripper option for gen3.launch.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmrad committed Oct 7, 2024
1 parent 29dca91 commit f70c5ee
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions kortex_bringup/launch/gen3.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def generate_launch_description():
declared_arguments.append(
DeclareLaunchArgument(
"gripper",
default_value="robotiq_2f_85",
default_value="",
description="Name of the gripper attached to the arm",
choices=["robotiq_2f_85", "robotiq_2f_140"],
choices=["", "robotiq_2f_85", "robotiq_2f_140"],
)
)
declared_arguments.append(
Expand Down
16 changes: 13 additions & 3 deletions kortex_bringup/launch/kortex_control.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
FindExecutable,
LaunchConfiguration,
PathJoinSubstitution,
PythonExpression,
)
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
Expand Down Expand Up @@ -187,7 +188,11 @@ def launch_setup(context, *args, **kwargs):
package="controller_manager",
executable="spawner",
arguments=[robot_hand_controller, "-c", "/controller_manager"],
condition=UnlessCondition(is_gen3_lite),
condition=IfCondition(
PythonExpression([
"'", gripper, "' != '' and '", is_gen3_lite, "' == 'false'"
])
),
)

# only start the fault controller if we are using hardware
Expand All @@ -205,9 +210,14 @@ def launch_setup(context, *args, **kwargs):
delay_rviz_after_joint_state_broadcaster_spawner,
robot_traj_controller_spawner,
robot_pos_controller_spawner,
robot_hand_controller_spawner,
fault_controller_spawner,
]
start_robot_hand_controller = (
gripper.perform(context) != "" and is_gen3_lite != "true"
)
# Conditionally add robot_hand_controller_spawner
if start_robot_hand_controller:
nodes_to_start.append(robot_hand_controller_spawner)

return nodes_to_start

Expand Down Expand Up @@ -304,7 +314,7 @@ def generate_launch_description():
declared_arguments.append(
DeclareLaunchArgument(
"gripper",
default_value='""',
default_value="",
description="Name of the gripper attached to the arm",
)
)
Expand Down
2 changes: 1 addition & 1 deletion kortex_description/robots/gen3.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<xacro:arg name="port_realtime" default="10001" />
<xacro:arg name="session_inactivity_timeout_ms" default="60000" />
<xacro:arg name="connection_inactivity_timeout_ms" default="2000" />
<xacro:arg name="gripper" default="robotiq_2f_85" />
<xacro:arg name="gripper" default="" />
<xacro:arg name="gripper_joint_name" default="finger_joint" />
<xacro:arg name="gripper_max_velocity" default="100.0" />
<xacro:arg name="gripper_max_force" default="100.0" />
Expand Down

0 comments on commit f70c5ee

Please sign in to comment.