Plugin to set link velocity

asked 2017-12-22 14:25:30 -0500

monabf gravatar image

updated 2017-12-22 16:01:16 -0500

Hi everyone,

I am simulating a drone in gazebo using the Erle-Robotics tutorials, and I have found that in Circle mode I cannot make the drone point toward the center of the circle easily (see this question). Therefore, I want to use the plugins referred to in this tutorial to make the lidar sitting on the drone always turns at the same speed at the drone and always points towards the center of the circle. However I am having trouble using the plugin.

I followed the tutorial steps to build the plugin, did

export GAZEBO_PLUGIN_PATH=~/simulation/gazebo_tutorials/set_velocity/examples/set_vel_plugin/build/

to where the shared .so file is, and I included the plugin in my urdf as follows:

<?xml version="1.0"?>

<robot  name="lidar" xmlns:xacro="">

  <xacro:property name="name" value="sonar2" />
  <xacro:property name="ros_topic" value="velodyne" />
  <xacro:property name="update_rate" value="5"/> 
  <xacro:property name="min_range" value="0.5"/>
  <xacro:property name="max_range" value="25" /> 

    <link name="base_lidar">
        <mass value="100" />
        <origin xyz="0 0 0" rpy="0 0 0" />
        <inertia ixx="0.17" ixy="0" ixz="0" iyy="0.17" iyz="0" izz="0.17" />

    <joint name="lidar_joint" type="revolute">
      <origin xyz="0 0 0" rpy="0 0 0" />
      <axis xyz="0 0 1"/>
      <limit effort="1000.0" lower="0.0" upper="0.548" velocity="0.5"/> 
      <parent link="base_lidar" />
      <child link="sonar2_link" />

    <link name="sonar2_link">
        <mass value="100" />
        <origin xyz="0 0 0" rpy="0 0 0" />
        <inertia ixx="0.17" ixy="0" ixz="0" iyy="0.17" iyz="0" izz="0.17" />

    <gazebo reference="sonar2_link">
      <plugin name="set_vel_plugin" filename="~/simulation/gazebo_tutorials/set_velocity/examples/set_vel_plugin/build/">

    <gazebo reference="sonar2_link">
      <sensor type="ray" name="sonar2">
        <pose>0 0 0 0 0 0</pose>
    <plugin name="gazebo_ros_sonar2_controller" filename="">


However when I launch my launch file including this urdf, I get the error:

Warning [] XML Element[plugin], child of element[link] not defined in SDF. Ignoring[plugin]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.

What am I doing wrong? Is there an easier way to setup the lidar sitting on my drone so that it turns around its axis at a given speed? The rest of the simulation runs fine and I had no error until then. Any help would be greatly appreciated! (On that or on my original question concerning Circle mode, by the way)

EDIT ... (more)

edit retag flag offensive close merge delete