Gazebo | Ignition | Community
Ask Your Question

Simulating a Structured Light Sensor in Gazebo

asked 2017-06-14 15:08:26 -0500

atomoclast gravatar image


I am in the process of working on a system that will end up using a structured light sensor similar to the one being depicted in the image below, and I was wondering what the best way to simulate this sensor in Gazebo was/if it already has been.

One idea was to take two depth camera's and AND their pointclouds together, that way if one of the cameras were obstructed or part of either's FOV was obstructed, it would cast a shadow.

Looking for input and help to ensure we have as realistic of a simulation as possible.

Thanks in advance!

image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-06-15 13:09:23 -0500

updated 2017-06-15 13:10:52 -0500

You can use a projector to make a simulated laser line (or any 2D texture at all), and run the real structured light algorithms on them. You can make a laser line by making the non-laser parts of the image transparent, and have the laser center fade into transparency.

sdf example:

<projector name="texture_projector">
  <pose>0 0 0 0 0.77 0</pose>
  <!-- set GAZEBO_RESOURCE_PATH to point to this (have it within media/materials/textures subdir  -->
  <!-- this works because it is in /usr/share/gazebo-1.9/media/materials/textures/ -->

This shows a png file be projected out to infinity to on a plane:

image description

I have a probably out-of-date example here with both gazebo_ros xacro/urdf and sdf examples (I created that to illustrate some issues I was having with projectors, I didn't hear anything and haven't tested recently to see if newer versions work better- but either way they can be used for structured light)

edit flag offensive delete link more


I tried to use the solution projector and it works quite well, except that it trespass objects and project the texture on behind of an object, which if captured by a camera would cause problems for the structured light. Did you hit this? If so how did you overcame that? Thanks!

rasecg3 gravatar imagerasecg3 ( 2019-04-08 11:05:49 -0500 )edit

Question Tools

1 follower


Asked: 2017-06-14 15:08:26 -0500

Seen: 1,255 times

Last updated: Jun 15 '17