Gazebo | Ignition | Community
Ask Your Question

mutable_gravity in tutorial

asked 2017-06-15 05:21:47 -0500

Angelos gravatar image


As you guess, I have started to study the tutorials for the gazebo plugins. I was doing the "Programmatic World Control" (

and in the line that change the gravity:

// Change gravity
          ignition::math::Vector3d(0.01, 0, 0.1));

It uses physicsMsg.mutable_gravity() I searched the API for the definition of mutable_gravity() but I couldn't find something. As I try to understand what is going on I need to know where I can find these definitions. Could anybody point me the direction?

Kind regards, Angelos

edit retag flag offensive close merge delete


good question

Lays gravatar imageLays ( 2019-08-18 08:38:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-06-15 09:10:59 -0500

sloretz gravatar image

gazebo::msgs::Physics is generated using protobuf. The method mutable_gravity() is automatically generated from the field optional Vector3d gravity in the protobuf file. Here is an overview of using protubuf in C++. This link describes the C++ code generated from protobuf messages. And this link is the protobuf definition in gazebo 8 for the mesage you're using.

edit flag offensive delete link more


Thank you, I'm going to study your links and understand the concept.

Angelos gravatar imageAngelos ( 2017-06-15 10:22:14 -0500 )edit

thanks very much

Lays gravatar imageLays ( 2019-08-18 21:44:58 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-06-15 04:18:54 -0500

Seen: 446 times

Last updated: Jun 15 '17