Simulating a Structured Light Sensor in Gazebo
Hello,
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!
Asked by atomoclast on 2017-06-14 15:08:26 UTC
Answers
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 -->
<texture>test_pattern.png</texture>
<!-- this works because it is in /usr/share/gazebo-1.9/media/materials/textures/ -->
<!--texture>stereo_projection_pattern_high_res_red.png</texture-->
<fov>0.959931088597</fov>
<near_clip>0.1</near_clip>
<far_clip>10</far_clip>
</projector>
This shows a png file be projected out to infinity to on a plane:
I have a probably out-of-date example here with both gazebo_ros xacro/urdf and sdf examples https://github.com/lucasw/testbot (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)
Asked by Lucas Walter on 2017-06-15 13:09:23 UTC
Comments
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!
Asked by rasecg3 on 2019-04-08 11:05:49 UTC
Comments