Skip to content

Commit

Permalink
Added Declare Lunach Argument to define the use of the gripper.
Browse files Browse the repository at this point in the history
  • Loading branch information
SteMuc committed Apr 22, 2024
1 parent 463c2bd commit 87aa42b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion my_panda_description/launch/description_launch.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def generate_launch_description():
robot_description = Command(
[FindExecutable(name='xacro'), ' ', franka_xacro_file, ' hand:=', load_gripper])


return LaunchDescription([
DeclareLaunchArgument(
load_gripper_parameter_name,
Expand Down
18 changes: 13 additions & 5 deletions my_panda_viz/launch/view_model.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@
from launch_ros.substitutions import FindPackageShare
from ament_index_python.packages import get_package_share_directory


def generate_launch_description():


# Declare the launch argument for load_gripper_value
load_gripper_value_launch_arg = DeclareLaunchArgument(
'load_gripper_value',
default_value='true'
)

rviz_file = os.path.join(get_package_share_directory('my_panda_viz'), 'rviz',
'visualize_franka.rviz')

Expand All @@ -28,16 +33,19 @@ def generate_launch_description():
arguments=['-d', rviz_file],
output='screen'
)

launch_franka_description = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory(
'my_panda_description'), 'launch/description_launch.launch.py')
)
),
# launch_arguments={'load_gripper': 'false'}.items()

# Pass the launch argument and its value
launch_arguments={'load_gripper': LaunchConfiguration('load_gripper_value')}.items()
)

return LaunchDescription(
[
[ load_gripper_value_launch_arg,
node_joint_state_publisher_gui,
node_rviz,
launch_franka_description,
Expand Down

0 comments on commit 87aa42b

Please sign in to comment.