Additional Simulation Worlds
================================
In addtion to the default ``jackal_world.launch`` file, ``jackal_gazebo`` contains three additional launch files:
* ``empty_world.launch``, which spawns Jackal in a featureless, infinite plane;
* ``hrtac_world.launch``, which is a scenario from the HRTAC_ competition; and
* ``spawn_jackal.launch``, which is intended to be included in any custom world to add a Jackal simulation to it.
.. _HRTAC: https://github.com/phir2-lab/hratc2017_framework
.. image:: images/jackal_hrtac_world.png
:alt: Jackal in the HRTAC world
To add a Jackal to any of your own worlds, simply include the ``spawn_jackal.launch`` file in your own world's launch:
.. code-block:: xml
Finally, Clearpath provides an additional suite of simulation environments that can be downloaded separately and used
with Jackal, as described below.
Clearpath Gazebo Worlds
------------------------
The Clearpath Gazebo Worlds collection contains 4 different simulation worlds, representative of different
environments our robots are designed to operate in:
* Inspection World: a hilly outdoor world with water and a cave
* Agriculture World: a flat outdoor world with a barn, fences, and solar farm
* Office World: a flat indoor world with enclosed rooms and furniture
* Construction World: office world, under construction with small piles of debris and partial walls
Jackal is supported in all four environments.
Installation
---------------
To download the Clearpath Gazebo Worlds, clone the repository from github into the same workspace as your Jackal:
.. code-block:: bash
cd ~/catkin_ws/src
git clone https://github.com/clearpathrobotics/cpr_gazebo.git
Before you can build the package, make sure to install dependencies. Because Clearpath Gazebo Worlds depends on
all of our robots' simulation packages, and some of these are currently only available as source code, installing
dependencies with ``rosdep install --from-paths [...]`` will likely fail.
All four simulation environments need the ``gazebo_ros`` package. The Inspection World also needs the ``uuv_gazebo_worlds``
package, which can be installed by running
.. code-block:: bash
sudo apt-get install ros-$ROS_DISTRO-uuv-gazebo-worlds
Once the dependencies are installed, you can build the package:
.. code-block:: bash
cd ~/catkin_ws
catkin_make
source devel/setup.bash
Running the Inspection Simulation
------------------------------------
Inspection World is a hilly, outdoor world that includes a water feature, bridge, pipeline, small cave/mine,
and a small solar farm. It is intended to simulate a variety of missions, including pipeline inspection,
cave/underground navigation, and localization on non-planar terrain.
.. image:: images/jackal_inspection_bridge.png
:alt: Jackal driving over the bridge in the inspection world
To launch the inspection simulation, run
.. code-block:: bash
roslaunch cpr_inspection_gazebo inspection_world.launch platform:=jackal
To customize Jackal's payload, for example to add additional sensors, see :ref:`customizepayload`.
Once the simulation is running you can use rviz and other tools as described in :doc:`simulation` and :doc:`navigation`
to control and monitor the robot. For example, below we can see Jackal exploring the cave:
.. image:: images/jackal_inspection_cave.png
:alt: Jackal exploring the cave
and Jackal's perception of the inside of the cave as a 3D pointcloud in rviz:
.. image:: images/jackal_rviz_inspection_cave.png
:alt: Jackal in rviz exploring the cave
You can see the complete layout of the Inspection World below:
.. image:: images/inspection_world.png
:alt: Inspection World
Running the Agriculture Simulation
------------------------------------
Agriculture World is a flat, mixed indoor/outdoor world that include a large barn, open fields surrounded by fences,
and a large solar farm. It is intended to simulate missions such as solar panel inspection and area coverage.
.. image:: images/jackal_agriculture_world.png
:alt: Jackal in the agriculture world
To launch the agriculture simulation, run
.. code-block:: bash
roslaunch cpr_agriculture_gazebo agriculture_world.launch platform:=jackal
To customize Jackal's payload, for example to add additional sensors, see :ref:`customizepayload`.
Once the simulation is running you can use rviz and other tools as described in :doc:`simulation` and :doc:`navigation`
to control and monitor the robot.
.. image:: images/agriculture_world.png
:alt: Agriculture World
Running the Office Simulation
--------------------------------
Office World is a small indoor environment representing a commercial office space. It features several large, open
areas with furniture, as well as a narrow hallway with smaller offices and meeting rooms. It is intended to simulate
missions in commercial spaces, such as facilitating deliveries, security monitoring, and inspecting equipment.
.. image:: images/jackal_office_world.png
:alt: Jackal in the Office World
To launch Office World with a Jackal, run the following command:
.. code-block:: bash
roslaunch cpr_office_gazebo office_world.launch platform:=jackal
To customize Jackal's payload, for example to add additional sensors, see :ref:`customizepayload`.
Once the simulation is running you can use rviz and other tools as described in :doc:`simulation` and :doc:`navigation`
to control and monitor the robot. For example, below we can see the ``gmapping_demo`` from ``jackal_navigation`` being
used to build a map of the office world:
.. image:: images/jackal_rviz_office_gmap.png
:alt: Jackal building a map of the office with gmapping
You can see the complete layout of the office world below:
.. image:: images/office_world.png
:alt: Office World
Running the Construction Simulation
--------------------------------------
Construction World is the same basic layout as Office World, representing the same office space under construction/rennovation.
It is an indoor environment with small hills of debris/rubble, partial walls, and piles of construction supplies. It
is designed to simulate missions in any sort of construction site.
.. image:: images/jackal_construction_world.png
:alt: Jackal in the Construction World
To launch Construction World with a Jackal, run the following command:
.. code-block:: bash
roslaunch cpr_office_gazebo office_construction_world.launch platform:=jackal
To customize Jackal's payload, for example to add additional sensors, see :ref:`customizepayload`.
Once the simulation is running you can use rviz and other tools as described in :doc:`simulation` and :doc:`navigation`
to control and monitor the robot.
You can see the complete layout of the office below:
.. image:: images/construction_world.png
:alt: The layout of Construction World
.. _customizepayload:
Customizing Jackal's Payload
-------------------------------
To customize Jackal's payload you must use the environment variables described in :doc:`description`. For example,
to equip Jackal with a Sick LMS-1xx lidar, as pictured in several of the images above, run
.. code-block:: bash
export JACKAL_LASER=1
before launching the simulation world.
You can also add additional sensors by creating a customized URDF and setting the ``JACKAL_URDF_EXTRAS`` environment
variable to point to it.
For example, let's suppose you want to equip Jackal with an Intel RealSense D435 camera. First, install the ``realsense2_camera``
and ``realsense2_description`` packages, along with the gazebo plugins:
.. code-block:: bash
sudo apt-get install ros-$ROS_DISTRO-realsense2-camera ros-$ROS_DISTRO-realsense2-description ros-$ROS_DISTRO-gazebo-plugins
Then create your customized URDF file, for example ``$HOME/Desktop/realsense.urdf.xacro``. Put the following in it:
.. code-block:: xml
true301.51843516666666671.0122901111111111640480RGB80.0150.00.2true30realsensecolor/image_rawcolor/camera_infodepth/image_rect_rawdepth/camera_infodepth/color/pointsfront_realsense_gazebo0.1058.00.000000010.000000010.000000010.000000010.0000000100000
This file defines the additional links for adding a RealSense camera to the robot, as well as configuring the ``openni_kinect``
plugin for Gazebo to simulate data from a depth camera. The camera itself will be connected to the Jackal's ``front_mount``
link, offset 5cm towards the front of the robot.
Now, set the ``JACKAL_URDF_EXTRAS`` environment variable and try viewing the Jackal model:
.. code-block:: bash
export JACKAL_URDF_EXTRAS=$HOME/Desktop/realsense.urdf.xacro
roslaunch jackal_viz view_model.launch
You should see the Jackal model in rviz, with the RealSense camera mounted to it:
.. image:: images/jackal_realsense.png
:alt: Jackal with a RealSense D435 connected to it
To launch the customized Jackal in any of the new simulation environments, similarly run:
.. code-block:: bash
export JACKAL_URDF_EXTRAS=$HOME/Desktop/realsense.urdf.xacro
roslaunch cpr_office_gazebo office_world.launch platform:=jackal
You should see Jackal spawn in the office world with the RealSense camera:
.. image:: images/jackal_office_realsense.png
You can view the sensor data from the RealSense camera by running
.. code-block:: bash
roslaunch jackal_viz view_robot.launch
and adding the camera & pointcloud from the ``/realsense/color/image_raw`` and ``/realsense/depth/color/points`` topics:
.. image:: images/jackal_rviz_realsense.png
:alt: Jackal with a RealSense in rviz showing pointcloud and RGB topics