Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

load yaml parameters to my gazebo body

I am trying to load some yaml parameters in my model,here is my code. The variable N is supposed to be 6, but it shows always a random number and seems like the parameter loading is not succesfull. What is wrong with my code. how can I fix it

namespace gazebo {

class DronePlugin : public ModelPlugin

{ int N=6;

public: DronePlugin() {}

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

this->model = _model;

if (!ros::isInitialized())

{ int argc = 0; char **argv = NULL;

ros::init(argc, argv, "gazebo_client",


this->rosNode.reset(new ros::NodeHandle("gazebo_client"));

this->rosNode->param("rotor_number", N, N); }