Home | Tutorials | Wiki | Issues
Ask Your Question

Getting the coordinates of a point using the mouse

asked 2017-04-08 17:52:35 -0500

andrestoga gravatar image


Is there a way to get the coordinates of a point (x and y coordinates) using the mouse on the gazebo client?


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-04-09 10:19:47 -0500

chapulina gravatar image

Yes, you can get it with a GUI plugin.

Here's an example which gets the mouse position on mouse move.

It uses gui::MouseEventHandler::AddMoveFilter and gives it a callback which is called whenever the mouse is moved on the 3D scene.

Then it uses Scene::FirstContact to get the coordinates of that point in 3D.

edit flag offensive delete link more

answered 2017-04-08 20:11:07 -0500

nkoenig gravatar image
edit flag offensive delete link more


You mean using a plugin, right?

andrestoga gravatar imageandrestoga ( 2017-04-08 20:22:30 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-04-08 17:52:35 -0500

Seen: 2,312 times

Last updated: Apr 09 '17