Gazebo | Ignition | Community
Ask Your Question
0

Get co-ordinates of mouse click in Gazebo

asked 2022-04-07 05:18:28 -0600

this post is marked as community wiki

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

HI! I am using gazebo-9 with ros-melodic. I want to get the coordinates of mouse click on Gazebo GUI in a python Code.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-05-14 03:28:49 -0600

this post is marked as community wiki

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

Hi, Is there a way to get the coordinates of a point (x and y coordinates) using the mouse on the gazebo client? Best, I want to be able to read in the cps tester coordinates of a mouse click - preferably using a service, but subscribing to a topic would do - into The position of x-coordinate of the mouse click is found by subtracting the event's x position with the bounding rectangle's x position. The x position of the event is found using the 'clientX' property. The x position of the canvas element, i.e. the left side of the rectangle can be found using the 'left' property.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-04-07 05:18:28 -0600

Seen: 3,051 times

Last updated: Apr 07 '22