0
$\begingroup$

Rosanswers logo

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.


Originally posted by Maurizio88 on ROS Answers with karma: 155 on 2011-11-16

Post score: 2

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by DimitriProsser with karma: 11163 on 2011-11-16

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by yuquan on 2012-11-02:
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?

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by Maurizio88 with karma: 155 on 2011-11-17

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by DimitriProsser on 2011-11-18:
I have answered your question here: http://answers.ros.org/question/2953/using-camera-sensor-in-gazebo-simulation

$\endgroup$

Your Answer

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