Robotics StackExchange | Archived questions

Ignition Gazebo: RayQuery()

Hi all,

I'm new to Ignition Gazebo and trying to understand the general architectural structure of it.

I'm building a new simple range sensor system plugin that will measure the distance along some direction using a ray query. To create a ray query I need a pointer to the underlying world scene (scene->CreateRayQuery()). My question is: how do I get a pointer to the scene when implementing the Configure/Update/PostUpdate functions?

Thank you.

Asked by jmoxoby on 2020-02-10 16:22:34 UTC

Comments

Answers

That sounds similar to a GPU lidar that has a single ray. Maybe using that sensor with the appropriate number of samples could work?

Creating custom sensors isn't well documented or well supported right now. But here are some ideas:

Here's the GPU lidar sensor implementation. On Ignition Gazebo, that's managed by the Sensors system. It should be possible for you to create a new sensor type, but I think some changes will be needed on ign-sensors and ign-gazebo to make sure you can load your sensor. I ticketed an issue for that.

Another option for now could be not to use ign-sensors and do all the calculations in an Ignition Gazebo system. You can create your own scene, or load the Sensors system and access its scene through the engine singleton. But you need to be careful about threading, since each system's PostUpdate runs in a different thread.

Asked by chapulina on 2020-03-24 17:04:48 UTC

Comments

Can you please explain how to load Sensors system and access the scene in a plugin with Configure, Update, PostUpdate functions? I have been trying to write my sensor plugin but I cannot access the sensor itself.

Asked by agayev169 on 2020-05-15 02:46:26 UTC