Skip to content

CoreSimIns.h#

ROS/acres_core_sim/include/acres_core_sim/CoreSimIns.h Generated

The Polaris' OxTS AV200 INS as the game's sensor recorder models it (AcresSensors.cpp FAcresSensorRecorder::InsEpoch), fed from the Core's chassis: one epoch of the sensor stream's INS frame (AcresSensorStream.h EIns, 40 float64) at base_footprint, with the game's error model and datum chain.

Errors: six unit first-order Gauss-Markov states (east, north, up, heading, roll, pitch; x' = a x + sqrt(1 - a^2) n, a = exp(-dt / tau), started from their stationary distribution) scaled by the position (up x 1.5), heading and attitude sigmas; white noise on position, velocity, specific force and angular rate. A PCG32 stream (O'Neill 2014, the game's FAcresPcg32) seeded as the game seeds its INS stream (sensors.json seed + 5 x 1009, sequence 6) draws 18 Gaussians per epoch (Box-Muller, cosine branch), always, so noise off changes no other draw. Specific force: the finite difference of the reported point's velocity plus gravity, in body axes (the first epoch and the first after a teleport report gravity alone). Geodetic: NAD83(2011) (the INS's "nad83" frame, an RTK fix from the Indiana network), UTM zone ins.utm_zone, the grid rotation from a point 10 m grid-north, recomputed every epoch. Fix status 2 (RTK), covariance sigma^2 (east, north) and 2.25 sigma^2 (up) with sigma^2 = position sigma^2 + white^2.

Not modelled: the GNSS receiver behind the INS (the game's AcresGnssModel with sky view, RTK state machine and outages; the Polaris' INS stream does not use it either, only its datum chain).

One agent's thread only.

FInsConfig#

struct FInsConfig

sensors_polaris.json "ins" (with sensors.json's seed).

Name Type Unit Default Description
Hz double 100 Rate, Hz; reported point in base_footprint FLU, m.
PosSigmaM, PosTauS, PosWhiteM, HeadingSigmaDeg, AttitudeSigmaDeg, VelWhiteMps, AccelWhiteMps2, GyroWhiteRadps double Gauss-Markov position sigma, m, and correlation time, s; white position noise, m; heading and roll / pitch sigmas, deg; white noise of velocity (m/s), specific force (m/s2) and angular rate (rad/s).
UtmZone int 16 UTM zone; "nad83" (the only frame ported); false zeroes every error (the game's -SensorNoNoise).
Seed uint64_t 42 sensors.json seed.

FInsConfig::Load#

Reads the "ins" block of sensors_polaris.json and the seed of sensors.json.

Argument Description
ContentDir Acres/Content/Simulation.
Error Why it failed (may be null).

Returns: False on a read error or an unsupported frame.

bool Load(const std::string& ContentDir, std::string* Error = nullptr);

FPcg32#

struct FPcg32

PCG32 (pcg32_srandom_r / XSH-RR of the PCG reference implementation), the game's FAcresPcg32.

FPcg32::Seed#

Seeds as pcg32_srandom_r: the increment becomes 2 Seq + 1.

void Seed(uint64_t InitState, uint64_t Seq);

FPcg32::Next#

Next 32-bit output.

uint32_t Next();

FPcg32::Uniform#

Uniform in (0, 1), never 0 or 1.

double Uniform() ;

FPcg32::Gaussian#

Standard normal draw (Box-Muller, cosine branch; two uniforms).

double Gaussian();

EInsField#

enum EInsField : int

Index of each float64 of an INS frame (AcresSensorStream.h EIns; acres_sim stream.hpp InsField).

Value Description
InsUtmE
InsUtmN
InsUtmH
InsUtmQx
InsUtmQy
InsUtmQz
InsUtmQw
InsVelX
InsVelY
InsVelZ
InsGyroX
InsGyroY
InsGyroZ
InsAccelX
InsAccelY
InsAccelZ
InsLat
InsLon
InsHeight
InsCovE
InsCovN
InsCovU
InsEnuQx
InsEnuQy
InsEnuQz
InsEnuQw
InsEnuX
InsEnuY
InsEnuZ
InsFixStatus
InsGridRotationDeg
InsUtmZone
InsTruthX
InsTruthY
InsTruthZ
InsTruthQx
InsTruthQy
InsTruthQz
InsTruthQw
InsTruthSpeed
InsFieldCount

FInsModel#

class FInsModel

One agent's INS. See the file comment.

FInsModel::Init#

Configures and seeds the error states (Seed + 5 x 1009 + 7919 x Agent, sequence 6: agent 0 draws the game's stream).

void Init(const FInsConfig& Config, const FSiteGeoreference* Geo, int Agent = 0);

FInsModel::Due#

Due at this time? The game's scheduler: first epoch at the first sample, then every 1 / Hz (1e-8 s slack).

bool Due(double TimeS);

FInsModel::Teleported#

Restarts the specific-force difference (a teleport must not read as acceleration).

void Teleported() ;

FInsModel::Epoch#

One epoch.

Argument Description
TimeS Simulation time, s.
Footprint base_footprint, world (grid ENU) m.
Orientation Body FLU -> world.
Com Centre of mass, world m. Velocity, AngularVelocity: Centre-of-mass velocity and angular velocity, world, m/s and rad/s.
Out The frame's 40 values (EInsField order).
void Epoch(double TimeS, const AcresCore::FVec3& Footprint, const AcresCore::FQuat& Orientation, const AcresCore::FVec3& Com, const AcresCore::FVec3& Velocity, const AcresCore::FVec3& AngularVelocity, std::array<double, InsFieldCount>& Out);