23 #ifndef ROTORS_GAZEBO_PLUGINS_GAZEBO_WIND_PLUGIN_H 24 #define ROTORS_GAZEBO_PLUGINS_GAZEBO_WIND_PLUGIN_H 28 #include <gazebo/common/common.hh> 29 #include <gazebo/common/Plugin.hh> 30 #include <gazebo/gazebo.hh> 31 #include <gazebo/physics/physics.hh> 37 #include "WindSpeed.pb.h" 38 #include "WrenchStamped.pb.h" 95 void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
99 void OnUpdate(
const common::UpdateInfo& );
152 std::vector<float>
u_;
153 std::vector<float>
v_;
154 std::vector<float>
w_;
168 ignition::math::Vector3d
LinearInterpolation(
double position, ignition::math::Vector3d * values,
double* points)
const;
179 ignition::math::Vector3d
BilinearInterpolation(
double* position, ignition::math::Vector3d * values,
double* points)
const;
190 ignition::math::Vector3d
TrilinearInterpolation(ignition::math::Vector3d link_position, ignition::math::Vector3d * values,
double* points)
const;
209 #endif // ROTORS_GAZEBO_PLUGINS_GAZEBO_WIND_PLUGIN_H double wind_force_variance_
static const std::string kDefaultFrameId
ignition::math::Vector3d BilinearInterpolation(double *position, ignition::math::Vector3d *values, double *points) const
Bilinear interpolation.
static constexpr double kDefaultWindGustForceVariance
static const std::string kDefaultLinkName
common::Time wind_gust_start_
event::ConnectionPtr update_connection_
Pointer to the update event connection.
void OnUpdate(const common::UpdateInfo &)
Called when the world is updated.
static constexpr bool kDefaultUseCustomStaticWindField
double wind_gust_force_variance_
virtual ~GazeboWindPlugin()
static constexpr double kDefaultWindForceMean
std::vector< float > vertical_spacing_factors_
static constexpr double kDefaultWindGustStart
double wind_gust_force_mean_
static const ignition::math::Vector3d kDefaultWindGustDirection
common::Time wind_gust_end_
static constexpr double kDefaultWindGustForceMean
static constexpr double kDefaultWindSpeedMean
static const std::string kDefaultNamespace
bool pubs_and_subs_created_
Flag that is set to true once CreatePubsAndSubs() is called, used to prevent CreatePubsAndSubs() from...
void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
Load the plugin.
ignition::math::Vector3d wind_direction_
static const std::string kDefaultWindSpeedPubTopic
bool use_custom_static_wind_field_
Variables for custom wind field generation.
std::vector< float > top_z_
static constexpr double kDefaultWindGustDuration
gazebo::transport::NodePtr node_handle_
ignition::math::Vector3d wind_gust_direction_
gz_mav_msgs::WindSpeed wind_speed_msg_
Gazebo message for sending wind speed data.
ignition::math::Vector3d xyz_offset_
gazebo::transport::PublisherPtr wind_force_pub_
static constexpr double kDefaultWindForceVariance
ignition::math::Vector3d LinearInterpolation(double position, ignition::math::Vector3d *values, double *points) const
Functions for trilinear interpolation of wind field at aircraft position.
This gazebo plugin simulates wind acting on a model.
std::string wind_force_pub_topic_
void CreatePubsAndSubs()
Creates all required publishers and subscribers, incl. routing of messages to/from ROS if required...
ignition::math::Vector3d TrilinearInterpolation(ignition::math::Vector3d link_position, ignition::math::Vector3d *values, double *points) const
Trilinear interpolation.
double wind_speed_variance_
std::string wind_speed_pub_topic_
gz_geometry_msgs::WrenchStamped wrench_stamped_msg_
Gazebo message for sending wind data.
std::vector< float > bottom_z_
static constexpr double kDefaultWindSpeedVariance
static const ignition::math::Vector3d kDefaultWindDirection
gazebo::transport::PublisherPtr wind_speed_pub_
void ReadCustomWindField(std::string &custom_wind_field_path)
Reads wind data from a text file and saves it.