-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify move_group.launch.py with load_gripper args in launch. Need to…
… add rviz.launch.py as Husarion template launch file.
- Loading branch information
Showing
4 changed files
with
214 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from launch import LaunchDescription | ||
from launch.actions import IncludeLaunchDescription, DeclareLaunchArgument | ||
from launch.substitutions import ( | ||
PathJoinSubstitution, | ||
LaunchConfiguration, | ||
) | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
|
||
from launch_ros.actions import Node, SetParameter | ||
from launch_ros.substitutions import FindPackageShare | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
|
||
|
||
def generate_launch_description(): | ||
#1 | ||
load_gripper = LaunchConfiguration("load_gripper") | ||
declare_load_gripper_arg = DeclareLaunchArgument( | ||
"load_gripper", | ||
default_value="False", | ||
description="Use Franka Gripper as end-effector if True", | ||
) | ||
#2 | ||
robot_ip = LaunchConfiguration("robot_ip") | ||
declare_robot_ip_arg = DeclareLaunchArgument( | ||
"robot_ip", | ||
default_value="dont-care", | ||
description=( | ||
"Set the robot_ip to 'dont-care' for using the simulation." | ||
), | ||
) | ||
# 3 | ||
use_sim = LaunchConfiguration("use_sim") | ||
declare_use_sim_arg = DeclareLaunchArgument( | ||
"use_sim", | ||
default_value="False", | ||
description="Whether simulation is used", | ||
) | ||
|
||
#4 | ||
use_fake_hardware = LaunchConfiguration("use_fake_hardware") | ||
declare_use_fake_hardware_arg = DeclareLaunchArgument( | ||
"use_fake_hardware", | ||
default_value="False", | ||
description="Wheter to use fake hardware", | ||
) | ||
#5 | ||
fake_sensor_commands = LaunchConfiguration("fake_sensor_commands") | ||
declare_fake_sensor_commands_arg = DeclareLaunchArgument( | ||
"fake_sensor_commands", | ||
default_value="False", | ||
description="Wheter to use fake sensor commands", | ||
) | ||
|
||
|
||
# controller_launch = IncludeLaunchDescription( | ||
# PythonLaunchDescriptionSource( | ||
# PathJoinSubstitution( | ||
# [ | ||
# get_package_share_directory("rosbot_xl_manipulation_controller"), | ||
# "launch", | ||
# "controller.launch.py", | ||
# ] | ||
# ) | ||
# ), | ||
# launch_arguments={ | ||
# "manipulator_usb_port": manipulator_usb_port, | ||
# "manipulator_baud_rate": manipulator_baud_rate, | ||
# "joint1_limit_min": joint1_limit_min, | ||
# "joint1_limit_max": joint1_limit_max, | ||
# "antenna_rotation_angle": antenna_rotation_angle, | ||
# "mecanum": mecanum, | ||
# "use_sim": use_sim, | ||
# }.items(), | ||
# ) | ||
|
||
moveit_launch = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
PathJoinSubstitution( | ||
[ | ||
get_package_share_directory("my_panda_moveit_config"), | ||
"launch", | ||
"move_group.launch.py", | ||
] | ||
) | ||
), | ||
launch_arguments={ | ||
"load_gripper": load_gripper, | ||
"robot_ip": robot_ip, | ||
"use_fake_hardware": use_fake_hardware, | ||
"fake_sensor_commands": fake_sensor_commands, | ||
"use_sim": use_sim, | ||
}.items(), | ||
) | ||
|
||
|
||
actions = [ | ||
declare_load_gripper_arg, | ||
declare_robot_ip_arg, | ||
declare_use_sim_arg, | ||
declare_use_fake_hardware_arg, | ||
declare_fake_sensor_commands_arg, | ||
SetParameter(name="use_sim_time", value=use_sim), | ||
# controller_launch, | ||
moveit_launch | ||
] | ||
|
||
return LaunchDescription(actions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters