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 ...
No comments:
Post a Comment