Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I found this method and is working perfectly.

double x,y,z;
gazebo::math::Pose pose;     
pose = this->model->GetWorldPose();
math::Vector3 v(0, 0, 0);
v = pose.pos;
x = v.x; // x coordinate
y = v.y; // y coordinate
z = v.z; // z coordinate