Class AttitudeEstimator
java.lang.Object
com.irurueta.navigation.inertial.estimators.AttitudeEstimator
Estimates the attitude of a body by taking into account both accelerometer
and magnetometer measurements.
Although
LevelingEstimator
and LevelingEstimator2
can
estimate body attitude just by using IMU measurements (accelerometer +
gyroscope), they require the gyroscope to be accurate enough (aviation
grade accuracy) to obtain reliable results.
When the gyroscope is known to not be accurate (e.g. mobile devices),
this class should be used instead to use a magnetometer to obtain a
reliable attitude estimation.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final WMMEarthMagneticFluxDensityEstimator
Estimator of the World Magnetic Model. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate static double
convertAcceleration
(com.irurueta.units.Acceleration acceleration) Converts an instance of acceleration to meters per squared second (m/s^2).private static double
convertAngle
(com.irurueta.units.Angle angle) Converts a given angle instance into radians.private static double
convertDistance
(com.irurueta.units.Distance distance) Converts a given distance instance into meters.static com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(double fx, double fy, double fz, double bx, double by, double bz, double declination) Gets body attitude expressed in the local navigation frame.static com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(double latitude, double height, double fx, double fy, double fz, double bx, double by, double bz, double declination) Gets body attitude expressed in the local navigation frame.com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(double latitude, double longitude, double height, double year, double fx, double fy, double fz, double bx, double by, double bz) Gets body attitude expressed in the local navigation frame.void
getAttitude
(double latitude, double longitude, double height, double year, double fx, double fy, double fz, double bx, double by, double bz, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.static void
getAttitude
(double latitude, double height, double fx, double fy, double fz, double bx, double by, double bz, double declination, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.static void
getAttitude
(double fx, double fy, double fz, double bx, double by, double bz, double declination, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(double latitude, double longitude, double height, Date timestamp, double fx, double fy, double fz, double bx, double by, double bz) Gets body attitude expressed in the local navigation frame.void
getAttitude
(double latitude, double longitude, double height, Date timestamp, double fx, double fy, double fz, double bx, double by, double bz, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(double latitude, double longitude, double height, GregorianCalendar calendar, double fx, double fy, double fz, double bx, double by, double bz) Gets body attitude expressed in the local navigation frame.void
getAttitude
(double latitude, double longitude, double height, GregorianCalendar calendar, double fx, double fy, double fz, double bx, double by, double bz, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(com.irurueta.navigation.frames.NEDPosition position, double year, BodyKinematics kinematics, BodyMagneticFluxDensity b) Gets body attitude expressed in the local navigation frame.void
getAttitude
(com.irurueta.navigation.frames.NEDPosition position, double year, BodyKinematics kinematics, BodyMagneticFluxDensity b, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.static com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(com.irurueta.navigation.frames.NEDPosition position, BodyKinematics kinematics, BodyMagneticFluxDensity b, double declination) Gets body attitude expressed in the local navigation frame.static void
getAttitude
(com.irurueta.navigation.frames.NEDPosition position, BodyKinematics kinematics, BodyMagneticFluxDensity b, double declination, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.static com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(com.irurueta.navigation.frames.NEDPosition position, BodyKinematics kinematics, BodyMagneticFluxDensity b, com.irurueta.units.Angle declination) Gets body attitude expressed in the local navigation frame.static void
getAttitude
(com.irurueta.navigation.frames.NEDPosition position, BodyKinematics kinematics, BodyMagneticFluxDensity b, com.irurueta.units.Angle declination, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(com.irurueta.navigation.frames.NEDPosition position, Date timestamp, BodyKinematics kinematics, BodyMagneticFluxDensity b) Gets body attitude expressed in the local navigation frame.void
getAttitude
(com.irurueta.navigation.frames.NEDPosition position, Date timestamp, BodyKinematics kinematics, BodyMagneticFluxDensity b, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(com.irurueta.navigation.frames.NEDPosition position, GregorianCalendar calendar, BodyKinematics kinematics, BodyMagneticFluxDensity b) Gets body attitude expressed in the local navigation frame.void
getAttitude
(com.irurueta.navigation.frames.NEDPosition position, GregorianCalendar calendar, BodyKinematics kinematics, BodyMagneticFluxDensity b, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.static com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(BodyKinematics kinematics, BodyMagneticFluxDensity b, double declination) Gets body attitude expressed in the local navigation frame.static void
getAttitude
(BodyKinematics kinematics, BodyMagneticFluxDensity b, double declination, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.static com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(BodyKinematics kinematics, BodyMagneticFluxDensity b, com.irurueta.units.Angle declination) Gets body attitude expressed in the local navigation frame.static void
getAttitude
(BodyKinematics kinematics, BodyMagneticFluxDensity b, com.irurueta.units.Angle declination, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.static com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(com.irurueta.units.Acceleration fx, com.irurueta.units.Acceleration fy, com.irurueta.units.Acceleration fz, double bx, double by, double bz, com.irurueta.units.Angle declination) Gets body attitude expressed in the local navigation frame.static void
getAttitude
(com.irurueta.units.Acceleration fx, com.irurueta.units.Acceleration fy, com.irurueta.units.Acceleration fz, double bx, double by, double bz, com.irurueta.units.Angle declination, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.static com.irurueta.navigation.frames.CoordinateTransformation
getAttitude
(com.irurueta.units.Angle latitude, com.irurueta.units.Distance height, com.irurueta.units.Acceleration fx, com.irurueta.units.Acceleration fy, com.irurueta.units.Acceleration fz, double bx, double by, double bz, com.irurueta.units.Angle declination) Gets body attitude expressed in the local navigation frame.static void
getAttitude
(com.irurueta.units.Angle latitude, com.irurueta.units.Distance height, com.irurueta.units.Acceleration fx, com.irurueta.units.Acceleration fy, com.irurueta.units.Acceleration fz, double bx, double by, double bz, com.irurueta.units.Angle declination, com.irurueta.navigation.frames.CoordinateTransformation result) Gets body attitude expressed in the local navigation frame.static double
getMagneticHeading
(double bx, double by, double bz, double roll, double pitch) Returns magnetic heading (angle respect Earth magnetic north).static double
getMagneticHeading
(double bx, double by, double bz, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch) Returns magnetic heading (angle respect Earth magnetic north).static double
getMagneticHeading
(BodyMagneticFluxDensity b, double roll, double pitch) Returns magnetic heading (angle respect Earth magnetic north).static double
getMagneticHeading
(BodyMagneticFluxDensity b, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch) Returns magnetic heading (angle respect Earth magnetic north).static com.irurueta.units.Angle
getMagneticHeadingAsAngle
(double bx, double by, double bz, double roll, double pitch) Returns magnetic heading (angle respect Earth magnetic north).static void
getMagneticHeadingAsAngle
(double bx, double by, double bz, double roll, double pitch, com.irurueta.units.Angle result) Returns magnetic heading (angle respect Earth magnetic north).static com.irurueta.units.Angle
getMagneticHeadingAsAngle
(double bx, double by, double bz, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch) Returns magnetic heading (angle respect Earth magnetic north).static void
getMagneticHeadingAsAngle
(double bx, double by, double bz, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch, com.irurueta.units.Angle result) Returns magnetic heading (angle respect Earth magnetic north).static com.irurueta.units.Angle
getMagneticHeadingAsAngle
(BodyMagneticFluxDensity b, double roll, double pitch) Returns magnetic heading (angle respect Earth magnetic north).static void
getMagneticHeadingAsAngle
(BodyMagneticFluxDensity b, double roll, double pitch, com.irurueta.units.Angle result) Returns magnetic heading (angle respect Earth magnetic north).static com.irurueta.units.Angle
getMagneticHeadingAsAngle
(BodyMagneticFluxDensity b, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch) Returns magnetic heading (angle respect Earth magnetic north).static void
getMagneticHeadingAsAngle
(BodyMagneticFluxDensity b, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch, com.irurueta.units.Angle result) Returns magnetic heading (angle respect Earth magnetic north).static double
getYaw
(double bx, double by, double bz, double declination, double roll, double pitch) Returns body yaw angle resolved around NED frame.static double
getYaw
(double bx, double by, double bz, com.irurueta.units.Angle declination, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch) Returns body yaw angle resolved around NED frame.static double
getYaw
(BodyMagneticFluxDensity b, double declination, double roll, double pitch) Returns body yaw angle resolved around NED frame.static double
getYaw
(BodyMagneticFluxDensity b, com.irurueta.units.Angle declination, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch) Returns body yaw angle resolved around NED frame.static com.irurueta.units.Angle
getYawAsAngle
(double bx, double by, double bz, double declination, double roll, double pitch) Returns body yaw angle resolved around NED frame.static void
getYawAsAngle
(double bx, double by, double bz, double declination, double roll, double pitch, com.irurueta.units.Angle result) Returns body yaw angle resolved around NED frame.static com.irurueta.units.Angle
getYawAsAngle
(double bx, double by, double bz, com.irurueta.units.Angle declination, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch) Returns body yaw angle resolved around NED frame.static void
getYawAsAngle
(double bx, double by, double bz, com.irurueta.units.Angle declination, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch, com.irurueta.units.Angle result) Returns body yaw angle resolved around NED frame.static com.irurueta.units.Angle
getYawAsAngle
(BodyMagneticFluxDensity b, double declination, double roll, double pitch) Returns body yaw angle resolved around NED frame.static void
getYawAsAngle
(BodyMagneticFluxDensity b, double declination, double roll, double pitch, com.irurueta.units.Angle result) Returns body yaw angle resolved around NED frame.static com.irurueta.units.Angle
getYawAsAngle
(BodyMagneticFluxDensity b, com.irurueta.units.Angle declination, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch) Returns body yaw angle resolved around NED frame.static void
getYawAsAngle
(BodyMagneticFluxDensity b, com.irurueta.units.Angle declination, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch, com.irurueta.units.Angle result) Returns body yaw angle resolved around NED frame.
-
Field Details
-
wmmEstimator
Estimator of the World Magnetic Model. This is used to determine magnetic declination angle at a given Earth position and instant.
-
-
Constructor Details
-
AttitudeEstimator
Constructor. This constructor loads the default WMM, which is valid from 2020, January 1st until 2025, January 1st.- Throws:
IOException
- if an I/O error occurs while loading the WMM model.
-
-
Method Details
-
getAttitude
public com.irurueta.navigation.frames.CoordinateTransformation getAttitude(double latitude, double longitude, double height, double year, double fx, double fy, double fz, double bx, double by, double bz) Gets body attitude expressed in the local navigation frame. Internally this implementation uses a given World Magnetic Model (WMM) to estimate the magnetic declination angle at a given Earth position and timestamp. Besides, a leveling algorithm is used to estimate roll and pitch attitude angles, which can later be used to estimate yaw attitude angle with estimated declination angle and provided magnetometer measurements.- Parameters:
latitude
- Earth position latitude expressed in radians (rad).longitude
- Earth position longitude expressed in radians (rad).height
- Earth position height respect average sea level expressed in meters (m).year
- a year expressed in decimal value.fx
- x-coordinate of measured body specific force expressed in meters per squared second (m/s^2).fy
- y-coordinate of measured body specific force expressed in meters per squared second (m/s^2).fz
- z-coordinate of measured body specific force expressed in meters per squared second (m/s^2).bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).- Returns:
- a coordinate transformation containing body attitude.
- See Also:
-
getAttitude
public com.irurueta.navigation.frames.CoordinateTransformation getAttitude(double latitude, double longitude, double height, GregorianCalendar calendar, double fx, double fy, double fz, double bx, double by, double bz) Gets body attitude expressed in the local navigation frame. Internally this implementation uses a given World Magnetic Model (WMM) to estimate the magnetic declination angle at a given Earth position and timestamp. Besides, a leveling algorithm is used to estimate roll and pitch attitude angles, which can later be used to estimate yaw attitude angle with estimated declination angle and provided magnetometer measurements.- Parameters:
latitude
- Earth position latitude expressed in radians (rad).longitude
- Earth position longitude expressed in radians (rad).height
- Earth position height respect average sea level expressed in meters (m).calendar
- a calendar indicating a given timestamp.fx
- x-coordinate of measured body specific force expressed in meters per squared second (m/s^2).fy
- y-coordinate of measured body specific force expressed in meters per squared second (m/s^2).fz
- z-coordinate of measured body specific force expressed in meters per squared second (m/s^2).bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).- Returns:
- a coordinate transformation containing body attitude.
- See Also:
-
getAttitude
public com.irurueta.navigation.frames.CoordinateTransformation getAttitude(double latitude, double longitude, double height, Date timestamp, double fx, double fy, double fz, double bx, double by, double bz) Gets body attitude expressed in the local navigation frame. Internally this implementation uses a given World Magnetic Model (WMM) to estimate the magnetic declination angle at a given Earth position and timestamp. Besides, a leveling algorithm is used to estimate roll and pitch attitude angles, which can later be used to estimate yaw attitude angle with estimated declination angle and provided magnetometer measurements.- Parameters:
latitude
- Earth position latitude expressed in radians (rad).longitude
- Earth position longitude expressed in radians (rad).height
- Earth position height respect average sea level expressed in meters (m).timestamp
- a timestamp.fx
- x-coordinate of measured body specific force expressed in meters per squared second (m/s^2).fy
- y-coordinate of measured body specific force expressed in meters per squared second (m/s^2).fz
- z-coordinate of measured body specific force expressed in meters per squared second (m/s^2).bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).- Returns:
- a coordinate transformation containing body attitude.
- See Also:
-
getAttitude
public static com.irurueta.navigation.frames.CoordinateTransformation getAttitude(double fx, double fy, double fz, double bx, double by, double bz, double declination) Gets body attitude expressed in the local navigation frame. Internally this implementation uses a leveling algorithm to estimate roll and pitch attitude angles, which can later be used to find yaw attitude angle along with magnetometer measurements.- Parameters:
fx
- x-coordinate of measured body specific force expressed in meters per squared second (m/s^2).fy
- y-coordinate of measured body specific force expressed in meters per squared second (m/s^2).fz
- z-coordinate of measured body specific force expressed in meters per squared second (m/s^2).bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).declination
- declination angle of Earth magnetic flux density at current Earth position and instant expressed in radians. Declination angle changes depending on instant and location. Declination angle can be obtained throughWMMEarthMagneticFluxDensityEstimator.getDeclination(NEDPosition, Date)
or usingEarthMagneticFluxDensityEstimator.getDeclination(NEDMagneticFluxDensity)
- Returns:
- a coordinate transformation containing body attitude.
- See Also:
-
getAttitude
public static com.irurueta.navigation.frames.CoordinateTransformation getAttitude(com.irurueta.units.Acceleration fx, com.irurueta.units.Acceleration fy, com.irurueta.units.Acceleration fz, double bx, double by, double bz, com.irurueta.units.Angle declination) Gets body attitude expressed in the local navigation frame. Internally this implementation uses a leveling algorithm to estimate roll and pitch attitude angles, which can later be used to find yaw attitude angle along with magnetometer measurements.- Parameters:
fx
- x-coordinate of measured body specific force.fy
- y-coordinate of measured body specific force.fz
- z-coordinate of measured body specific force.bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).declination
- declination angle of Earth magnetic flux density at current Earth position and instant. Declination angle changes depending on instant and location. Declination angle can be obtained throughWMMEarthMagneticFluxDensityEstimator.getDeclination(NEDPosition, Date)
or usingEarthMagneticFluxDensityEstimator.getDeclination(NEDMagneticFluxDensity)
- Returns:
- a coordinate transformation containing body attitude.
- See Also:
-
getAttitude
public static com.irurueta.navigation.frames.CoordinateTransformation getAttitude(double latitude, double height, double fx, double fy, double fz, double bx, double by, double bz, double declination) Gets body attitude expressed in the local navigation frame. Internally this implementation uses a leveling algorithm to estimate roll and pitch attitude angles, which can later be used to find yaw attitude angle along with magnetometer measurements. Because latitude and height are also known, those are taken into account considering actual Earth shape to obtain a slightly more accurate estimation of roll and pitch attitude angles (and thus also a more accurate yaw angle estimation).- Parameters:
latitude
- device latitude expressed in radians (rad).height
- device height expressed in meters (m).fx
- x-coordinate of measured body specific force expressed in meters per squared second (m/s^2).fy
- y-coordinate of measured body specific force expressed in meters per squared second (m/s^2).fz
- z-coordinate of measured body specific force expressed in meters per squared second (m/s^2).bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).declination
- declination angle of Earth magnetic flux density at current Earth position and instant expressed in radians. Declination angle changes depending on instant and location. Declination angle can be obtained throughWMMEarthMagneticFluxDensityEstimator.getDeclination(NEDPosition, Date)
or usingEarthMagneticFluxDensityEstimator.getDeclination(NEDMagneticFluxDensity)
- Returns:
- a coordinate transformation containing body attitude.
- See Also:
-
getAttitude
public static com.irurueta.navigation.frames.CoordinateTransformation getAttitude(com.irurueta.units.Angle latitude, com.irurueta.units.Distance height, com.irurueta.units.Acceleration fx, com.irurueta.units.Acceleration fy, com.irurueta.units.Acceleration fz, double bx, double by, double bz, com.irurueta.units.Angle declination) Gets body attitude expressed in the local navigation frame. Internally this implementation uses a leveling algorithm to estimate roll and pitch attitude angles, which can later be used to find yaw attitude angle along with magnetometer measurements. Because latitude and height are also known, those are taken into account considering actual Earth shape to obtain a slightly more accurate estimation of roll and pitch attitude angles (and thus also a more accurate yaw angle estimation).- Parameters:
latitude
- device latitude.height
- device height.fx
- x-coordinate of measured body specific force.fy
- y-coordinate of measured body specific force.fz
- z-coordinate of measured body specific force.bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).declination
- declination angle of Earth magnetic flux density at current Earth position and instant. Declination angle changes depending on instant and location. Declination angle can be obtained throughWMMEarthMagneticFluxDensityEstimator.getDeclination(NEDPosition, Date)
or usingEarthMagneticFluxDensityEstimator.getDeclination(NEDMagneticFluxDensity)
- Returns:
- a coordinate transformation containing body attitude.
- See Also:
-
getMagneticHeading
public static double getMagneticHeading(double bx, double by, double bz, double roll, double pitch) Returns magnetic heading (angle respect Earth magnetic north).- Parameters:
bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).roll
- known body roll angle expressed in radians (rad).pitch
- known body pitch angle expressed in radians (rad).- Returns:
- magnetic heading expressed in radians (rad).
-
getMagneticHeading
public static double getMagneticHeading(double bx, double by, double bz, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch) Returns magnetic heading (angle respect Earth magnetic north).- Parameters:
bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).roll
- known body roll angle.pitch
- known body pitch angle.- Returns:
- magnetic heading expressed in radians (rad).
-
getMagneticHeadingAsAngle
public static void getMagneticHeadingAsAngle(double bx, double by, double bz, double roll, double pitch, com.irurueta.units.Angle result) Returns magnetic heading (angle respect Earth magnetic north).- Parameters:
bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).roll
- known body roll angle expressed in radians (rad).pitch
- known body pitch angle expressed in radians (rad).result
- instance where magnetic heading will be stored.
-
getMagneticHeadingAsAngle
public static com.irurueta.units.Angle getMagneticHeadingAsAngle(double bx, double by, double bz, double roll, double pitch) Returns magnetic heading (angle respect Earth magnetic north).- Parameters:
bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).roll
- known body roll angle expressed in radians (rad).pitch
- known body pitch angle expressed in radians (rad).- Returns:
- magnetic heading.
-
getMagneticHeadingAsAngle
public static void getMagneticHeadingAsAngle(double bx, double by, double bz, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch, com.irurueta.units.Angle result) Returns magnetic heading (angle respect Earth magnetic north).- Parameters:
bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).roll
- known body roll angle.pitch
- known body pitch angle.result
- instance where magnetic heading will be stored.
-
getMagneticHeadingAsAngle
public static com.irurueta.units.Angle getMagneticHeadingAsAngle(double bx, double by, double bz, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch) Returns magnetic heading (angle respect Earth magnetic north).- Parameters:
bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).roll
- known body roll angle.pitch
- known body pitch angle.- Returns:
- magnetic heading.
-
getYaw
public static double getYaw(double bx, double by, double bz, double declination, double roll, double pitch) Returns body yaw angle resolved around NED frame. Yaw angle represents the true heading, and indicates the angle respect the true geographic north.- Parameters:
bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).declination
- declination angle of Earth magnetic flux density at current Earth position and instant expressed in radians. Declination angle changes depending on instant and location. Declination angle can be obtained throughWMMEarthMagneticFluxDensityEstimator.getDeclination(NEDPosition, Date)
or usingEarthMagneticFluxDensityEstimator.getDeclination(NEDMagneticFluxDensity)
roll
- known body roll angle expressed in radians (rad).pitch
- known body pitch angle expressed in radians (rad).- Returns:
- body yaw angle (a.k.a. true heading) expressed in radians (rad).
- See Also:
-
getYaw
public static double getYaw(double bx, double by, double bz, com.irurueta.units.Angle declination, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch) Returns body yaw angle resolved around NED frame. Yaw angle represents the true heading, and indicates the angle respect the true geographic north.- Parameters:
bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).declination
- declination angle of Earth magnetic flux density at current Earth position and instant. Declination angle changes depending on instant and location. Declination angle can be obtained throughWMMEarthMagneticFluxDensityEstimator.getDeclination(NEDPosition, Date)
or usingEarthMagneticFluxDensityEstimator.getDeclination(NEDMagneticFluxDensity)
roll
- known body roll angle.pitch
- known body pitch angle.- Returns:
- body yaw angle (a.k.a. true heading) expressed in radians (rad).
- See Also:
-
getYawAsAngle
public static void getYawAsAngle(double bx, double by, double bz, double declination, double roll, double pitch, com.irurueta.units.Angle result) Returns body yaw angle resolved around NED frame. Yaw angle represents the true heading, and indicates the angle respect the true geographic north.- Parameters:
bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).declination
- declination angle of Earth magnetic flux density at current Earth position and instant expressed in radians. Declination angle changes depending on instant and location. Declination angle can be obtained throughWMMEarthMagneticFluxDensityEstimator.getDeclination(NEDPosition, Date)
or usingEarthMagneticFluxDensityEstimator.getDeclination(NEDMagneticFluxDensity)
roll
- known body roll angle expressed in radians (rad).pitch
- known body pitch angle expressed in radians (rad).result
- instance where body yaw angle (a.k.a. true heading) will be stored.- See Also:
-
getYawAsAngle
public static com.irurueta.units.Angle getYawAsAngle(double bx, double by, double bz, double declination, double roll, double pitch) Returns body yaw angle resolved around NED frame. Yaw angle represents the true heading, and indicates the angle respect the true geographic north.- Parameters:
bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).declination
- declination angle of Earth magnetic flux density at current Earth position and instant expressed in radians. Declination angle changes depending on instant and location. Declination angle can be obtained throughWMMEarthMagneticFluxDensityEstimator.getDeclination(NEDPosition, Date)
or usingEarthMagneticFluxDensityEstimator.getDeclination(NEDMagneticFluxDensity)
roll
- known body roll angle expressed in radians (rad).pitch
- known body pitch angle expressed in radians (rad).- Returns:
- body yaw angle (a.k.a. true heading).
- See Also:
-
getYawAsAngle
public static void getYawAsAngle(double bx, double by, double bz, com.irurueta.units.Angle declination, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch, com.irurueta.units.Angle result) Returns body yaw angle resolved around NED frame. Yaw angle represents the true heading, and indicates the angle respect the true geographic north.- Parameters:
bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).declination
- declination angle of Earth magnetic flux density at current Earth position and instant. Declination angle changes depending on instant and location. Declination angle can be obtained throughWMMEarthMagneticFluxDensityEstimator.getDeclination(NEDPosition, Date)
or usingEarthMagneticFluxDensityEstimator.getDeclination(NEDMagneticFluxDensity)
roll
- known body roll angle.pitch
- known body pitch angle.result
- instance where body yaw angle (a.k.a. true heading) will be stored.- See Also:
-
getYawAsAngle
public static com.irurueta.units.Angle getYawAsAngle(double bx, double by, double bz, com.irurueta.units.Angle declination, com.irurueta.units.Angle roll, com.irurueta.units.Angle pitch) Returns body yaw angle resolved around NED frame. Yaw angle represents the true heading, and indicates the angle respect the true geographic north.- Parameters:
bx
- x coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).by
- y coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).bz
- z coordinate of measured magnetic flux density resolved around body axes and expressed in Teslas (T).declination
- declination angle of Earth magnetic flux density at current Earth position and instant. Declination angle changes depending on instant and location. Declination angle can be obtained throughWMMEarthMagneticFluxDensityEstimator.getDeclination(NEDPosition, Date)
or usingEarthMagneticFluxDensityEstimator.getDeclination(NEDMagneticFluxDensity)
roll
- known body roll angle.pitch
- known body pitch angle.- Returns:
- body yaw angle (a.k.a. true heading).
- See Also:
-
convertDistance
private static double convertDistance(com.irurueta.units.Distance distance) Converts a given distance instance into meters.- Parameters:
distance
- distance to be converted.- Returns:
- converted value expressed in meters.
-
convertAngle
private static double convertAngle(com.irurueta.units.Angle angle) Converts a given angle instance into radians.- Parameters:
angle
- angle to be converted.- Returns:
- converted value expressed in radians.
-
convertAcceleration
private static double convertAcceleration(com.irurueta.units.Acceleration acceleration) Converts an instance of acceleration to meters per squared second (m/s^2).- Parameters:
acceleration
- acceleration instance to be converted.- Returns:
- converted acceleration value.