-
Notifications
You must be signed in to change notification settings - Fork 0
/
spawn_kortex_robot.launch
103 lines (82 loc) · 5.05 KB
/
spawn_kortex_robot.launch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<launch>
<!-- Arguments -->
<!-- Start the GUIs -->
<arg name="start_gazebo" default="true"/>
<arg name="gazebo_gui" default ="true"/>
<arg name="start_rviz" default="true"/>
<!-- Initial position in Gazebo -->
<arg name="x0" default="0"/>
<arg name="y0" default="0"/>
<arg name="z0" default="0"/>
<!-- Arm and gripper type -->
<arg name="arm" default="gen3"/>
<arg name="dof" default="7" />
<arg name="vision" default="true"/>
<arg name="gripper" default="" />
<arg name="robot_name" default="glovebox_left"/>
<!-- Use trajectory controllers and MoveIt -->
<arg name="use_trajectory_controller" default="true"/>
<!-- Gazebo parameters -->
<arg name="use_sim_time" default="true"/>
<arg name="debug" default="false" />
<arg name="paused" default="$(arg use_trajectory_controller)"/>
<!-- Start Gazebo -->
<include file="$(find kortex_gazebo)/launch/start_gazebo.launch" if="$(arg start_gazebo)">
<arg name="gui" value="$(arg gazebo_gui)"/>
<arg name="use_sim_time" value="$(arg use_sim_time)"/>
<arg name="debug" value="$(arg debug)"/>
<arg name="paused" value="$(arg paused)"/>
</include>
<!-- Delay before homing the arm -->
<arg name="start_delay_seconds" default="60"/>
<!-- Adding the kinects -->
<group ns="kinect_back">
<node name="spawn_kinect_ros" pkg="gazebo_ros"
type="spawn_model" args="-file $(find kortex_gazebo)/models/kinect_ros/model_2.sdf
-sdf -x -0.647 -y 1.257 -z 1.8 -R 0 -P 0.6684 -Y -1.571 -model kinect_back -robot_namespace kinect_back" respawn="false" output="screen" />
</group>
<node pkg="tf" type="static_transform_publisher" name="kinect_back_broadcaster" args="-0.647 1.257 1.8 3.141 0 -2.23 world kinect_back/camera_link 100" />
<group ns="kinect_front">
<node name="spawn_kinect_ros" pkg="gazebo_ros"
type="spawn_model" args="-file $(find kortex_gazebo)/models/kinect_ros/model.sdf
-sdf -x -0.647 -y -0 -z 1.8 -R 0 -P 1.077 -Y 1.571 -model kinect_front -robot_namespace kinect_front" respawn="false" output="screen" />
</group>
<node pkg="tf" type="static_transform_publisher" name="kinect_front_broadcaster" args="-0.647 0 1.8 0 0 -2.63 world kinect_front/camera_link 100" />
<!-- Adding the Robots -->
<group ns="$(arg robot_name)">
<!-- Load the description for the robot -->
<!-- Without gripper -->
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find kortex_description)/robots/$(arg arm).xacro dof:=$(arg dof) vision:=$(arg vision) sim:=true"
if="$(eval not arg('gripper'))"/>
<!-- With gripper -->
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find kortex_description)/robots/$(arg arm)_$(arg gripper).xacro dof:=$(arg dof) vision:=$(arg vision) sim:=true"
unless="$(eval not arg('gripper'))"/>
<node name="spawn_glovebox" pkg="gazebo_ros"
type="spawn_model" args="-file $(find kortex_gazebo)/models/glovebox/model.sdf
-sdf -x 0 -y 0 -z 0 -R 0 -P 0.0 -Y 0 -model glovebox" respawn="false" output="screen" />
<node name="spawn_pedestal" pkg="gazebo_ros"
type="spawn_model" args="-file $(find kortex_gazebo)/models/pedestal/model.sdf
-sdf -x -1.25 -y .26 -z 0 -R 0 -P 0.0 -Y 0 -model pedestal" respawn="false" output="screen" />
<!-- Spawn the robot in Gazebo -->
<!-- Without gripper -->
<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" if="$(eval not arg('gripper'))"
args="-urdf -model $(arg robot_name) -file /tmp/smart_grasping_sandbox.urdf -package_to_model" >
<param name="dummy_to_generate_gazebo_urdf_file"
command="rosrun xacro xacro.py -o /tmp/smart_grasping_sandbox.urdf /tmp/smart_grasping_sandbox.gazebo.urdf" />
<param name="dummy_to_convert_package_to_model"
command="sed -i s@package://@model://@g /tmp/smart_grasping_sandbox.urdf" />
</node>
<!-- With gripper -->
<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" unless="$(eval not arg('gripper'))"
args="-urdf -model $(arg robot_name) -file /tmp/smart_grasping_sandbox.urdf -package_to_model" >
<param name="dummy_to_generate_gazebo_urdf_file"
command="rosrun xacro xacro.py -o /tmp/smart_grasping_sandbox.urdf /tmp/smart_grasping_sandbox_gripper.gazebo.urdf" />
<param name="dummy_to_convert_package_to_model"
command="sed -i s@package://@model://@g /tmp/smart_grasping_sandbox.urdf" />
</node>
<!-- Load controller configuration file from kortex_control package -->
<rosparam file="$(find kortex_control)/arms/$(arg arm)/$(arg dof)dof/config/joint_position_controllers.yaml" command="load"/>
<rosparam file="$(find kortex_control)/grippers/$(arg gripper)/config/gripper_action_controller_parameters.yaml" command="load"
unless="$(eval not arg('gripper'))"/>
</group>
</launch>