gazebosim / gz-sim

Open source robotics simulator. The latest version of Gazebo.
https://gazebosim.org
Apache License 2.0
679 stars 263 forks source link

Custom lidar sensor #1958

Open rsc9421 opened 1 year ago

rsc9421 commented 1 year ago

Hi, i want to simulate livox lidars (xyz) but they have a special "rosette" type pattern. I've read the documentation but I can't find how to simulate individual GpuRayPlugin as it could be done in gazebo classic.

I have the .csv files that indicate where each lidar should point, so all I need to simulate it is:

If you can help me with a little example I could make a contribution

Bi0T1N commented 1 year ago

Hi, this is just my guess as to how it might work but it does require quite some changes:

Also I think it would've been better if you had created the issue in the gz-sensors project so that it would reach the experts for sensor implementations directly :wink:

mjcarroll commented 1 year ago

Also I think it would've been better if you had created the issue in the gz-sensors project so that it would reach the experts for sensor implementations directly wink

I think just about everybody on the gazebo-dev team is subscribed to all the repos, so it will get seen no matter what :)

mjcarroll commented 1 year ago

In addition to what @Bi0T1N said above, from a rendering perspective, the actual implementation changes that will be needed are:

The underlying gz::rendering::Ogre2GpuRays sensor will need to be adjusted to take a new set of "direction vectors" for each ray of your custom pattern.

You may want to experiment a bit by implementing a custom sensor before going through the effort of getting it all "standardized" through sdformat and the rest of the libraries.

jrutgeer commented 1 year ago

I came across following plugin. Posting here as I assume it could be a solution, or a relevant example: https://robotec.ai/gazebo-lidar-rgl-plugin/