Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcknowledgePacket ¶
type AcknowledgePacket struct { Id uint16 Result AcknowledgeResult }
type AcknowledgeResult ¶
type AcknowledgeResult uint8
const ( AckSuccess AcknowledgeResult = 0x01 AckFailure AcknowledgeResult = 0xFF )
type CmdFunction ¶
type CmdFunction uint8
const ( FncStartSequence CmdFunction = 0b0000_0001 << iota FncSetActuator FncResetActuator FncSetActuators FncResetActuators FncSetActuatorsState )
type CommandPacket ¶
type CommandPacket struct { Id uint16 Function CmdFunction Argument Actuator }
type Milliseconds ¶
type Milliseconds uint64
func (Milliseconds) Duration ¶
func (ms Milliseconds) Duration() time.Duration
type RocketPacket ¶
type RocketPacket struct { // Time is the number of milliseconds since start Time Milliseconds `csv:"time"` State state.State `csv:"state"` // Temperature is in Celsius (°C). // [-30; 45] Temperature float32 `csv:"temperature"` // Humidity is a percentage. // [0; 100] Humidity float32 `csv:"humidity"` // AtmosPressure is in Pascal (Pa). // [0-101325] AtmosPressure int32 `csv:"atmos_pressure"` // Altitude is in meters (m) Altitude float32 `csv:"altitude"` // Latitude is the GPS latitude in degree. // [-90;90] Latitude float32 `csv:"latitude"` // Longitude is the GPS longitude in degree. // [-180;180] Longitude float32 `csv:"longitude"` // Satellites is the number of GPS satellites the rocket is connected to. Satellites uint8 `csv:"nb_sat"` // Acceleration is the gravitationnal force experienced by the rocket in g (or m/s²). Acceleration Vector `csv:"accel_,inline"` // AngularVelocity is the angular speed of the rocket in radian per seconds. AngularVelocity Vector `csv:"angular_speed_,inline"` // Orientation is the pitch, roll and yaw of the rocket Orientation Vector `csv:"orient_,inline"` // Magnetism is in millitesla (mT) Magnetism Vector `csv:"magnet_,inline"` Voltages `csv:"v_,inline"` TestBench `csv:"test_,inline"` }
RocketPacket represents a packet of data received from the rocket.
NOTE: The fields/properties of the struct must be in the same order as the binary data received.
type VoltagePSI ¶
type VoltagePSI float32
func (VoltagePSI) PSI ¶
func (v VoltagePSI) PSI() float32
PSI transforms the voltage to PSI. // [0;5] => [0;1000]
type Voltages ¶
type Voltages struct { Rocket float32 `csv:"rocket"` // [0;15] Tower float32 `csv:"tower"` // [0;15] IgnitionBox float32 `csv:"ignition_box"` // [0;15] Item3 VoltagePSI `csv:"item3"` // [0;5] Item17 VoltagePSI `csv:"item17"` // [0;5] Item18 VoltagePSI `csv:"item18"` // [0;5] Item19 VoltagePSI `csv:"item19"` // [0;5] }
Click to show internal directories.
Click to hide internal directories.