Home | Tutorials | Wiki | Issues
Ask Your Question
1

mutable_gravity in tutorial

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

Angelos gravatar image

Hello!

As you guess, I have started to study the tutorials for the gazebo plugins. I was doing the "Programmatic World Control" (http://gazebosim.org/tutorials?tut=plugins_world_properties&cat=write_plugin)

and in the line that change the gravity:

// Change gravity
      msgs::Set(physicsMsg.mutable_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

Comments

good question

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

1 Answer

Sort by ยป oldest newest most voted
1

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

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

Comments

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

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

thanks very much

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

Question Tools

1 follower

Stats

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

Seen: 421 times

Last updated: Jun 15 '17