Skip to content

PTSSpace/MANIsimulation

Repository files navigation

MANIsimulation

The gazebo simulation of the MANI rover. The simulated rover can be controlled via the respective ROS topics. It can also be controlled via a joint stick if used in conjunction with the MANIros package.

This package requires familiarity with ROS and Gazebo. Please also check whether your graphic card is compatible with Gazebo.

Table of Contents

Overview

This package simulates the MANI rover in Gazebo. Gazebo is a 3D open-source robotics simulator. To control the simulated rover, you can use ROS. ROS, or Robotic Operating System, is "an open-source, meta-operating system for your robot. It provides the services you would expect from an operating system (...). It also provides tools and libraries for obtaining, building, writing, and running code across multiple computers." (ROS Introduction, http://wiki.ros.org/ROS/Introduction, Aug 16th 2019). To move the simulated rover (e.g. to move its wheels / steering angles / camera head), you can publish to so-called ROS topics (see section "ROS Overview"). The Gazebo simulator will then take the published information from ROS and move the simulated rover accordingly. The simulated rover's camera also publishes to the respective ROS topics, and you can get the camera's output by subscribing to these ROS topics (see section "MANI camera").

Getting Started

The following sections will guide you through the installation of the MANIsimulation package and its dependencies.

Prerequisites

  1. Install ROS kinetic: http://wiki.ros.org/kinetic/Installation

The MANIsimulation package requires ROS Kinetic Kame. Desktop-Full install is recommended for this package.

  1. If you didn't install Gazebo in step 1 (Gazebo7 is included in the ROS Kinetic Kame Desktop-Full install), install Gazebo now. You can test whether Gazebo is properly installed by typing $ gazebo. An empty gazebo world should be launched.
$ curl -sSL http://get.gazebosim.org | sh 
  1. Install ros_control:
$ sudo apt-get install ros-kinetic-ros-control ros-kinetic-ros-controllers
  1. Install gazebo_ros_pkgs:
$ sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control
  1. Install Catkin and set up a Catkin Workspace:

    • install catkin
    $ sudo apt-get install ros-kinetic-catkin
    
    • create and build a catkin workspace
    $ source /opt/ros/kinetic/setup.bash
    $ mkdir -p ~/catkin_ws/src
    $ cd ~/catkin_ws/
    $ catkin_make
    
    • source your new setup.*sh file:
    $ source devel/setup.bash
    

If you are not very familiar with catkin and/or would not be able to explain the steps taken above: http://wiki.ros.org/catkin/Tutorials

Installing

It is assumed that you have installed catkin and sourced your environment. It is also assumed that you already have a catkin workspace called catkin_ws.

  1. Clone MANIsimulation into your catkin workspace.
$ cd ~/catkin_ws/src
$ git clone https://github.com/PTScientists/MANIsimulation.git
  1. Build your catkin workspace.
$ cd ~/catkin_ws
$ catkin_make
  1. Launch the simulation.
$ roslaunch manisim gazebo.launch

You should see a MANI rover in an empty gazebo world. Have fun!

If you get an error, check whether your graphic card is compatible with Gazebo.

alt text

Spawning MANI in a (custom) world

It is assumed that you have sourced your environment. It is also assumed that you have a catkin workspace called catkin_ws.

Spawn MANI in an empty world

$ roslaunch manisim gazebo.launch

Spawn MANI in a custom world

  1. Save a .world file in ~/catkin_ws/src/MANIsimulation/manisim_gazebo/worlds. The manisim package comes with empty.world and moon.world.
  2. Launch MANIsimulation with the world command line argument. For example, if you want to launch MANI in moon.world, type:

$ roslaunch manisim gazebo.launch world:=moon

A safe spawning spot on moon.world is (x,y,z) = (0, 20, 0).

Please be aware that when launching MANI in a custom world file, it needs to be spawned in a 'safe' spot to ensure functionality of the simulation. For example, if you were to launch MANI on a steep slope, MANI might start sliding and behave unpredictably right after being spawned. See the section below on how to set a spawning spot (position).

Set the position where MANI is spawned at

You can define the x-, y- and z-position MANI is spawned at when launching Gazebo. The default values are x=0, y=0 and z=0.2175. (If z was 0, MANI would be placed slightly in the ground of empty.world. This is due to the position of MANI's own origin.)

You can set each position coordinate individually. For example, to set x=5, type:

$ roslaunch manisim gazebo.launch x:=5

You can also set them all together. The order doesn't matter here:

$ roslaunch manisim gazebo.launch y:=3.2 x:=5 world:=empty z:=1

Gazebo Integration

Gazebo Overview

Gazebo is a 3D robotics simulator. It is open-source. You can find useful tutorials here. A good starting point for creating robot models in Gazebo is here.

Before using Gazebo, check out its system requirements here.

A WORD ABOUT GRAPHIC CARDS

There is a typical error called BadDrawable which is due to incompatible graphic cards/drivers. Often, this error occurs only sometimes during launch, and otherwise Gazebo launches up fine. If you get this error, please check whether your drivers are installed properly. You can also try to launch the MANIsimulation with roslaunch multiple times to see if it eventually launches up successfully. Feel free to also check out this post and this post regarding this issue.

MANI in Gazebo

MANI consists of the following links:

  • chassis
  • camera_pan, camera_tilt, camera_kinect
  • steering_angle_frontleft, steering_angle_rearleft, steering_angle_rearright, steering_angle_frontright
  • wheel_frontleft, wheel_rearleft, wheel_rearright, wheel_frontright

chassis is the root link. The other links are all connected to the root/to each other via joints. The ROS Integration section describes how to control these joints via ros topics.

MANI's links and joints are labelled based on their positions in respect to the robot itself. The positions are as follows:

alt text

MANI Inertia

You can change MANI's inertia moments if needed. Open the file MANIsimulation/manisim_description/urdf/manisim.urdf.xacro and proceed as described here in section "Filling in the tags in URDF or SDF". manisim.urdf.xacro is a URDF based file.

ROS Integration (Robotic Operating System)

ROS Overview

Wikipedia's Definition July 24th 2019, 15:57 CET

Robot Operating System (ROS or ros) is robotics middleware (i.e. collection of software frameworks for robot software development). Although ROS is not an operating system, it provides services designed for a heterogeneous computer cluster such as hardware abstraction, low-level device control, implementation of commonly used functionality, message-passing between processes, and package management.

To get started with ROS, you can find useful tutorials here.

MANIsimulation and ROS

move MANI

You can move MANI in Gazebo by publishing to the following ROS topics. They expect a std_msgs/Float64 message.

  • Wheels (Velocity in m/s)
    • front left: /manisim/drive_fl_vel/command
    • rear left: /manisim/drive_rl_vel/command
    • rear right: /manisim/drive_rr_vel/command
    • front right: /manisim/drive_fr_vel/command
  • Steering Angles (Orientation in rad)
    • front left: /manisim/steer_fl_ort/command
    • rear left: /manisim/steer_rl_ort/command
    • rear right: /manisim/steer_rr_ort/command
    • front right: /manisim/steer_fr_ort/command
  • Camera Head (Orientation in rad)
    • camera pan: /manisim/camera_pan_ort/command
    • camera tilt: /manisim/camera_tilt_ort/command

MANI joint data

If you want to know the current position, velocity or effort of any of MANI's joints, subscribe to the /manisim/joint_states topic. For information on the joint states ROS message, look here. You can read up on joint_state_publisher here.

MANI camera

The currently implemented depth camera for the MANI gazebo model is based on the kinect camera setup described in this tutorial. This tutorial also explains how to visualize the generated point cloud in Rviz.

MANI's camera publishes to the following topics:

  • /camera/depth/camera_info
  • /camera/depth/image_raw
  • /camera/depth/image_raw/compressed
  • /camera/depth/image_raw/compressed/parameter_descriptions
  • /camera/depth/image_raw/compressed/parameter_updates
  • /camera/depth/image_raw/compressedDepth
  • /camera/depth/image_raw/compressedDepth/parameter_descriptions
  • /camera/depth/image_raw/compressedDepth/parameter_updates
  • /camera/depth/image_raw/theora
  • /camera/depth/image_raw/theora/parameter_descriptions
  • /camera/depth/image_raw/theora/parameter_updates
  • /camera/depth/points
  • /camera_ir/depth/camera_info
  • /camera_ir/parameter_descriptions
  • /camera_ir/parameter_updates

Built With

  • Gazebo - Gazebo 3D Robotics Simulator
  • ROS - Robotic Operating System

Authors

See also the list of contributors who participated in this project.

License

At the time of writing this README, the license hasn't been decided upon yet. Please refer to the PTScientists Git Repo for more information.

Acknowledgments

About

The gazebo simulation of the MANI rover.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages