Gazebo | Ignition | Community
Ask Your Question
0

Kinect sensor gazebo-ros

asked 2013-06-21 14:30:23 -0500

agonzamart gravatar image

I am trying to add a kinect sensor to a simulation I have already running using a hokuyo laser as sensor for navigation. I want to add the kinect sensor in order to simulate navigation using point clouds. I have all of this already running in the real robot.

I am using ros groovy and Gazebo 1.6

The important part of the .sdf I use is at the end of the question. I have gone through the tutorials but I am still not sure about how sensors and plugins properly work. For what I understand just adding the camera depth sensor should get the topic from gazebo listed in a gztopic list, but I do not see this happening. And for what I understand adding the plugin besides adding new functionalities should make the bridge to ros available so that it would publish in the same topics as a depth camera does in ros.

I am pretty stuck so I would appreciate any help.

Thanks for our time.


<link name="kinect::link"> <pose>0.2 0 0.265 0 0 0</pose> <inertial> <mass>0.1</mass> </inertial> <collision name="collision"> <geometry> <box> <size>0.073000 0.276000 0.072000</size> </box> </geometry> </collision> <visual name="visual"> <geometry> <mesh> <uri>model://kinect/meshes/kinect.dae</uri> </mesh> </geometry> </visual>

  <sensor name="camera" type="depth">
    <pose>0.2 0 0.265 0 0 0</pose>
    <update_rate>20</update_rate>
    <camera>
      <horizontal_fov>1.047198</horizontal_fov>
      <image>
        <width>640</width>
        <height>480</height>
        <format>R8G8B8</format>
      </image>
      <clip>
        <near>0.05</near>
        <far>3</far>
      </clip>
    </camera>
    <plugin name="camera" filename='libDepthCameraPlugin.so'>
        <alwaysOn>1</alwaysOn>
    <updateRate>10.0</updateRate>
    <image_topic_name>image_raw</image_topic_name>
        <point_cloud_topic_name>points</point_cloud_topic_name>
     <camera_info_topic_name>camera_info</camera_info_topic_name>
    <cameraName>depth_cam</cameraName>
        <frameName>/base_link</frameName>
        <point_cloud_cutoff>0.001</point_cloud_cutoff>
    <distortionK1>0.00000001</distortionK1>
        <distortionK2>0.00000001</distortionK2>
        <distortionK3>0.00000001</distortionK3>
        <distortionT1>0.00000001</distortionT1>
        <distortionT2>0.00000001</distortionT2>
  </sensor>
</link>

  <joint name="kinect_joint" type="revolute">
    <child>kinect::link</child>
    <parent>chassis</parent>
    <axis>
      <xyz>0 0 1</xyz>
      <limit>
        <upper>0</upper>
        <lower>0</lower>
      </limit>
    </axis>
  </joint>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-06-27 19:27:12 -0500

nkoenig gravatar image

The <alwaysOn> should be a child of <sensor>, not <plugin>. This should force the sensor to be on all the time, and you should see a gztopic.

edit flag offensive delete link more

Comments

Thanks I had already solved it but I didn't know exactly what had made it work. I appreciate it! :)

agonzamart gravatar imageagonzamart ( 2013-06-30 12:35:29 -0500 )edit

nkoening I was checking out the config I used for the .sdf to make the kinect work and I realized I did't use the <alwaysOn> tag at all. But I still get ros topics published. I can add a image viewer to rviz and I see the image from the simulated camera /depthcam/depth/imageraw. I even used a cloudthrottle to make a laserscan and seems to work properly. But if I try to add the <alwaysOn> tag as a child of sensor I get an error from the .sdf parser

agonzamart gravatar imageagonzamart ( 2013-07-04 07:07:44 -0500 )edit

Error [parser.cc:719] XML Element[alwaysOn], child of element[sensor] not defined in SDF. Ignoring.[sensor] Error [parser.cc:710] Error reading element <sensor> Error [parser.cc:710] Error reading element <link> Error [parser.cc:710] Error reading element <model> Error [parser.cc:710] Error reading element <world> Error [parser.cc:369] Unable to read element <sdf> Error [Server.cc:253] Unable to read sdf file

agonzamart gravatar imageagonzamart ( 2013-07-04 07:19:50 -0500 )edit

I also see here: http://gazebosim.org/wiki/Tutorials/1.9/ROSMotorandSensorPlugins in the Skid Steering Drive paragraph for example that the <alwaysOn> tag is used inside the plugin, I see no difference between using the tag inside the plugin or not using it so I assume that it is not being used. On the other hand when I use a gztopic I can not see wich one is from the camera, but gazebo must be publishing this topic if I can read it trough the ros topic. I think I might not getting something

agonzamart gravatar imageagonzamart ( 2013-07-04 07:40:18 -0500 )edit

I really appreciate your help and time

agonzamart gravatar imageagonzamart ( 2013-07-04 07:40:54 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2013-06-21 14:30:23 -0500

Seen: 2,925 times

Last updated: Jun 27 '13