0
$\begingroup$

Gazebo Answers logo

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


Originally posted by Angelos on Gazebo Answers with karma: 17 on 2017-06-15

Post score: 1


Original comments

Comment by Lays on 2019-08-18:
good question

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

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.


Originally posted by sloretz with karma: 558 on 2017-06-15

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Angelos on 2017-06-15:
Thank you, I'm going to study your links and understand the concept.

Comment by Lays on 2019-08-18:
thanks very much

$\endgroup$