77 this->
rosMsg.header.frame_id = this->
link->GetName();
82 this->
rosMsg.magnetic_field_covariance[0] =
84 this->
rosMsg.magnetic_field_covariance[4] =
86 this->
rosMsg.magnetic_field_covariance[8] =
91 this->
rosNode->advertise<sensor_msgs::MagneticField>(
97 this->
gazeboNode->Advertise<sensor_msgs::msgs::Magnetic>(
111 ignition::math::Pose3d pose;
113 #if GAZEBO_MAJOR_VERSION >= 8 114 pose = this->
link->WorldPose();
116 pose = this->
link->GetWorldPose().Ign();
119 ignition::math::Vector3d noise(
135 sensor_msgs::msgs::Magnetic gazeboMsg;
137 gazebo::msgs::Vector3d* field =
new gazebo::msgs::Vector3d();
141 gazeboMsg.set_allocated_magnetic_field(field);
double GetGaussianNoise(double _amp)
Returns noise value for a function with zero mean from the default Gaussian noise model...
MagnetometerParameters parameters
Magnetometer configuration parameters:
void publish(const boost::shared_ptr< M > &message) const
tf::StampedTransform tfLocalNEDFrame
Local NED TF frame.
bool EnableMeasurement(const common::UpdateInfo &_info) const
Enables generation of simulated measurement if the timeout since the last update has been reached...
ignition::math::Vector3d measMagneticField
Last measurement of magnetic field.
bool enableLocalNEDFrame
True if a the local NED frame needs to be broadcasted.
void SendLocalNEDTransform()
Returns true if the base_link_ned frame exists.
double noiseAmp
Noise amplitude.
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
Load the plugin.
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
Load plugin and its configuration from sdf,.
bool AddNoiseModel(std::string _name, double _sigma)
Add noise normal distribution to the list.
transport::NodePtr gazeboNode
Gazebo's node handle for transporting measurement messages.
double declination
Declination of reference earth magnetic field [rad].
virtual bool OnUpdate(const common::UpdateInfo &_info)
Update sensor measurement.
transport::PublisherPtr gazeboSensorOutputPub
Gazebo's publisher for transporting measurement messages.
ignition::math::Pose3d localNEDFrame
Pose of the local NED frame wrt link frame.
double heading
Heading angle of reference earth magnetic field [rad].
double intensity
Intensity of reference earth magnetic field [muT].
ignition::math::Vector3d turnOnBias
Constant turn-on bias [muT].
physics::LinkPtr link
Pointer to the link.
sensor_msgs::MagneticField rosMsg
ROS message.
double noiseZ
Discrete-time standard dev. of output noise in z-axis [muT].
std::string sensorOutputTopic
Name of the sensor's output topic.
ros::Publisher rosSensorOutputPub
Gazebo's publisher for transporting measurement messages.
ignition::math::Vector3d magneticFieldWorld
Reference magnetic field in world frame:
double inclination
Inclination of reference earth magnetic field [rad].
MagnetometerROSPlugin()
Class constructor.
boost::shared_ptr< ros::NodeHandle > rosNode
ROS node handle for communication with ROS.
double turnOnBias
Standard deviation of constant systematic offset of measurements [muT].
GZ_REGISTER_MODEL_PLUGIN(GazeboRosP3D)
std::string robotNamespace
Robot namespace.
bool gazeboMsgEnabled
Flag set to true if the Gazebo sensors messages are supposed to be published as well (it can avoid un...
virtual ~MagnetometerROSPlugin()
Class destructor.
double noiseXY
Discrete-time standard dev. of output noise in xy-axis [muT].