45 lines
1.6 KiB
Python
45 lines
1.6 KiB
Python
import ctypes
|
|
from ..datatypes.navigation import Semicircle, Velocity, Acceleration
|
|
|
|
# Minimal placeholders
|
|
class RelativeTimetag(ctypes.Union):
|
|
_pack_ = 1
|
|
_fields_ = [("raw", ctypes.c_uint16)]
|
|
|
|
class AttitudeRate(ctypes.Union):
|
|
_pack_ = 1
|
|
_fields_ = [("raw", ctypes.c_int16)]
|
|
|
|
class AngAcc(ctypes.Union):
|
|
_pack_ = 1
|
|
_fields_ = [("raw", ctypes.c_int16)]
|
|
|
|
class MsgInuHighSpeedPayload(ctypes.Structure):
|
|
_pack_ = 1
|
|
_fields_ = [
|
|
("mode_word", ctypes.c_uint16), # 2 bytes
|
|
("timetag", RelativeTimetag), # 2 bytes
|
|
("x_vel", ctypes.c_uint32), # 4 bytes (OLD uses 4, not 2!)
|
|
("y_vel", ctypes.c_uint32), # 4 bytes
|
|
("z_vel", ctypes.c_uint32), # 4 bytes
|
|
("platform_azimuth", Semicircle),
|
|
("roll", Semicircle),
|
|
("pitch", Semicircle),
|
|
("roll_rate", AttitudeRate),
|
|
("pitch_rate", AttitudeRate),
|
|
("yaw_rate", AttitudeRate),
|
|
("longitudinal_acc", Acceleration),
|
|
("lateral_acc", Acceleration),
|
|
("normal_acc", Acceleration),
|
|
("ptaz_tt", RelativeTimetag),
|
|
("roll_tt", RelativeTimetag),
|
|
("pitch_tt", RelativeTimetag), # 2 bytes
|
|
("roll_ang_acc", ctypes.c_uint64), # 8 bytes (OLD uses 8, not 2!)
|
|
("pitch_ang_acc", ctypes.c_uint64), # 8 bytes
|
|
("yaw_ang_acc", ctypes.c_uint64) # 8 bytes,
|
|
]
|
|
|
|
# Rimosso __init__ perché ctypes.Structure gestisce automaticamente
|
|
# l'inizializzazione. x_vel, y_vel, z_vel ora sono c_uint32,
|
|
# e ang_acc sono c_uint64.
|