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

using camera sensor in Gazebo.

asked 2011-11-16 00:45:28 -0500

Maurizio88 gravatar image

updated 2014-01-28 17:10:48 -0500

ngrennan gravatar image

where can i find documentation or examples about camera sensor? I need to create a camera sensor and i need to move it around the robot.

thanks in advance.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2011-11-16 01:34:43 -0500

DimitriProsser gravatar image

You can look at the pr2 description in the pr2_description package. They have some urdf and xacro files for describing cameras. You'd want to use the prosilica_gc2450 files for a single camera (the wge100 is for stereo I believe). My camera configuration looks like this:

 <gazebo reference="${name}_head">
    <sensor:camera name="${name}_sensor">
        <imageFormat>R8G8B8</imageFormat>
        <imageSize>704 480</imageSize>
        <hfov>45</hfov>
        <nearClip>0.1</nearClip>
        <farClip>100</farClip>
        <updateRate>20.0</updateRate>
        <controller:gazebo_ros_prosilica name="${name}_controller" plugin="libgazebo_ros_prosilica.so">
            <alwaysOn>true</alwaysOn>
            <updateRate>20.0</updateRate>
            <imageTopicName>/ptz/image_raw</imageTopicName>
            <cameraInfoTopicName>/ptz/camera_info</cameraInfoTopicName>
            <pollServiceName>/ptz/request_image</pollServiceName>
            <frameName>${name}_head</frameName>
            <CxPrime>1224.5</CxPrime>
            <Cx>1224.5</Cx>
            <Cy>1025.5</Cy>
            <focal_length>2955</focal_length>
            <distortion_k1>0.0</distortion_k1>
            <distortion_k2>0.0</distortion_k2>
            <distortion_k3>0.0</distortion_k3>
            <distortion_t1>0.0</distortion_t1>
            <distortion_t2>0.0</distortion_t2>
            <interface:camera name="${name}_iface" />
        </controller:gazebo_ros_prosilica>
    </sensor:camera>
</gazebo>

As far as making it move, that's a little more complicated. If you're just looking to make it pan/tilt in place, that's not so bad. But if you're looking to move it around on the robot, that's not going to be as easy.

If you want to make a pan/tile camera, you could model the camera much like the pr2's head, but with only a single camera. You can see how they set up two joint controllers using the pr2_controllers stack to manipulate them. I wrote a teleop program, modeled after the pr2's teleop node that publishes to my camera joint controllers. This enables me to quickly adjust the camera as I see fit.

If you're trying to make the camera change its position on the robot's frame, then you'd have to experiment with some slider joints and some more joint controllers.

edit flag offensive delete link more

Comments

Hi, another question is would the "state_publisher" publish topic "/ptz/image_raw" automatically or do we need to publish topic "/ptz/image_raw" ourselves with, for example, image_transport package?

yuquan gravatar image yuquan  ( 2012-11-02 13:51:21 -0500 )edit
1

answered 2011-11-17 19:40:02 -0500

Maurizio88 gravatar image

hi,

very thanks.

for first i need to create a camera and see what the camera see. Can I use some node which open a window? so i can see the camera's video.

edit flag offensive delete link more

Comments

DimitriProsser gravatar image DimitriProsser  ( 2011-11-18 03:47:03 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2011-11-16 00:45:28 -0500

Seen: 7,913 times

Last updated: Nov 17 '11