Home | Tutorials | Wiki | Issues
Ask Your Question
0

Stereo camera simulation Gazebo

asked 2018-04-07 15:45:00 -0500

malhar gravatar image

updated 2018-04-07 15:53:03 -0500

Hi,

I created a sdf for the stereo camera using the Gazebo plugin (for publishing to ROS topics). However, There are few things I'm really confused about -

Even on setting <static> true </static> in the sdf file, the cameras (left and right) images change on resizing the stereo camera ( for which Im just using a box as a mesh). Is this expected ?

More importantly, does this imply that the Translation between the two cameras has changed ? ( I tried verifying this by saving the new world file and comparing against the older one, but both had the same <hackBaseline> tag value.

I wish to make some calculations based on the stereo cameras calibration parameters and hence this is quite important.

If someone wishes to see the relevant XML for this :

<sensor type="multicamera" name="stereo_camera">
        <update_rate>30</update_rate>
        <camera name="left">
          <horizontal_fov>1.3962634</horizontal_fov>
          <image>
            <width>640</width>
            <height>480</height>
            <format>R8G8B8</format>
          </image>
          <clip>
            <near>0.02</near>
            <far>300</far>
          </clip>
          <noise>
            <type>gaussian</type>
            <mean>0.0</mean>
            <stddev>0.007</stddev>
          </noise>
        </camera>
        <camera name="right">
          <pose>0 -0.07 0 0 0 0</pose>
          <horizontal_fov>1.3962634</horizontal_fov>
          <image>
            <width>640</width>
            <height>480</height>
            <format>R8G8B8</format>
          </image>
          <clip>
            <near>0.02</near>
            <far>300</far>
          </clip>
          <noise>
            <type>gaussian</type>
            <mean>0.0</mean>
            <stddev>0.007</stddev>
          </noise>
        </camera>
        <plugin name="stereo_camera_controller" filename="libgazebo_ros_multicamera.so">
          <alwaysOn>true</alwaysOn>
          <updateRate>0.0</updateRate>
          <cameraName>sricam</cameraName>
          <imageTopicName>image_raw</imageTopicName>
          <cameraInfoTopicName>camera_info</cameraInfoTopicName>
          <frameName>left_camera_optical_frame</frameName>
          <!--<rightFrameName>right_camera_optical_frame</rightFrameName>-->
          <hackBaseline>0.07</hackBaseline>
          <distortionK1>0.0</distortionK1>
          <distortionK2>0.0</distortionK2>
          <distortionK3>0.0</distortionK3>
          <distortionT1>0.0</distortionT1>
          <distortionT2>0.0</distortionT2>
        </plugin>
      </sensor>

I would be very grateful if someone can help out on this.

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-12 22:23:31 -0500

luxiaojun gravatar image

Malhar: What do you mean "resizing". Actually I am using the exactly same plugin as you are except the different parameters. My result is below. screen of gazebo C:\fakepath\gazebo.png and screen of RViz C:\fakepath\left and right image in RViz.png. PS: Do you know where I can see the cpp code of libgazebo_ros_multicamera.so ? Thank you very much.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-04-07 15:45:00 -0500

Seen: 176 times

Last updated: May 12