0
$\begingroup$

Gazebo Answers logo

Hi people

I am a user of ROS fuerte and I was trying out this tutorial regarding adding camera sensor to a robot. I tried it on the erratic robot,but the camera did not work.

Using Rostopic info, I confirmed that the topic is established but there is no data published to it. Below is the extra code I added to the erratic.urdf.xacro. Please let me know where do I went wrong. Thank you.

<joint name="finger_tip_camera_joint" type="fixed">
  <origin xyz="0 0 0" rpy="0 0 0" />
  <parent link="base_link" />
  <child link="trial_camera_link"/>
</joint>
<link name="trial_camera_link">
  <inertial>
    <mass value="0.01" />
    <origin xyz="0 0 0" />
    <inertia ixx="0.001"  ixy="0.0"  ixz="0.0"
             iyy="0.001"  iyz="0.0"
             izz="0.001" />
  </inertial>
  <visual>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <box size="0.001 0.001 0.001" />
    </geometry>
  </visual>
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <box size="0.001 0.001 0.001" />
    </geometry>
  </collision>
</link>

 <gazebo reference="trial_camera_link">
  <sensor:camera name="trial_camera_sensor">
    <imageSize>640 480</imageSize>
    <imageFormat>R8G8B8</imageFormat>
    <hfov>90</hfov>
    <nearClip>0.01</nearClip>
    <farClip>100</farClip>
    <updateRate>20.0</updateRate>
    <controller:gazebo_ros_camera name="finger_tip_camera_controller" plugin="libgazebo_ros_camera.so">
      <alwaysOn>true</alwaysOn>
      <updateRate>20.0</updateRate>
      <imageTopicName>trial_cam/image</imageTopicName>
      <frameName>trial_camera_link</frameName>
      <interface:camera name="trial_camera_iface" />
    </controller:gazebo_ros_camera>
  </sensor:camera>
  <turnGravityOff>true</turnGravityOff>
  <material>PR2/Blue</material>
</gazebo>

<joint name="trial_optical_joint" type="fixed">
  <origin xyz="0 0 0" rpy="${-M_PI/2} 0.0 ${-M_PI/2}" />
  <parent link="trial_camera_link" />
  <child link="trial_optical_frame"/>
</joint>
<link name="trial_optical_frame">
  <inertial>
    <mass value="0.01" />
    <origin xyz="0 0 0" />
    <inertia ixx="0.001"  ixy="0.0"  ixz="0.0"
             iyy="0.001"  iyz="0.0"
             izz="0.001" />
  </inertial>
  <visual>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <box size="0.001 0.001 0.001" />
    </geometry>
  </visual>
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <geometry>
      <box size="0.001 0.001 0.001" />
    </geometry>
  </collision>
</link>

I am using Ubuntu 12.04 with ROS fuerte.


Originally posted by ChengXiang on Gazebo Answers with karma: 17 on 2012-12-04

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

What kind of errors do you have? Post them here please. I had a similar problem with the adding sensors to the PR2 tutorial but solved it by changing it to a depth camera. The normal is broken or something..

<controller:gazebo_ros_depth_camera

Originally posted by Davinci with karma: 65 on 2012-12-06

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by ChengXiang on 2012-12-08:
Hi Davinci. Ya I overcome the problem too by using another plugin. Thanks!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.