17 #ifndef ROTORS_GAZEBO_PLUGINS_MAGNETOMETER_PLUGIN_H 18 #define ROTORS_GAZEBO_PLUGINS_MAGNETOMETER_PLUGIN_H 22 #include <gazebo/common/common.hh> 23 #include <gazebo/common/Plugin.hh> 24 #include <gazebo/gazebo.hh> 25 #include <gazebo/physics/physics.hh> 27 #include "MagneticField.pb.h" 51 void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
52 void OnUpdate(
const common::UpdateInfo&);
99 #endif // ROTORS_GAZEBO_PLUGINS_MAGNETOMETER_PLUGIN_H
void CreatePubsAndSubs()
Creates all required publishers and subscribers, incl. routing of messages to/from ROS if required...
gz_sensor_msgs::MagneticField mag_message_
Magnetic field message.
bool pubs_and_subs_created_
Flag that is set to true once CreatePubsAndSubs() is called, used to prevent CreatePubsAndSubs() from...
event::ConnectionPtr updateConnection_
ignition::math::Vector3d mag_W_
virtual ~GazeboMagnetometerPlugin()
void OnUpdate(const common::UpdateInfo &)
static constexpr double kDefaultRefMagEast
NormalDistribution noise_n_[3]
std::normal_distribution NormalDistribution
std::uniform_real_distribution UniformDistribution
std::mt19937 random_generator_
static constexpr double kDefaultRefMagDown
std::random_device random_device_
gazebo::transport::NodePtr node_handle_
gazebo::transport::PublisherPtr magnetometer_pub_
physics::LinkPtr link_
Pointer to the link.
GazeboMagnetometerPlugin()
physics::ModelPtr model_
Pointer to the model.
std::string magnetometer_topic_
void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
static constexpr double kDefaultRefMagNorth
physics::WorldPtr world_
Pointer to the world.