Susi Server

Marine Heading

Node ID: marineHeading · Role: Filter · Realtime config: no

Description

Marine attitude and heading from the firmware-ported quaternion Kalman filter: gyro prediction, gravity-referenced tilt, yaw referenced by the continuously hard-iron-calibrated magnetometer (field-validity, tilt-leak, rate and innovation gated), crab-gated GNSS course over ground, or the receiver’s true heading (HDT). Position is raw GNSS passthrough - no position fusion. Outputs FusedPose (raw-GNSS ENU position + true-heading attitude) and GlobalFusedPose (WGS84, for map sinks).

Algorithm notes

How it works

The node estimates attitude from the IMU and turns it into a true-north heading. The gyroscope carries the heading between corrections, gravity from the accelerometer keeps roll and pitch level, and the yaw is anchored by whichever absolute references are available: the magnetometer, the GNSS course over ground, or the receiver’s own true heading. The magnetometer is calibrated continuously while the node runs - it learns the constant magnetic offset of the installation from the sensor data itself, so no swing procedure is needed. Every magnetic sample is checked against the expected local field before it is trusted; disturbed samples are ignored rather than allowed to pull the heading. Position is not fused at all: the GNSS fix is passed straight through, so the output position is exactly the receiver’s.

What you must configure

Set Input gyro unit and Input accel unit to match the sensor feeding the node. Getting these wrong makes the heading drift wildly or the tilt never settle. If you do not have a GNSS input, set Magnetic declination (deg, east positive) for your area, otherwise the heading will be magnetic, not true. With GNSS connected, leave World Magnetic Model reference field on and declination, inclination and field magnitude are taken from your position automatically. Turn on Use receiver true heading (HDT) if the receiver provides a dual-antenna or gyrocompass heading - it is the strongest reference available.

How it starts

Nothing is emitted until the node has an absolute heading reference. The first usable magnetic sample, course over ground, or receiver heading sets the heading immediately, and output begins from there. Tilt settles within a second or two of the first samples. The magnetic calibration keeps improving in the background for minutes afterwards; heading accuracy improves as it converges. With Persist calibration on, the calibration is stored per sensor and reloaded on the next start, so a known installation is accurate much sooner.

Tuning

Troubleshooting

Inputs / Outputs

Config aliases

MarineHeadingFilter, marineHeadingFilter, marineHeading

Properties

Each row shows the setting’s label in the node’s Properties panel and, in code, its key in the node’s settings object in the config file. A setting omitted from the config file uses the default shown here.

PropertyTypeDefaultDescription
Magnetic declination (deg, east positive) declinationDegnumber0.0
Magnetic inclination / dip (deg, down positive) inclinationDegnumber60.0
Expected field magnitude (uT) fieldMagnitudeUtnumber50.0
Field magnitude tolerance (fraction) magnitudeTolerancenumber0.15
Inclination tolerance (deg) inclinationToleranceDegnumber8.0
Calibration forgetting factor rlsForgettingnumber0.9999
Soft-iron scales (diagonal) enableSoftIronbooleanfalse
Soft-iron scale prior sigma softIronScaleSigmanumber2.0
Min field-space sample spacing (uT) minSampleSpacingUtnumber2.0
Magnetometer noise stddev (uT) magNoiseUtnumber0.5
COG truth: min speed (m/s) cogMinSpeedMpsnumber2.0
COG truth: max yaw rate (rad/s) cogMaxYawRateRadSnumber0.02
COG truth: min straight duration (s) cogMinStraightSnumber5.0
Persist calibration persistCalibrationbooleantrue
World Magnetic Model reference field useWmmbooleantrue
Learn local field as gate reference useLocalFieldReferencebooleantrue
Local field time constant (s) localFieldTauSnumber120.0
Deviation card (heading-dependent correction) enableDeviationModelbooleanfalse
Use receiver true heading (HDT) useReceiverHeadingbooleanfalse
Kalman: accelerometer covariance kfAccCovariancenumber0.1
Kalman: magnetometer covariance kfMagCovariancenumber1000.0
Kalman: COG yaw covariance kfCogCovariancenumber10.0
Kalman: receiver heading covariance kfReceiverCovariancenumber1.0
Compass: max rate for mag correction (deg/s) compassMaxRateDegSnumber45.0
Compass: mag innovation gate (deg) compassInnovationGateDegnumber30.0
Compass: innovation gate release (s) compassInnovationReleaseSnumber10.0
Input gyro unit gyroUnitselectdegSOptions: degS, radS.
Input accel unit accelUnitselectgOptions: g, mps2.
Field magnitude gate enableMagnitudeGatebooleantrue
Field inclination gate enableInclinationGatebooleantrue
COG straight-line gate enableCogGatebooleantrue

Example node definition

A minimal entry in config.json looks like the block below. Paste it under the sinks key, keyed by an instance name of your choice. All settings are optional: anything not listed under settings uses the default from the Properties table above. See The configuration file for how the sections and endpoint wiring work.

{
  "sinks": {
    "marineHeading": {
      "dataEndpoint": "inproc://marineHeading_data",
      "inputEndpoints": [
        "inproc://imu_data",
        "inproc://gnss_data"
      ],
      "inputDataFilter": [
        "Imu",
        "Gnss"
      ],
      "settings": {}
    }
  }
}
Loading documentation…