Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

What part of the sdf file is sdf::ElementPtr in the load() function?

Suppose we have a Sdf file .world, like this one:

<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">

    <model name="my_velodyne">
      <include>
        <uri>model://velodyne_hdl32</uri>
      </include>

      <!-- Attach the plugin to this model -->
      <plugin name="velodyne_control" filename="libvelodyne_plugin.so">
        <velocity>25</velocity> 
      </plugin>
    </model>

  </world>
</sdf>

When the load() function is called, for example:

#include <gazebo/gazebo.hh>
#include <gazebo/physics/physics.hh>

namespace gazebo
{
  class VelodynePlugin : public ModelPlugin
  {
    /// \brief Constructor
    public: VelodynePlugin() {}

    public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
    {
    }
};

  // Tell Gazebo about this plugin, so that Gazebo can call Load on this plugin.
  GZ_REGISTER_MODEL_PLUGIN(VelodynePlugin)
}

What part of the Sdf file is sdf::ElementPtr _sdf?