/
simulation.launch
68 lines (53 loc) · 3.01 KB
/
simulation.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
<?xml version="1.0" ?>
<launch>
<!-- LAUNCH INTERFACE -->
<!-- The robot name is required for gazebo to spawn a model. -->
<arg name="robot_name" default="single_lwr_robot"/>
<!-- The recommended way of specifying the URDF file is to pass it in
directly. -->
<arg name="robot_path" default="$(find single_lwr_robot)/robot"/>
<arg name="robot_urdf_file" default="$(arg robot_path)/$(arg robot_name).urdf.xacro" />
<arg name="controllers" default="joint_controllers"/>
<arg name="t1_limits" default="false"/>
<arg name="rviz_config" default="$(find lwr_launch)/launch/rviz/rviz_config.rviz"/>
<arg name="rviz_bringup" default="true"/> <!--If false, do not launch rviz-->
<arg name="hw_interface_file" default="$(find single_lwr_robot)/config/hw_interface.yaml"/>
<arg name="controller_config_file" default="$(find single_lwr_robot)/config/controllers.yaml"/>
<arg name="gazebo_world_file" default="$(find single_lwr_robot)/worlds/simple_environment.world"/>
<arg name="t1_limits_file" default="$(find single_lwr_robot)/config/t1_joint_limits.yaml"/>
<arg name="GAZEBO_GUI" default="false"/>
<!-- ROBOT -->
<group ns="lwr">
<param name="robot_description" command="$(find xacro)/xacro.py $(arg robot_urdf_file)"/>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>
</group>
<!-- GAZEBO -->
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param /lwr/robot_description -urdf -model $(arg robot_name)" respawn="false" output="screen" />
<!-- enable/disable gui at will, the rviz listens to the simulation -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(arg gazebo_world_file)"/>
<arg name="paused" value="false"/>
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="$(arg GAZEBO_GUI)"/>
<arg name="headless" value="false"/>
<arg name="debug" value="false"/>
</include>
<!-- Load updated joint limits (override information from single_lwr_moveit) to respect T1 mode limits -->
<group if="$(arg t1_limits)" ns="robot_description_planning">
<rosparam command="load" file="$(arg t1_limits_file)"/>
</group>
<!-- load robotHW configurations to rosparam server -->
<rosparam command="load" file="$(arg hw_interface_file)"/>
<!-- load all controller configurations to rosparam server -->
<rosparam command="load" file="$(arg controller_config_file)"/>
<!-- real robot and controllers -->
<group ns="lwr">
<!-- spawn only desired controllers in current namespace -->
<node name="controller_spawner_js" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="kuka_joint_state_controller"/>
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="$(arg controllers)"/>
</group>
<!-- LAUNCH RVIZ -->
<node name="lwr_rviz" pkg="rviz" type="rviz" respawn="false" args="-d $(arg rviz_config)"
output="screen"
if="$(arg rviz_bringup)"/>
</launch>