Gazebo | Ignition | Community
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

updated 2020-06-02 16:40:52 -0500

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


Could you point out which exact example, from the given link, that I should refer to complete the task described in the question

Shrutheesh R Iyer gravatar imageShrutheesh R Iyer ( 2020-06-02 08:33:20 -0500 )edit

I updated the link above to the new GitHub repo

chapulina gravatar imagechapulina ( 2020-06-02 16:41:06 -0500 )edit

Could you be more specific with the instructions ? I am newbie in Gazebo and didn't understand what I should do in order to display the coordinates

msos1115 gravatar imagemsos1115 ( 2020-09-21 22:41:05 -0500 )edit

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

Question Tools

1 follower


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

Seen: 9,034 times

Last updated: Jun 02 '20