Robotics StackExchange | Archived questions

How to Scale Depth Topic in URDF

I am simulating a depth camera in Gazebo. I am using the kinect plugin. It posts the depth topic in meters, but I would like to scale it by 1000, to millimeters. Is this possible within the URDF file?

Here is the snippet of my URDF that deals with the camera:

<gazebo reference="camera_sensor_link">
      <sensor type="depth" name="camera">
        <always_on>true</always_on>
        <update_rate>20.0</update_rate>
        <camera>
          <horizontal_fov>${60.0*3.14/180.0}</horizontal_fov>
          <image>
            <format>B8G8R8</format>
        <width>640</width>
        <height>480</height>
      </image>
      <clip>
        <near>0.05</near>
        <far>8.0</far>
      </clip>
    </camera>
    <plugin name="camera_controller" filename="libgazebo_ros_openni_kinect.so">
      <cameraName></cameraName>
      <alwaysOn>true</alwaysOn>
      <updateRate>10</updateRate>
      <imageTopicName>usb_cam/image_raw</imageTopicName>
      <depthImageTopicName>camera/depth/image_raw</depthImageTopicName>
      <pointCloudTopicName>camera/depth/points</pointCloudTopicName>
      <cameraInfoTopicName>usb_cam/camera_info</cameraInfoTopicName>
      <depthImageCameraInfoTopicName>camera/depth/camera_info</depthImageCameraInfoTopicName>
      <frameName>camera_depth_optical_frame</frameName>
      <baseline>0.1</baseline>
      <distortion_k1>0.0</distortion_k1>
      <distortion_k2>0.0</distortion_k2>
      <distortion_k3>0.0</distortion_k3>
      <distortion_t1>0.0</distortion_t1>
      <distortion_t2>0.0</distortion_t2>
      <pointCloudCutoff>0.4</pointCloudCutoff>
    </plugin>
  </sensor>
</gazebo>

PS: This is a repost. My original post has been in moderation since Nov 11th with no feedback.

Asked by fruitbot on 2020-11-16 15:56:49 UTC

Comments

Answers