omg_sbet
Overview & Purpose
omg_sbet reads and converts Applanix POSPac SBET (Smoothed Best Estimate of Trajectory) binary files into Ocean Mapping Group (OMG) navigation (jcu_nav_rec) and HDCS attitude (OMG_HDCS_attitude) structures. Post-processed inertial/GNSS trajectory files in SBET format consist of packed 136-byte records of 17 IEEE-754 little-endian double-precision floats representing high-rate time, position, ellipsoidal height, 3D velocities, Euler attitude angles, wander angle, body accelerations, and angular rates.
Key Data Structures, Constants & Macros
Constants
OMG_SBET_SIZE(136bytes): Exact on-disk byte size of a single binary SBET record ($17 \times 8$-bytedoublefields).
Data Structures
OMG_SBET: Unpacked in-memory representation of a single SBET epoch:double gps_time: GPS seconds of the week.double latitude: Latitude in radians.double longitude: Longitude in radians.double altitude: Ellipsoidal height (meters).double x_velocity,double y_velocity,double z_velocity: North, East, and Down velocities (m/s).double roll,double pitch,double platform_heading,double wander_angle: Attitude and wander angles in radians.double x_acceleration,double y_acceleration,double z_acceleration: Body frame accelerations ($\text{m/s}^2$).double x_angular_rate,double y_angular_rate,double z_angular_rate: Angular rates ($\text{rad/s}$).
Public Functions & Signatures
int init_OMG_SBET(OMG_SBET *sbet)- Zero-initializes an
OMG_SBETstructure usingmemset.
- Zero-initializes an
int read_OMG_SBET(OMG_SBET *sbet, FILE *infile)- Reads
OMG_SBET_SIZE(136) bytes frominfileand unpacks all 17 little-endiandoublefields intosbetviaget_LE_double()fromjb_endian.h.
- Reads
int print_OMG_SBET(OMG_SBET *sbet)- Prints a single-line summary of the SBET record (
gps_time,latitude,longitude,altitude,roll,pitch,platform_heading) tostdout.
- Prints a single-line summary of the SBET record (
int convert_OMG_SBET(double base_time, OMG_SBET *sbet, jcu_nav_rec *nav, OMG_HDCS_attitude *orientation, OMG_HDCS_summary_attitude *orientation_header)- Converts a raw
OMG_SBETrecord into OMG navigation and attitude records:- Time: Adds
sbet->gps_time(GPS seconds of week) tobase_time(Unix epoch of the start of the GPS week). Splits the result into integer seconds (nav->time) and truncated centiseconds (nav->centisecs = (int)((time - (int)time) * 100.0)), ensuring compatibility withthin_nav. - Position & Ellipsoidal Height: Converts
latitudeandlongitudefrom radians to decimal degrees ($\times 180/\pi$) and stores ellipsoidalaltitudeinnav->azi(the convention expected bymergeTidefor GPS tide/height processing). - Attitude: Computes
orientation->timeOffsetrelative toorientation_header->refTime * 100.0scaled byorientation_header->timeScale. Convertsroll,pitch, andplatform_headingfrom radians to hundredths of a degree ($\times 100 \times 180/\pi$), wrapping heading into $[0^\circ, 360^\circ]$.
- Time: Adds
- Converts a raw
How It Fits Into the OMG Architecture
omg_sbet is used by sbet2nav (code/jonnyb/gom_stuff/sbet2nav.c) to ingest post-processed Applanix SBET trajectories and simultaneously generate .nav (jcu_nav format for mergeNav and mergeTide) and .orientation (OMG HDCS attitude format for newMergeAtt) files.