0
$\begingroup$

Gazebo Answers logo

Hi everybody,

I'm currently trying to attach a camera to a robot. While that works fine, it seems that I can only see the depth images it produces and not the RGB images it should (I think?) also produce. Below is the SDF code I use to define the sensor:

<sensor name="downward_cam_camera_sensor" type="depth">
  <pose>0 0 0 0 1.57079632679 0</pose>
  <update_rate>20</update_rate>
  <always_on>true</always_on>
  <camera>
    <horizontal_fov>1.745</horizontal_fov>
    <image>
      <width>640</width>
      <height>480</height>
      <format>R8G8B8</format>
    </image>
    <clip>
      <near>0.01</near>
      <far>100</far>
    </clip>
  </camera>

  <plugin name="downward_cam_camera_controller" filename="libgazebo_ros_depth_camera.so">
    <cameraName>downward_cam</cameraName>
    <alwaysOn>true</alwaysOn>
    <updateRate>20</updateRate>
    <imageTopicName>camera/image</imageTopicName>
    <depthImageTopicName>camera/depth_image</depthImageTopicName>
    <cameraInfoTopicName>camera/camera_info</cameraInfoTopicName>
    <depthCameraInfoTopicName>camera/depth_camera_info</depthCameraInfoTopicName>
    <depthImageCameraInfoTopicName>camera/depth_image_camera_info</deptImageCameraInfoTopicName>
    <frameName>downward_cam_optical_frame</frameName>
    <interface:camera name="downward_cam_camera_iface"/>
  </plugin>
</sensor>

When I check out the depth image with the command:

rosrun image_view image_view image:=/downward_cam/camera/depth_image

then I see a grey scale image which is fine. But when I check the other topic:

rosrun image_view image_view image:=/downward_cam/camera/image

Nothing appears. I checked if that topic exists, which is the case. But when I check if any messages are coming though:

rostopic echo /downward_cam/camera/image

no messages appear...

Does anybody have an idea how I can extract coloured images from the camera? Am I using the wrong plugin, are my parameters wrong?

Any help is appreciated, thanks!

Bram


Originally posted by Morloth on Gazebo Answers with karma: 36 on 2013-03-07

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

I've created an issue to track this problem: https://bitbucket.org/osrf/gazebo/issue/560/rgb-images-for-depthcameras


Originally posted by nkoenig with karma: 7676 on 2013-03-07

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Morloth on 2013-03-08:
The problem seems to be the class image_transport::ImageTransport. In simulator_gazebo/gazebo_plugin/gazebo_ros_camera_utils.cpp we advertise the image service with:

this->image_pub_ = this->itnode_->advertise( this->image_topic_name_,1, boost::bind( &GazeboRosCameraUtils::ImageConnect,this), boost::bind( &GazeboRosCameraUtils::ImageDisconnect,this), ros::VoidPtr(), &this->camera_queue_);

However, the ImageConnect and ImageDisconnect are never called. So the variable image_co

$\endgroup$

Your Answer

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