spawn_husky.launch 4.98 KB
Newer Older
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
<?xml version="1.0"?>
<!--
Software License Agreement (BSD)

\file      gazebo_description.launch
\authors   Paul Bovbel <pbovbel@clearpathrobotics.com
\copyright Copyright (c) 2015, Clearpath Robotics, Inc., All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that
the following conditions are met:
 * Redistributions of source code must retain the above copyright notice, this list of conditions and the
   following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
   following disclaimer in the documentation and/or other materials provided with the distribution.
 * Neither the name of Clearpath Robotics nor the names of its contributors may be used to endorse or promote
   products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WAR-
RANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, IN-
DIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<launch>

Paul Bovbel's avatar
Paul Bovbel committed
28
29
30
31
32
33
  <arg name="multimaster" default="false"/>

  <arg name="robot_namespace" default="/"/>

  <arg name="x" default="0.0"/>
  <arg name="y" default="0.0"/>
Dave Niewinski's avatar
Dave Niewinski committed
34
  <arg name="z" default="0.0"/>
Paul Bovbel's avatar
Paul Bovbel committed
35
36
37
38
39
40
41
42
  <arg name="yaw" default="0.0"/>

  <arg name="laser_enabled" default="$(optenv HUSKY_LMS1XX_ENABLED false)"/>
  <arg name="kinect_enabled" default="$(optenv HUSKY_UR5_ENABLED false)"/>
  <arg name="urdf_extras" default="$(optenv HUSKY_URDF_EXTRAS)"/>

  <group ns="$(arg robot_namespace)">

Paul Bovbel's avatar
Paul Bovbel committed
43
    <group if="$(arg multimaster)">
44
45
46
47
48
49
50
      <include file="$(find husky_description)/launch/description.launch" >
        <arg name="robot_namespace" value="$(arg robot_namespace)"/>
        <arg name="laser_enabled" default="$(arg laser_enabled)"/>
        <arg name="kinect_enabled" default="$(arg kinect_enabled)"/>
        <arg name="urdf_extras" default="$(arg urdf_extras)"/>
      </include>
        
Paul Bovbel's avatar
Paul Bovbel committed
51
52
53
54
55
56
57
58
59
60
      <include file="$(find multimaster_launch)/launch/multimaster_gazebo_robot.launch">
        <arg name="gazebo_interface" value="$(find husky_control)/config/gazebo_interface.yaml" />
        <arg name="robot_namespace" value="$(arg robot_namespace)"/>
      </include>

      <!-- For multimaster bringup, need to load the controller config -->
      <rosparam command="load" file="$(find husky_control)/config/control.yaml" />
    </group>

    <!-- For single master bringup, run robot control on the gazebo master -->
61
    <!-- Note that husky_description/description.launch is already included in husky_control/control.launch. -->
Paul Bovbel's avatar
Paul Bovbel committed
62
    <group unless="$(arg multimaster)">
Paul Bovbel's avatar
Paul Bovbel committed
63
64
      <include file="$(find husky_control)/launch/control.launch">
        <arg name="multimaster" value="$(arg multimaster)"/>
65
66
67
        <arg name="laser_enabled" value="$(arg laser_enabled)"/>
        <arg name="kinect_enabled" value="$(arg kinect_enabled)"/>
        <arg name="urdf_extras" value="$(arg urdf_extras)"/>
Paul Bovbel's avatar
Paul Bovbel committed
68
      </include>
Paul Bovbel's avatar
Paul Bovbel committed
69
70
71
72
73
74
75
76
    </group>

    <group if="$(arg kinect_enabled)">

      <!-- Include poincloud_to_laserscan if simulated Kinect is attached -->
      <node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pointcloud_to_laserscan" output="screen">

          <remap from="cloud_in" to="camera/depth/points"/>
77
          <remap from="scan" to="scan"/>
Paul Bovbel's avatar
Paul Bovbel committed
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
104
105
          <rosparam>
              target_frame: base_link # Leave empty to output scan in the pointcloud frame
              tolerance: 1.0
              min_height: 0.05
              max_height: 1.0

              angle_min: -0.52 # -30.0*M_PI/180.0
              angle_max: 0.52 # 30.0*M_PI/180.0
              angle_increment: 0.005 # M_PI/360.0
              scan_time: 0.3333
              range_min: 0.45
              range_max: 4.0
              use_inf: true

              # Concurrency level, affects number of pointclouds queued for processing and number of threads used
              # 0 : Detect number of cores
              # 1 : Single threaded
              # 2->inf : Parallelism level
              concurrency_level: 1
          </rosparam>
      </node>

    </group>

    <!-- Spawn robot in gazebo -->
    <node name="spawn_husky_model" pkg="gazebo_ros" type="spawn_model"
        args="-x $(arg x)
              -y $(arg y)
Dave Niewinski's avatar
Dave Niewinski committed
106
              -z $(arg z)
Paul Bovbel's avatar
Paul Bovbel committed
107
108
109
110
111
              -Y $(arg yaw)
              -unpause
              -urdf
              -param robot_description
              -model $(arg robot_namespace)" />
112
113
114
115

  </group>

</launch>