How can i get actor's pose in gazebo Garden

asked 2023-04-13 17:12:38 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello i have made a simulation in Gazebo Garden with actors moving. I would like to use the world pose of the humans. I tried making a plug in, similar to https://github.com/gazebosim/gz-sim/tree/gz-sim7/examples/plugin/command_actor but i just want to read world pose while the actor will be moving through script. I did something like the in PreUpdate function auto actorComp = _ecm.Component<components::Actor>(this->entity); auto pose = worldPose(this->entity, _ecm); std::cout<<pose<<std::endl; where in Configure function: this->entity = _entity; . However the pose is wrong and it just 6 0s. I also tried to enable WorldPose component like this: enableComponent<gz::sim::components::WorldPose>(_ecm, this->entity, true); but i can't access actor's pose.

Anyone knows what am i missing?

edit retag flag offensive close merge delete