Home | Tutorials | Wiki | Issues
Ask Your Question
0

Getting Start with Kinect and ROS

asked 2016-09-12 19:11:22 -0500

cflavs gravatar image

Hi all,

I want to use a Gazebo world and a robot with a kinect on it where I can identiy objects of this world. I'm thinking on getting the kinect RGB images and process, but I'm a little confuse about how to simulate the kinect on gazebo and parse the image data to ROS, so I was thinking if any of you doesn't have some quick start or tutorials to give me (even some tips), I know normally OpenNI and PCL are used, but I don't know exactly how to use them with ROS and Gazebo together. I searched at ROS forum but related questions normally was closed as a Gazebo question, so I thought maybe here was the best place to discuss it.

edit retag flag offensive close merge delete

Comments

I'm also looking for a similar solution, have you got any clues yet?

kerem gravatar imagekerem ( 2016-10-07 15:21:43 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-12-19 08:34:12 -0500

dinesh999lama gravatar image

updated 2016-12-19 08:37:10 -0500

Just add this lines in ur sdf file with a model and launch it, than after this u can run rostopic echo in another terminal to see the published topics, it will exactly work like real kinect sensor, but if u want to make it more realistic u need to add some noise in it.

 <!-- camera -->
  <gazebo reference="camera_link">
    <sensor type="depth" name="camera1">
        <always_on>1</always_on>
        <visualize>true</visualize>             
        <camera>
            <horizontal_fov>1.047</horizontal_fov>  
            <image>
                <width>640</width>
                <height>480</height>
                <format>R8G8B8</format>
            </image>
            <depth_camera>

            </depth_camera>
            <clip>
                <near>0.1</near>
                <far>100</far>
            </clip>
        </camera>
             <plugin name="camera_controller" filename="libgazebo_ros_openni_kinect.so">
             <alwaysOn>true</alwaysOn>
                <updateRate>10.0</updateRate>
                <cameraName>camera</cameraName>
                <frameName>camera_link</frameName>                   
            <imageTopicName>rgb/image_raw</imageTopicName>
            <depthImageTopicName>depth/image_raw</depthImageTopicName>
            <pointCloudTopicName>depth/points</pointCloudTopicName>
            <cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName>              
            <depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName>            
            <pointCloudCutoff>0.4</pointCloudCutoff>                
                <hackBaseline>0.07</hackBaseline>
                <distortionK1>0.0</distortionK1>
                <distortionK2>0.0</distortionK2>
                <distortionK3>0.0</distortionK3>
                <distortionT1>0.0</distortionT1>
                <distortionT2>0.0</distortionT2>
            <CxPrime>0.0</CxPrime>
            <Cx>0.0</Cx>
            <Cy>0.0</Cy>
            <focalLength>0.0</focalLength>
            </plugin>
    </sensor>
  </gazebo>

U have to define link, collision element and visual element to represent the kinect sensor and add this sensor plugin before </link> i.r ur model or link which u want to see as a kinect sensor.

edit flag offensive delete link more

Comments

I get this particular error message when copy pasted this code inside the link tag. XML Element[gazebo], child of element[link] not defined in SDF. Ignoring[gazebo]. Any suggestions on why this could be happening? Thanks in advance. EDIT: Solved the problem. Gazebo tag is used for URDF files not for SDF files.

aadityacr7 gravatar imageaadityacr7 ( 2018-05-01 14:22:41 -0500 )edit
1

answered 2016-12-17 22:20:02 -0500

nkoenig gravatar image

Take a look at the gazebo tutorials.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-09-12 19:11:22 -0500

Seen: 3,180 times

Last updated: Dec 19 '16