Home | Tutorials | Wiki | Issues
Ask Your Question
1

gazebo 1.9 libgazebo_ros_openni_kinect.so, incorrect plugin type?

asked 2013-10-12 02:29:08 -0500

ncr7 gravatar image

updated 2013-10-12 02:31:16 -0500

I have been trying to get the kinect sensor to work in gazebo 1.9 with ROS Groovy from the following tutorial, http://gazebosim.org/wiki/Tutorials/1.9/ROSMotorandSensorPlugins#Openni_Kinect

But I keep getting the following error.

 Error [Model.cc:761] Model[robot] is attempting to load a plugin, but detected an incorrect 
 plugin type. Plugin filename[libgazebo_ros_openni_kinect.so] name[head_camera_controller]
 gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:418: T* boost::shared_ptr<T>::operator->()
 const [with T = gazebo::sensors::Sensor]: Assertion `px != 0' failed.

In my URDF, I have the following listed at the end of the file after gazebo robot joint are referenced.

<gazebo>
  <plugin name="head_camera_controller" filename="libgazebo_ros_openni_kinect.so">
    <baseline>0.2</baseline>
    <alwaysOn>true</alwaysOn>
    <updateRate>1.0</updateRate>
    <cameraName>head_camera_ir</cameraName>
    <imageTopicName>/head_camera/depth/image_raw</imageTopicName>
    <cameraInfoTopicName>/head_camera/depth/camera_info</cameraInfoTopicName>
    <depthImageTopicName>/head_camera/depth/image_raw</depthImageTopicName>
    <depthImageInfoTopicName>/head_camera/depth/camera_info</depthImageInfoTopicName>
    <pointCloudTopicName>/head_camera/depth/points</pointCloudTopicName>
    <frameName>/head_camera</frameName>
    <pointCloudCutoff>0.5</pointCloudCutoff>
    <distortionK1>0.00000001</distortionK1>
    <distortionK2>0.00000001</distortionK2>
    <distortionK3>0.00000001</distortionK3>
    <distortionT1>0.00000001</distortionT1>
    <distortionT2>0.00000001</distortionT2>
    <CxPrime>0</CxPrime>
    <Cx>0</Cx>
    <Cy>0</Cy>
    <focalLength>0</focalLength>
    <hackBaseline>0</hackBaseline>
  </plugin>
</gazebo>

Any ideas as to why I am getting this error?

It seems that I have an issue with gazebo sensor plugins. The joint controller plugins are working fine though...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-10-14 05:43:53 -0500

psei gravatar image

updated 2013-10-15 05:47:05 -0500

There are different types of plugins, I think there are model-, sensor- and worldplugins.

libgazebo_ros_openni_kinect.so is a sensor plugin, and the way you have coded your URDF it is treated as a model plugin.

Let me show the difference:

<gazebo>
  <plugin>
  ...
  </plugin>
</gazebo>

defines a model plugin. But you need a sensor plugin. Try this:

<gazebo reference="my_sensor_link">
  <sensor>
     <plugin>
      ...
     </plugin>
  <sensor>
</gazebo>

My URDF for kinect cam looks like this:

<!-- SENSOR -->
<gazebo reference="openni_camera_link">
    <sensor type="depth" name="openni_camera_camera">       
        <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>openni_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>
edit flag offensive delete link more

Comments

Thanks! that worked. I don't know if you had any issue with how the point cloud is getting displayed. I seem to have the Kinect collecting points along its x-axis but displaying them in rviz along the z-axis. I'm playing with the link joints rotation, but I don't think that will change the difference between the collection and display position.

ncr7 gravatar imagencr7 ( 2013-10-14 12:52:11 -0500 )edit

If I understand you right, I had exact the same problem and I solved it as following: http://answers.gazebosim.org/question/4266/gazebo-15-libgazebo_openni_kinectso-pointcloud/

psei gravatar imagepsei ( 2013-10-15 05:35:32 -0500 )edit

Thanks for your great answer! Helped me out a lot!

MahdiehNejati gravatar imageMahdiehNejati ( 2015-11-12 16:03:20 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-10-12 02:29:08 -0500

Seen: 5,068 times

Last updated: Oct 15 '13