ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Here is some of my urdf.xacro file that impliments a camera at a specified camera_pitch. Note line 11: <origin xyz="0 0 ${1+base_height}" rpy="0 ${-cam_pitch} 0"/>

<!-- Vision Camera -->
    <link name="camera_link">
        <visual>
            <origin xyz="0 0 0" rpy="0 0 0" />
            <geometry>
                <box size="${camera_size} ${camera_size} ${camera_size}" />
            </geometry>
        </visual>
    </link>
    <joint name="camera_joint" type="fixed">
      <origin xyz="0 0 ${1+base_height}" rpy="0 ${-cam_pitch} 0" />
      <parent link="base_link"/>
      <child link="camera_link" />
    </joint>
    <gazebo reference="camera_link">
      <sensor type="camera" name="camera">
        <update_rate>30.0</update_rate>
        <camera name="head">
          <horizontal_fov>1.3962634</horizontal_fov>
          <image>
            <width>752</width>
            <height>480</height>
            <format>L8</format>
          </image>
          <clip>
            <near>0.02</near>
            <far>300</far>
          </clip>
          <!--noise>
            <type>gaussian</type>
            < Noise is sampled independently per pixel on each frame.
                 That pixel's noise value is added to each of its color
                 channels, which at that point lie in the range [0,1]. >
            <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>image_raw</imageTopicName>
          <cameraInfoTopicName>camera_info</cameraInfoTopicName>
          <frameName>camera_link</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>
      </sensor>
    </gazebo>