Magnetometer
To simulate the measurements produced by a magnetometer, we resort to the same declination D, nclination I angles, and magnetic strength S pre-computed tables provided in PX4-SITL [MHP15], obtained from the World Magnetic Model (WMM) from 2018 [oC20].
Classes:
The class that implements a magnetometer sensor. |
- class pegasus.simulator.logic.sensors.magnetometer.Magnetometer
Bases:
Sensor
The class that implements a magnetometer sensor. This class inherits the base class Sensor.
Methods:
__init__
([config])Initialize the Magnetometer class
update
(state, dt)Method that should be implemented by the class that inherits Sensor.
Attributes:
(dict) The 'state' of the sensor, i.e. the data produced by the sensor at any given point in time.
- __init__(config={})
Initialize the Magnetometer class
- Parameters:
config (dict) – A Dictionary that contains all the parameters for configuring the Magnetometer - it can be empty or only have some of the parameters used by the Magnetometer.
Examples
The dictionary default parameters are
>>> {"noise_density": 0.4e-3, # gauss / sqrt(hz) >>> "random_walk": 6.4e-6, # gauss * sqrt(hz) >>> "bias_correlation_time": 6.0e2, # s >>> "update_rate": 250.0} # Hz
- update(state, dt)
Method that should be implemented by the class that inherits Sensor. This is where the actual implementation of the sensor should be performed.
- property state
(dict) The ‘state’ of the sensor, i.e. the data produced by the sensor at any given point in time