Robotics StackExchange | Archived questions

Problem using CameraPublisher plugin gazebo5

Hi. I'm trying to load the libCameraPublisher.so into gazebo5 but it gives me this error while spawning my robot: Actually I want to publish the camera's data into a ros topic.

[Err] [Model.cc:770] Model[MyName] is attempting to load a plugin, but detected an incorrect plugin type. Plugin filename[libCameraPlugin.so] name[camera_controller] Here you can see my .launch and model.sdf files:

Launch File:

<launch>
<!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
<param name="robot_description_sdf" textfile="$(find bring_up)/models/pioneer3at/model.sdf" />
<node 
    pkg="gazebo_ros" 
    output="screen"
    respawn="false" 
    name="spawn_model" 
    type="spawn_model" 
    args="-file $(find bring_up)/models/pioneer3at/model.sdf -sdf -x 0 -y 0 -z 1 -model MyName "/>
   </launch>

model.sdf:

<?xml version="1.0" ?>
<sdf version="1.5">
    <model name="pioneer3at">
<pose>0 0 0.180 0 0 0</pose>
<static>false</static>
<link name="chassis">
  <inertial>
    <mass>14.0</mass>
    <inertia>
      <ixx>0.147116667</ixx>
      <ixy>0.0</ixy>
      <ixz>0.0</ixz>
      <iyy>0.334951167</iyy>
      <iyz>0.0</iyz>
      <izz>0.3978345</izz>
    </inertia>
  </inertial>
  <collision name="collision">
    <geometry>
      <box>
        <size>0.501 0.300 0.19</size>
      </box>
    </geometry>
  </collision>
  <visual name="visual">
    <geometry>
      <mesh>
        <uri>model://pioneer3at/meshes/chassis.dae</uri>
      </mesh>
    </geometry>
  </visual>
</link>
<link name="right_front_wheel">
  <pose>0.125 -0.201 -0.06 1.5707 0 0</pose>

  <inertial>
    <mass>1.5</mass>
    <inertia>
      <ixx>0.005240625</ixx>
      <iyy>0.005240625</iyy>
      <izz>0.009075</izz>
      <ixy>0</ixy>
      <ixz>0</ixz>
      <iyz>0</iyz>
    </inertia>
  </inertial>

  <collision name="collision">
    <geometry>
      <cylinder>
        <radius>0.110</radius>
        <length>0.075</length>
      </cylinder>
    </geometry>
    <surface>
      <friction>
        <ode>
          <mu>1</mu>
          <mu2>1</mu2>
          <slip1>0.5</slip1>
          <slip2>0</slip2>
        </ode>
      </friction>
    </surface>
  </collision>
  <visual name="visual">
    <geometry>
      <mesh>
        <uri>model://pioneer3at/meshes/wheel.dae</uri>
      </mesh>
    </geometry>
  </visual>
</link>
<link name="left_front_wheel">
  <pose>0.125 0.201 -0.06 1.5707 0 0</pose>

  <inertial>
    <mass>1.5</mass>
    <inertia>
      <ixx>0.005240625</ixx>
      <iyy>0.005240625</iyy>
      <izz>0.009075</izz>
      <ixy>0</ixy>
      <ixz>0</ixz>
      <iyz>0</iyz>
    </inertia>
  </inertial>

  <collision name="collision">
    <geometry>
      <cylinder>
        <radius>0.110</radius>
        <length>0.075</length>
      </cylinder>
    </geometry>
    <surface>
      <friction>
        <ode>
          <mu>1</mu>
          <mu2>1</mu2>
          <slip1>0.5</slip1>
          <slip2>0</slip2>
        </ode>
      </friction>
    </surface>
  </collision>
  <visual name="visual">
    <geometry>
      <mesh>
        <uri>model://pioneer3at/meshes/wheel.dae</uri>
      </mesh>
    </geometry>
  </visual>
</link>
<link name="right_rear_wheel">
  <pose>-0.125 -0.201 -0.06 1.5707 0 0</pose>

  <inertial>
    <mass>1.5</mass>
    <inertia>
      <ixx>0.005240625</ixx>
      <iyy>0.005240625</iyy>
      <izz>0.009075</izz>
      <ixy>0</ixy>
      <ixz>0</ixz>
      <iyz>0</iyz>
    </inertia>
  </inertial>

  <collision name="collision">
    <geometry>
      <cylinder>
        <radius>0.110</radius>
        <length>0.075</length>
      </cylinder>
    </geometry>
    <surface>
      <friction>
        <ode>
          <mu>1</mu>
          <mu2>1</mu2>
          <slip1>0.5</slip1>
          <slip2>0</slip2>
        </ode>
      </friction>
    </surface>
  </collision>
  <visual name="visual">
    <geometry>
      <mesh>
        <uri>model://pioneer3at/meshes/wheel.dae</uri>
      </mesh>
    </geometry>
  </visual>
