Plugin to find pose of a robot
Hi, I'm new to Gazebo and ROS.
I'm trying to find a plugin that I can hook to the sdf file of my robot which will publish its pose in (x,y,z) format. I noticed that there is already a topic being published to called "/gazebo/model_states" which contains the pose of every model in the world. I'm not sure if there's a way to manipulate this to get the pose from one singular model.
Thanks in advance for any help.
To clarify, you'd like the pose to be published over a ROS topic, or a Gazebo topic?
A ROS topic would be best, but I think (not sure) either would work.
blastpower5, i just started using the plugins and i can tell that you CAN do the task using both ROS and Gazebo communications. For ROS, you will have to link against the proper libraries. Using Gazebo, it's like the examples. Using a ROS topic would require to link against and include ROS, coding a publisher and publish the information. The plugins work like a normal executable. Since the update function receives a pointer to the model, it's always updated.
// Continuation : You can then make a forever loop, with a sleep inside, and publish your information.
If you go to the gazebo folder, under examples/plugin/model_move you can see the structure of a plugin, its a normal c++ program. The Load() function instantiates everything, it's like a constructor. From here, you can do everything, knowing that on startup of the model, the Load function is going to be ran. You also receive this pointer [ ::Load(physics::ModelPtr _parent] which is the pointer to the model, where every data about the model can be read, set and managed, like pose, velocity etc.