Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I ended up using

 physics::ModelPtr model = this->world->ModelByName(model_name);
 physics::LinkPtr link = model->GetLink(link_name);
 ignition::math::Pose3d pose = link->WorldCoGPose();
 ignition::math::Vector3<double> position = pose.Pos();
 double pos[3] = {position.X(), position.Y(), position.Z() };

First, I forgot to include

 #include <gazebo/physics/physics.hh>

So that's why nothing seemed to work.

I couldn't find the WorldPose() method in Model.hh file on my machine, so I ended up using

 physics::ModelPtr model = this->world->ModelByName(model_name);
 physics::LinkPtr link = model->GetLink(link_name);
 ignition::math::Pose3d pose = link->WorldCoGPose();
 ignition::math::Vector3<double> position = pose.Pos();
 double pos[3] = {position.X(), position.Y(), position.Z() };

First, I forgot to include

 #include <gazebo/physics/physics.hh>

So that's why nothing seemed to work.