18 #ifndef USV_GAZEBO_PLUGINS_WIND_HH_ 19 #define USV_GAZEBO_PLUGINS_WIND_HH_ 26 #include <gazebo/common/CommonTypes.hh> 27 #include <gazebo/common/Plugin.hh> 28 #include <ignition/math/Vector3.hh> 29 #include <gazebo/physics/physics.hh> 88 public:
virtual void Load(physics::WorldPtr _parent,
89 sdf::ElementPtr _sdf);
92 protected:
virtual void Update();
95 private: std::vector<UsvWindPlugin::WindObj>
windObjs;
128 private: std::unique_ptr<ros::NodeHandle>
rosNode;
double windMeanVelocity
Average wind velocity.
physics::ModelPtr model
Pointer to the model
bool debug
Bool debug set by environment var VRX_DEBUG
physics::LinkPtr link
Pointer to model link in gazebo, optionally specified by the bodyName parameter, The states are taken...
physics::WorldPtr world
Pointer to the Gazebo world.
unsigned int windObjsInitCount
Bool to keep track if ALL of the windObjs have been initialized.
std::vector< UsvWindPlugin::WindObj > windObjs
vector of simple objects effected by the wind
std::unique_ptr< ros::NodeHandle > rosNode
ROS node handle.
double filterGain
Calculated filter gain constant.
double lastPublishTime
Last time wind speed and direction was published.
A plugin that simulates a simple wind model. It accepts the following parameters: ...
double updateRate
Update rate buffer for wind speed and direction.
ros::Publisher windSpeedPub
Publisher for wind speed.
ignition::math::Vector3d windDirection
Wind velocity unit vector in Gazebo coordinates [m/s].
double previousTime
Previous time.
std::string linkName
of the link on that model
event::ConnectionPtr updateConnection
Pointer to the update event connection.
bool init
to show weather the model and link pointers have been set
double timeConstant
Time constant.
bool windObjsInit
Bool to keep track if ALL of the windObjs have been initialized.
UsvWindPlugin()
Constructor.
double gainConstant
User specified gain constant.
virtual void Update()
Callback executed at every physics update.
std::unique_ptr< std::mt19937 > randGenerator
virtual ~UsvWindPlugin()=default
Destructor.
std::string topicWindDirection
Topic where the wind direction is published.
std::string topicWindSpeed
Topic where the wind speed is published.
double varVel
Variable velocity component.
ignition::math::Vector3d windCoeff
Wind force coefficients.
virtual void Load(physics::WorldPtr _parent, sdf::ElementPtr _sdf)
ros::Publisher windDirectionPub
Publisher for wind direction.