Showing posts with label Applanix. Show all posts
Showing posts with label Applanix. Show all posts

Monday, October 19, 2020

WebApp to convert an Applanix smooth best estimated trajectory (SBET) binary file to comma-separated value (CSV) file

An Applanix (https://www.applanix.com) smooth best estimated trajectory (SBET) binary file is a common file you may encounter when working in field LiDAR, and aerial photo data collection. It is basically a refined trajectory of the real time navigation of the path taken in the field data collection process.

I wrote an online WebApp tool (https://dominoc925-pages.appspot.com/webapp/sbetcsv/default.html) to convert an SBET file (typically with an extension *.out) to a comma-separated value (CSV) file, and compressed to a ZIP file for easier transportation. The extraction, conversion and compression processes take place inside a Web browser locally only; there is no requirement to upload to a web server so that will save on the time and data connection costs.

To use this converter, simply visit the web site https://dominoc925-pages.appspot.com/webapp/sbetcsv/default.html with any modern web browser.

Then, just drag and drop an SBET file, e.g. SBET.OUT onto the indicated area. Or click the Browse button and select the SBET file. Then click Open.

A process indicator will be displayed while the conversion is taking place. After the conversion has completed, a download link will appear as shown below.

 

Click the link to download the zip file and extract out the converted CSV file. An example of the result of the conversion is shown below. 

 

Monday, November 14, 2011

C# code snippet to read an Applanix SBET file

The smoothed best estimated trajectory (SBET) file of an air survey flight created and exported by the Applanix PosPac software is a simple binary format. The SBET file is just a series of records with the following double fields, as described by the C# code below:

public class SbetRecord
{
    public double time;    //GPS seconds of week
    public double latRad;    //latitude in radians
    public double lonRad;    //longitude in radians
    public double alt;    //altitude
    public double xVel;    //velocity in x direction
    public double yVel;    //velocity in y direction
    public double zVel;    //velocity in z direction
    public double roll;    //roll angle
    public double pitch;    //pitch angle
    public double heading;    //heading angle
    public double wander;    //wander
    public double xForce;    //force in x direction
    public double yForce;    //force in y direction
    public double zForce;    //force in z direction
    public double xAngRate;    //angular rate in x direction
    public double yAngRate;    //angular rate in y direction
    public double zAngRate;    //angular rate in z direction
}

Then just use a BinaryReader to open up the file and read in the fields as doubles as shown in the code snippet below.
SbetRecord rec = new SbetRecord();
// Open an SBET file for reading...
BinaryReader reader = new BinaryReader(File.Open(@"C:\Temp\sbet1.out", FileMode.Open, FileAccess.Read));
 
// ...read a record...
rec.time = reader.ReadDouble();
rec.latRad = reader.ReadDouble();
rec.lonRad = reader.ReadDouble();
rec.alt = reader.ReadDouble();
rec.xVel = reader.ReadDouble();
rec.yVel = reader.ReadDouble();
rec.zVel = reader.ReadDouble();
rec.roll = reader.ReadDouble();
rec.pitch = reader.ReadDouble();
rec.heading = reader.ReadDouble();
rec.wander = reader.ReadDouble();
rec.xForce = reader.ReadDouble();
rec.yForce = reader.ReadDouble();
rec.zForce = reader.ReadDouble();
rec.xAngRate = reader.ReadDouble();
rec.yAngRate = reader.ReadDouble();
rec.zAngRate = reader.ReadDouble();
 
// ... etc ...