</link>
<link name="left_rear_wheel">
  <pose>-0.125 0.201 -0.06 1.5707 0 0</pose>

  <inertial>
    <mass>1.5</mass>
    <inertia>
      <ixx>0.005240625</ixx>
      <iyy>0.005240625</iyy>
      <izz>0.009075</izz>
      <ixy>0</ixy>
      <ixz>0</ixz>
      <iyz>0</iyz>
    </inertia>
  </inertial>

  <collision name="collision">
    <geometry>
      <cylinder>
        <radius>0.110</radius>
        <length>0.075</length>
      </cylinder>
    </geometry>
    <surface>
      <friction>
        <ode>
          <mu>1</mu>
          <mu2>1</mu2>
          <slip1>0.5</slip1>
          <slip2>0</slip2>
        </ode>
      </friction>
    </surface>
  </collision>
  <visual name="visual">
    <geometry>
      <mesh>
        <uri>model://pioneer3at/meshes/wheel.dae</uri>
      </mesh>
    </geometry>
  </visual>
</link>
<joint type="revolute" name="right_front">
  <pose>0 0 0 0 0 0</pose>
  <child>right_front_wheel</child>
  <parent>chassis</parent>
  <axis>
    <xyz>0 1 0</xyz>
    <use_parent_model_frame>true</use_parent_model_frame>
  </axis>
</joint>
<joint type="revolute" name="right_rear">
  <pose>0 0 0 0 0 0</pose>
  <child>right_rear_wheel</child>
  <parent>chassis</parent>
  <axis>
    <xyz>0 1 0</xyz>
    <use_parent_model_frame>true</use_parent_model_frame>
  </axis>
</joint>
<joint type="revolute" name="left_front">
  <pose>0 0 0 0 0 0</pose>
  <child>left_front_wheel</child>
  <parent>chassis</parent>
  <axis>
    <xyz>0 1 0</xyz>
    <use_parent_model_frame>true</use_parent_model_frame>
  </axis>
</joint>
<joint type="revolute" name="left_rear">
  <pose>0 0 0 0 0 0</pose>
  <child>left_rear_wheel</child>
  <parent>chassis</parent>
  <axis>
    <xyz>0 1 0</xyz>
    <use_parent_model_frame>true</use_parent_model_frame>
  </axis>
</joint>
<plugin name="SkidSteerDrivePlugin" filename="libSkidSteerDrivePlugin.so">
  <right_front>right_front</right_front>
  <right_rear>right_rear</right_rear>
  <left_front>left_front</left_front>
  <left_rear>left_rear</left_rear>
  <MaxForce>5.0</MaxForce>
</plugin> 

    <!-- Adding Camera -->

    <include>
  <uri>model://camera</uri>
  <pose>0.2 0 0.15 0 0 0</pose>
</include>
<joint name="camera_joint" type="revolute">
  <child>camera::link</child>
  <parent>chassis</parent>
  <axis>
    <xyz>0 0 1</xyz>
    <limit>
      <upper>0</upper>
      <lower>0</lower>
    </limit>
  </axis>
</joint>

    <!-- Adding Hokuyo -->

  <include>
    <uri>model://hokuyo</uri>
    <pose>0.2 0 0.19 0 0 0</pose>
  </include>
  <joint name="hokuyo_joint" type="revolute">
    <child>hokuyo::link</child>
    <parent>chassis</parent>
    <axis>
      <xyz>0 0 1</xyz>
      <limit>
        <upper>0</upper>
        <lower>0</lower>
      </limit>
    </axis>
  </joint>

  <!-- Camera Publisher Plugin -->

  <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
    <updateRate>0.0</updateRate>
    <cameraName>MyName/camera1</cameraName>
    <imageTopicName>image_raw</imageTopicName>
    <cameraInfoTopicName>camera_info</cameraInfoTopicName>
    <frameName>camera_link</frameName>
    <hackBaseline>0.07</hackBaseline>
    <distortionK1>0.0</distortionK1>
    <distortionK2>0.0</distortionK2>
    <distortionK3>0.0</distortionK3>
    <distortionT1>0.0</distortionT1>
    <distortionT2>0.0</distortionT2>
  </plugin>

  <!-- Laser Publisher Plugin -->

  <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_laser.so">
    <topicName>/rrbot/laser/scan</topicName>
    <frameName>hokuyo_link</frameName>
  </plugin>

Asked by Taher on 2016-05-08 08:07:47 UTC

Comments

have you installed gazebo5_ros_pkgs?

Asked by l0g1x on 2016-05-09 12:01:33 UTC

yes. i did it.

Asked by Taher on 2016-05-09 13:08:48 UTC

Answers