Gazebo | Ignition | Community
Ask Your Question

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

asked 2017-06-18 10:30:40 -0500

michael1234 gravatar image

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">

      <!-- Attach the plugin to this model -->
      <plugin name="velodyne_control" filename="">


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.

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-06-19 08:47:29 -0500

sloretz gravatar image

I believe _sdf is the <plugin>...</plugin> element. It helps plugins load parameters from the SDF file. The Random Velocity Plugin tutorial has some code that makes use of the sdf::ElementPtr.

edit flag offensive delete link more


Thanks sloretz!

michael1234 gravatar imagemichael1234 ( 2017-06-20 09:30:48 -0500 )edit

Question Tools

1 follower


Asked: 2017-06-18 10:30:40 -0500

Seen: 2,325 times

Last updated: Jun 19 '17