Gazebo | Ignition | Community
Ask Your Question

getCoG() returns (0, 0, 0)

asked 2015-06-07 02:29:42 -0500

mugenHexapod gravatar image


I am trying to find center of mass by doing the following

std::cout << this->model->GetLink("leg1")->GetInertial()->GetCoG() << std::endl;

but I only get 0,0,0. Is there any reason why it's happening? Maybe the reference frame is the link it self, instead of the world frame?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-06-07 11:27:14 -0500

chapulina gravatar image

Correct, the center of mass is expressed with respect to the link, and the link pose with respect to the parent model.

edit flag offensive delete link more


what is the suggested way to find the CoG with respect to the world frame?

mugenHexapod gravatar imagemugenHexapod ( 2015-06-07 17:16:26 -0500 )edit

is this->model->GetLink("leg1")->GetWorldCoGPose().pos the right way for getting the CoG wrt world frame?

mugenHexapod gravatar imagemugenHexapod ( 2015-06-07 17:28:31 -0500 )edit

It looks right.

chapulina gravatar imagechapulina ( 2015-06-07 18:52:19 -0500 )edit

thank you!

mugenHexapod gravatar imagemugenHexapod ( 2015-06-07 19:01:58 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2015-06-07 02:29:42 -0500

Seen: 217 times

Last updated: Jun 07 '15