1

I'm trying to attach a simple camera to the tool tip of my robot (Kuka lwr). The problem is that the camera view is always changing as shown in the video:

https://polimi365-my.sharepoint.com/:v:/g/personal/10522502_polimi_it/EXuBinkz9NRJlq9O5L5lSo8B7VvdVAVFOAfmaITn106_4A?e=6i3bw3

It seems like the camera is colliding with something or there is a sort of conflict. At the beginning I though it was a material problem (maybe the camera was set inside the box) but setting it transparent didn't solve the problem. I couldn't find any similar issue on the web so I hope someone can help me! For the camera, I followed the tutorial (http://gazebosim.org/tutorials?tut=ro...) adding the camera description in my .urdf.xacro file and the camera plugin in the .gazebo.xacro file.

Here is the camera description in the xacro file:

    <joint name="${name}_joint_camera" type="fixed">
      <parent link="tool_ee"/>
      <child link="${name}_link_camera"/>
      <origin xyz="0 0 0.06" rpy="0 0 0"/>
      <axis xyz="1 0 0" />
    </joint>

    <link name="${name}_link_camera">
      <collision>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <box size="0.05 0.05 0.05"/>
        </geometry>
      </collision>

      <visual>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <box size="0.05 0.05 0.05"/>
        </geometry>
      </visual>

      <inertial>
        <mass value="1e-5" />
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.0001" iyz="0" izz="0.0001" />
      </inertial>
    </link>
  <joint name="camera_optical_joint" type="fixed">
    <origin xyz="0 0 0" rpy="${-pi/2} 0 ${-pi/2}"/>
    <parent link="${name}_link_camera"/>
    <child link="camera_link_optical"/>
  </joint>

  <link name="camera_link_optical">
  </link>

Here the camera plugin of in the gazebo file:

<gazebo reference="lwr_link_camera">
        <mu1>0.2</mu1>
        <mu2>0.2</mu2>
        <material>Gazebo/Transparent</material>
    </gazebo>

    <!-- Camera -->
    <gazebo reference="lwr_link_camera">
        <sensor type="camera" name="camera_sensor1">
            <update_rate>30.0</update_rate>
            <camera name="head">
            <horizontal_fov>1.3962634</horizontal_fov>
            <image>
              <width>800</width>
              <height>800</height>
              <format>R8G8B8</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>/camera1</cameraName>
                <imageTopicName>image_raw</imageTopicName>
                <cameraInfoTopicName>camera_info</cameraInfoTopicName>
                <frameName>camera_link_optical</frameName>
                <hackBaseline>0.0</hackBaseline>
                <distortionK1>0.0</distortionK1>
                <distortionK2>0.0</distortionK2>
                <distortionK3>0.0</distortionK3>
                <distortionT1>0.0</distortionT1>
                <distortionT2>0.0</distortionT2>
                <CxPrime>0</CxPrime>
                <Cx>0.0</Cx>
                <Cy>0.0</Cy>
                <focalLength>0.0</focalLength>
            </plugin>
        </sensor>
    </gazebo>

Any help is appreciated! Thanks!

eliseeeeer
  • 11
  • 2

0 Answers0