gsf2orientation

Overview

gsf2orientation extracts full time-series attitude packets (GSF_ATTITUDE, record ID 6) from a Generic Sensor Format (.gsf) file and writes them to a binary OMG-HDCS v3 .orientation file.

Usage

gsf2orientation [-v] -gsf <input_name.gsf> -omg <omgfile.orientation>

CLI Options

Flag Arguments Default Description
-gsf <input_name.gsf> Required Path to the input .gsf file.
-omg <omgfile.orientation> Required Path to the output OMG .orientation file.
-v None Off Print every parsed GSF_Attitude packet and individual attitude measurements (time, roll, pitch, heading, heave).

How It Works

  1. Summary Header Initialization: Scans the .gsf file for the first GSF_ATTITUDE packet (seek_GSF_packet), extracts basetime.seconds and basetime.nanoseconds, rewinds the file, and writes an OMG_HDCS_summary_attitude header (fileVersion = 3, status = 15 for RPH+heave).
  2. Bundle Unpacking: Because each GSF_ATTITUDE packet stores a bundle of num_points measurements with millisecond offsets (time_offset[i]) relative to recordBaseTime, gsf2orientation loops over all num_points in each packet, preserves the native GSF integer scaling (hundredths of degrees for roll/pitch/heading, centimeters for heave), and writes each sample to <omgfile.orientation>.

Practical Examples

1. Extract high-rate attitude from a GSF file:

gsf2orientation -v -gsf line01.gsf -omg line01.orientation