Home | Tutorials | Wiki | Issues
Ask Your Question
0

Adding camera sensor on ROS

asked 2012-12-03 23:29:24 -0600

ChengXiang gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-12-06 06:47:40 -0600

Davinci gravatar image

updated 2012-12-06 06:50:01 -0600

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
edit flag offensive delete link more

Comments

Hi Davinci. Ya I overcome the problem too by using another plugin. Thanks!

ChengXiang gravatar imageChengXiang ( 2012-12-08 05:54:40 -0600 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-12-03 23:29:24 -0600

Seen: 942 times

Last updated: Dec 06 '12