Ask Your Question
1

How to Visualize Sensor FoV

asked 2020-07-14 11:02:13 -0500

Jacob.Beck27 gravatar image

updated 2020-07-14 11:17:19 -0500

I'm designing a robot, and I'd like to use ROS tools to see how sensor placement affects coverage. Ideally, I'd like to create a model with various sensors and see the field of view (frustum) of each one. This appears to be possible, as the screenshots of Gazebo show in this article. How can I accomplish this? I'm working in ROS kinetic.

edit retag flag offensive close merge delete

Comments

It looks like I might need to set the visualize element as defined here. Still working on getting this into my xacros.

Jacob.Beck27 gravatar image Jacob.Beck27  ( 2020-07-14 17:28:10 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-07-16 18:01:06 -0500

Jacob.Beck27 gravatar image

As I suspected, the visualize element was the answer. I've attached a complete example that can be used in a URDF for other's reference.

<gazebo reference="color_camera_link">
  <sensor type="camera" name="camera">
    <update_rate>30.0</update_rate>
    <camera name="camera">
      <horizontal_fov>${69.4 * pi / 180}</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="camera_controller" filename="libgazebo_ros_camera.so">
      <alwaysOn>true</alwaysOn>
      <updateRate>0.0</updateRate>
      <cameraName>camera</cameraName>
      <imageTopicName>color/image_raw</imageTopicName>
      <cameraInfoTopicName>color/camera_info</cameraInfoTopicName>
      <frameName>color_camera_frame</frameName>
      <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>
    <visualize>true</visualize>
  </sensor>
</gazebo>
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-07-14 11:02:13 -0500

Seen: 841 times

Last updated: Jul 16 '20