[Documentation] [TitleIndex] [WordIndex

/!\ This tutorial was written for C-Turtle

(!) Please ask about problems and questions regarding this tutorial on answers.gazebosim.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Gazebo ROS API for C-Turtle

Description: Gazebo ROS API for C-Turtle. Manipulate and interact with simulation and simulated objects.

Tutorial Level: BEGINNER

Next Tutorial: Simulate a Spinning Top in Gazebo

Users are highly discouraged from using the documentation and tutorials for Gazebo on this page. Gazebo is now a stand alone project at gazebosim.org. See documentation there, thanks!

Tutorial Introduction

As of C Turtle release, Gazebo provides a set of ROS API's that allows users to modify and get information about various aspects of the simulated world. In the following sections, we will demonstrate some of the utilities for manipulating the simulation world and objects. The complete list of ROS messages and services for gazebo can be found here.

Terminologies

In the following context, the pose and twist of a rigid body object is referred to as its state. An object also has intrinsic properties, such as mass and friction coefficients. In Gazebo, a Body refers to a rigid body, synonymous to Link in the urdf context. A Gazebo Model is a conglomeration of Bodies connected by Joints.

Start Up Simulator

For the rest of the tutorial, we'll assume the empty world is running.

Gazebo ROS Parameters, Services and Topics

Spawn and Delete Models in Simulation

Spawn Model

Models in gazebo can be spawned and deleted dynamically using the services gazebo/spawn_model and gazebo/delete_model. A helper script spawn_model is provided for calling the model spawning services offered by gazebo ros node. Here's an example on how to use the script.

Delete Model

Set and Get Model Pose and Twist in Simulation via Service

Retrieving Simulation World and Object Properties

Apply Efforts to Joints in Simulation

Pausing and Unpausing Physics

Set Model Pose and Twist in Simulation via Topics

  1. this is accomplished by the setting the value of the XML tag <turnGravityOff/> to true. The flag simply tells the physic engine not to enforce gravitational force on the perspective body. (1)

  2. Gazebo world frame is an artificial inertial frame in the gazebo world (2)


2020-02-22 13:15