ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to get robot position in gazebo?

asked 2016-09-28 02:46:26 -0500

chenlee gravatar image

I want get the robot position(something like the coordinate x,y,z) , I know that hector_gazebo_plugins can do this,but I don't know how to use the API,did something more simple to get the robot position in gazebo?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-11-13 07:29:39 -0500

The answer here applies to your use case, if you are interested in getting the robot pose as a ROS message.

edit flag offensive delete link more

answered 2016-11-13 04:07:16 -0500

Ajith kumar gravatar image

Simple. Use GetPose utility. For eg:

gazebo::math::Pose pose = this->model->gazebo::physics::ModelState::GetPose();

You can convert it into your preferred coordinate system through simple transformation.

edit flag offensive delete link more



Can you post an example here? I am a new guy and don't know how to finish this. Thanks!

littleghost gravatar image littleghost  ( 2018-06-07 05:19:45 -0500 )edit

Question Tools



Asked: 2016-09-28 02:46:26 -0500

Seen: 8,247 times

Last updated: Nov 13 '16