Class inertialsim::sensors::INS¶
ClassList > inertialsim > sensors > INS
#include <ins.h>
Public Functions¶
| Type | Name |
|---|---|
| INS (const INSModel & model, const INSSpecification & specification, std::optional< uint64_t > seed=0, INSSimulationMode mode=INSSimulationMode::BATCH) Construct an INS . |
|
| std::optional< INSData > | Initialize (const std::optional< geodesy::GlobalPose > & pose=std::nullopt, const std::optional< geometry::Vector > & angular_rate=std::nullopt, const std::optional< geometry::Vector > & specific_force=std::nullopt) Initialize the INS sensor. |
| void | Reset (const std::optional< geometry::Rotation > & attitude=std::nullopt, const std::optional< geodesy::Coordinates > & position=std::nullopt, const std::optional< geometry::Vector > & velocity=std::nullopt) Reset the INS state. |
| INSData | Simulate (const geometry::Vector & angular_rate, const geometry::Vector & specific_force) Simulate INS measurements fromIMU inputs. |
| INSData | Simulate (const Measurement & angular_rate, const Measurement & specific_force) Simulate INS measurements fromMeasurement inputs. |
| bool | initialized () const Check if the INS is initialized. |
| INSSimulationMode | mode () const Get the simulation mode. |
| const INSModel & | model () const Get the INS model. |
| const std::mt19937_64 & | rng () const Get the random number generator. |
| const INSSpecification & | specification () const Get the INS specification. |
| const INSState & | state () const Get the simulation state. |
Detailed Description¶
An INS integrates data from a gyro and an accelerometer to produce attitude (orientation), position, and velocity outputs. The class supports both batch and real-time simulation modes.
Before calling Simulate(), the INS must be initialized via the Initialize() method. This provides the initial attitude (orientation), position, and velocity of the INS. The INS also inherits the navigation coordinate frame from the initial condition inputs, along with any geodetic datums and models.
Public Functions Documentation¶
function INS¶
Construct an INS .
inertialsim::sensors::INS::INS (
const INSModel & model,
const INSSpecification & specification,
std::optional< uint64_t > seed=0,
INSSimulationMode mode=INSSimulationMode::BATCH
)
INS sensors require a model which specifies which sources of error to simulate; a specification which includes the parameters necessary to model deterministic and random errors; and optionally a random number generator seed to control determinism and repeatability of the simulation.
Two modes are supported: BATCH (default) and REALTIME. In BATCH mode, the Simulate() method should be called once with all inputs to return all simulated measurement outputs. In REALTIME mode, the Simulate() method can be called repeatedly to incrementally simulate measurements.
Before calling Simulate(), the INS must be initialized via the Initialize() method. This provides the initial attitude (orientation), position, and velocity of the INS. The INS also inherits the navigation coordinate frame from the initial condition inputs, along with any geodetic datums and models.
Parameters:
modelINS model options specifying error sources.specificationINS specification with error parameters.seedRandom number generator seed (nullopt for random, 0 for deterministic default).modeSimulation mode: BATCH (default) or REALTIME.
function Initialize¶
Initialize the INS sensor.
std::optional< INSData > inertialsim::sensors::INS::Initialize (
const std::optional< geodesy::GlobalPose > & pose=std::nullopt,
const std::optional< geometry::Vector > & angular_rate=std::nullopt,
const std::optional< geometry::Vector > & specific_force=std::nullopt
)
Set the initial attitude, position, and velocity of the INS sensor. If using REALTIME mode for incremental simulation, users must also supply the initial angular rate and specific force inputs.
Initial pose should be specified as a GlobalPose object. The navigation frame, gravity, and earth rotation rate models will be inherited from the initial conditions.
If the pose input is nullopt, a local frame with identity initial pose, zero position, zero velocity, and standard gravity will be used.
All inputs must be a single sample representing the initial conditions at the start of navigation.
Parameters:
poseInitial attitude, position, and velocity of the INS relative to Earth. Must have velocity data and contain exactly one pose.angular_rateInitial angular rate of the INS. Only required in REALTIME mode.specific_forceInitial specific force experienced by the INS. Only required in REALTIME mode.
Returns:
INSData with initial pose. Only returned in REALTIME mode.
Exception:
std::invalid_argumentif pose navigation frame is not supported (must be ECEF, GEODETIC, TOPOCENTRIC, or LOCAL).std::invalid_argumentif pose does not contain exactly one sample.std::invalid_argumentif pose does not have velocity data.std::invalid_argumentif in REALTIME mode and angular_rate or specific_force are not provided.
function Reset¶
Reset the INS state.
void inertialsim::sensors::INS::Reset (
const std::optional< geometry::Rotation > & attitude=std::nullopt,
const std::optional< geodesy::Coordinates > & position=std::nullopt,
const std::optional< geometry::Vector > & velocity=std::nullopt
)
Resets the internal INS attitude (orientation), position, and/or velocity from an external reference. Reset can be used to simulate the behavior of an aided INS sensor. For example, resetting the entire state can simulate the behavior of a sensor where GNSS measurements correct attitude, position, and velocity errors through correlations in a state estimation filter.
All inputs are optional and must be supplied relative to the navigation coordinate system established at initialization.
Parameters:
attitudeReference attitude to reset to (nullopt to keep current).positionReference position to reset to (nullopt to keep current).velocityReference velocity to reset to (nullopt to keep current).
Exception:
std::runtime_errorif INS is not initialized.
function Simulate [1/2]¶
Simulate INS measurements fromIMU inputs.
INSData inertialsim::sensors::INS::Simulate (
const geometry::Vector & angular_rate,
const geometry::Vector & specific_force
)
An INS integrates data from a gyro and an accelerometer to produce attitude (orientation), position, and velocity outputs. Initial conditions must be specified using the Initialize() method before calling this method.
Inputs must have compatible shape and time. The angular rate input must be the angular rate of the gyro relative to inertial space as measured in gyro coordinates. The specific force input must be the specific force (non-gravitational acceleration) relative to inertial space acting on the accelerometer as measured in accelerometer coordinates.
The effect of Earth's rotation and gravity will be modeled based on the coordinates and datums specified in the initial conditions.
In REALTIME mode with the RK4 integrator, consecutive pairwise inputs must be supplied, e.g., two angular rates and two specific forces at times (1-2, 3-4, 5-6, ...). The first of the two samples is used as the mid-point of the integration interval and the output is given coincident with the second sample.
If the input data is itself simulated, see Gyro::Simulate(), Accelerometer::Simulate(), and IMU::Simulate().
Parameters:
angular_rateAngular rate of the INS relative to inertial space, measured in gyro coordinates. Must include time data.specific_forceSpecific force experienced by the INS relative to inertial space, measured in accelerometer coordinates. Must include time data.
Returns:
INSData containing simulated measurements.
Exception:
std::runtime_errorif INS is not initialized.std::invalid_argumentif inputs have incompatible times.std::invalid_argumentif insufficient samples provided (minimum 2 for BATCH mode with Euler/Trapezoid integrators, minimum 3 for RK4 integrator).
function Simulate [2/2]¶
Simulate INS measurements fromMeasurement inputs.
INSData inertialsim::sensors::INS::Simulate (
const Measurement & angular_rate,
const Measurement & specific_force
)
Convenience overload that accepts Measurement objects instead of Vector objects. See the primary Simulate() method for detailed documentation.
Parameters:
angular_rateAngular rate measurement.specific_forceSpecific force measurement.
Returns:
INSData containing simulated measurements.
function initialized¶
Check if the INS is initialized.
Returns:
True if initialized.
function mode¶
Get the simulation mode.
Returns:
Simulation mode.
function model¶
Get the INS model.
Returns:
Reference to the model.
function rng¶
Get the random number generator.
Returns:
Reference to the RNG.
function specification¶
Get the INS specification.
Returns:
Reference to the specification.
function state¶
Get the simulation state.
Returns the simulation state including all internal sensor parameters required to replicate the simulated measurement outputs.
Returns:
Reference to the INS state.
Exception:
std::runtime_errorif INS is not initialized.
The documentation for this class was generated from the following file cpp/include/inertialsim/sensors/ins.h