17 #ifndef ROTORS_GAZEBO_PLUGINS_PRESSURE_PLUGIN_H 18 #define ROTORS_GAZEBO_PLUGINS_PRESSURE_PLUGIN_H 22 #include <glog/logging.h> 24 #include <gazebo/common/Plugin.hh> 25 #include <gazebo/common/common.hh> 26 #include <gazebo/gazebo.hh> 27 #include <gazebo/physics/physics.hh> 29 #include "FluidPressure.pb.h" 43 kMeanMolecularAirWeightKgPerKmol /
64 void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
67 void OnUpdate(
const common::UpdateInfo&);
125 #endif // ROTORS_GAZEBO_PLUGINS_PRESSURE_PLUGIN_H static constexpr double kEarthRadiusMeters
std::normal_distribution NormalDistribution
event::ConnectionPtr updateConnection_
Pointer to the update event connection.
physics::LinkPtr link_
Pointer to the link.
NormalDistribution pressure_n_[1]
Normal distribution for pressure noise.
double pressure_var_
Pressure measurement variance (Pa^2).
physics::ModelPtr model_
Pointer to the model.
static constexpr double kMeanMolecularAirWeightKgPerKmol
GazeboPressurePlugin()
Constructor.
physics::WorldPtr world_
Pointer to the world.
std::string frame_id_
Frame ID for pressure messages.
void OnUpdate(const common::UpdateInfo &)
This gets called by the world update start event.
gz_sensor_msgs::FluidPressure pressure_message_
Fluid pressure message.
gazebo::transport::PublisherPtr pressure_pub_
Pressure message publisher.
gazebo::transport::NodePtr node_handle_
Handle for the Gazebo node.
bool pubs_and_subs_created_
Flag that is set to true once CreatePubsAndSubs() is called, used to prevent CreatePubsAndSubs() from...
static constexpr double kPressureOneAtmospherePascals
static const std::string kDefaultPressurePubTopic
static constexpr double kDefaultPressureVar
double ref_alt_
Reference altitude (meters).
std::mt19937 random_generator_
static constexpr double kSeaLevelTempKelvin
static constexpr double kTempLapseKelvinPerMeter
void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
Called when the plugin is first created, and after the world has been loaded. This function should no...
static constexpr double kGasConstantNmPerKmolKelvin
static constexpr double kDefaultRefAlt
virtual ~GazeboPressurePlugin()
Destructor.
static constexpr double kAirConstantDimensionless
static constexpr double kGravityMagnitude
void CreatePubsAndSubs()
Creates all required publishers and subscribers, incl. routing of messages to/from ROS if required...
std::string namespace_
Transport namespace.
std::string pressure_topic_
Topic name for pressure messages.