Gazebo | Ignition | Community
Ask Your Question

How to determine whether there is an obstacle between two robots?

asked 2023-05-08 09:54:27 -0600

Brytsk Nguyen gravatar image

We are simulating a swarm of UAVs collaboratively explore an environment with inter-UAV communication based on the line of sight between them. To do this we would like to know if there is a wall or object between two robots. Is there any way we can determine if there is an object between the two UAVs?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-05-11 01:52:05 -0600

Veerachart gravatar image

Maybe you can check the function gazebo::rendering::Scene::FirstContact. It uses a camera and a pixel position (can be the camera's center) to obtain the 3D position of the first thing the ray from the camera through that pixel hits a visual. Another function is gazebo::rendering::Scene::VisualAt, which gives you the visual instead of the hit position. Note that both see the visuals, not collisions.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2023-05-08 09:54:27 -0600

Seen: 56 times

Last updated: May 11