API Documentation
Encoding and Decoding
- naviguider_simpleserial.decode_event(ticks: int, fields: list[str]) → Event[source]
Decodes response fields to an Event.
- Parameters:
ticks – The decoded ticks value.
fields – The fields to decode.
- Returns:
The decoded Event.
- naviguider_simpleserial.decode_line(line: str) → Event[source]
Decodes a response string to an event.
- Parameters:
line – The response string to decode.
- Returns:
A decoded event.
- naviguider_simpleserial.decode_meta_event(ticks: int, fields: list[str]) → MetaEvent[source]
Decodes response fields to a MetaEvent.
- Parameters:
ticks – The decoded ticks value.
fields – The fields to decode.
- Returns:
The decoded MetaEvent.
- naviguider_simpleserial.decode_meta_event_type(meta_event_type: str) → MetaEventType[source]
Decodes a meta event type name or id string to a MetaEventType enum value.
- Parameters:
meta_event_string – The meta event tu[e name or id string to decode.
- Returns:
The decoded MetaEvent enum value.
- naviguider_simpleserial.decode_sensor_event(ticks: int, fields: list[str]) → SensorEvent[source]
Decodes response fields to a SensorEvent.
- Parameters:
ticks – The decoded ticks value.
fields – The fields to decode.
- Returns:
The decoded SensorEvent.
- naviguider_simpleserial.decode_test_result_value(test_result_value: str) → TestResult[source]
Decodes a test result name or id string to a TestResult enum value.
- Parameters:
test_result_string – The test result name or id string to decode.
- Returns:
The decoded TestResult enum value.
- naviguider_simpleserial.decode_wakeup_event(ticks: int, fields: list[str]) → WakeupEvent[source]
Decodes response fields to a WakeupEvent.
- Parameters:
ticks – The decoded ticks value.
fields – The fields to decode.
- Returns:
The decoded WakeupEvent.
- naviguider_simpleserial.encode_autocal_start() → str[source]
Encodes the autocal start command to a string.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_autocal_stop() → str[source]
Encodes the autocal stop command to a string.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_power_down() → str[source]
Encodes the power down command to a string.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_save() → str[source]
Encodes the save calibration parameters command to a string.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_self_test() → str[source]
Encodes the self-test command to a string.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_accelerometer_sensor_rate(rate: float) → str[source]
Encodes the set accelerometer sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_application_mode(application_mode: ApplicationMode) → str[source]
Encodes the set application mode command to a string.
- Parameters:
application_mode – The application mode to set.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_coordinate_system(coordinate_system: CoordinateSystem) → str[source]
Encodes the set coordinate system command to a string.
- Parameters:
coordinate_system – The coordinate system to set.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_custom_application_mode(overall_merge: float, mag_merge: float, accel_merge: float, dynamic_accel: int, still_delay: int) → str[source]
Encodes the set custom application mode command to a string.
- Parameters:
overall_merge – The overall merge rate to use.
mag_merge – The mag merge rate to use.
accel_merge – The accel merge rate to use.
- Dynamic accel:
The dynamic accel value to use.
- Still_delay:
The still delay value to use.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_game_rotation_vector_sensor_rate(rate: float) → str[source]
Encodes the set game rotation vector sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_geomag_rotation_vector_sensor_rate(rate: float) → str[source]
Encodes the set geo-magnetic rotation vector sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_gravity_sensor_rate(rate: float) → str[source]
Encodes the set gravity sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_gyroscope_sensor_rate(rate: float) → str[source]
Encodes the set gyroscope sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_gyroscope_uncalibrated_sensor_rate(rate: float) → str[source]
Encodes the set gyroscope uncalibrated sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_linear_acceleration_sensor_rate(rate: float) → str[source]
Encodes the set linear acceleration sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_magnetometer_sensor_rate(rate: float) → str[source]
Encodes the set magnetometer sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_magnetometer_uncalibrated_sensor_rate(rate: float) → str[source]
Encodes the set magnetometer uncalibrated sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_meta_event_reporting_off() → str[source]
Encodes the set meta event reporting off command to a string.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_meta_event_reporting_on() → str[source]
Encodes the set meta event reporting on command to a string.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_mounting_option(mounting_option: MountingOption) → str[source]
Encodes the set mounting option command to a string.
- Parameters:
mounting_option – The mounting option to set.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_orientation_sensor_rate(rate: float) → str[source]
Encodes the set orientation sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_pressure_sensor_rate(rate: float) → str[source]
Encodes the set pressure sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_rotation_vector_sensor_rate(rate: float) → str[source]
Encodes the set rotation vector sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_sensor_event_reporting_off() → str[source]
Encodes the set sensor event reporting off command to a string.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_sensor_event_reporting_on() → str[source]
Encodes the set sensor event reporting on command to a string.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_temperature_sensor_rate(rate: float) → str[source]
Encodes the set temperature sensor command to a string.
- Parameters:
rate – The desired output data rate in Hz.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_verbose_mode_off() → str[source]
Encodes the set verbose mode off command to a string.
- Returns:
The encoded command string.
- naviguider_simpleserial.encode_set_verbose_mode_on() → str[source]
Encodes the set verbose mode on command to a string.
- Returns:
The encoded command string.
Events
- class naviguider_simpleserial.event.Event(ticks: int)[source]
Base class for events.
- ticks: int
Number of clock ticks since boot.
- class naviguider_simpleserial.wakeup_event.WakeupEvent(ticks: int)[source]
Event reported when device powers up or wakes from sleep.
Meta Events
- class naviguider_simpleserial.meta_event.CalStatusChangedMetaEvent(ticks: int, cal_status: int, transient: int)[source]
Event reported when calibration status has changed.
- class naviguider_simpleserial.meta_event.CalibrationStableMetaEvent(ticks: int, is_stable: bool)[source]
Event reported when calibration is stable.
- class naviguider_simpleserial.meta_event.DynamicRangeChangedMetaEvent(ticks: int, sensor_type: SensorType)[source]
Event reported when the dynamic range for a sensor has changed.
- class naviguider_simpleserial.meta_event.ErrorMetaEvent(ticks: int, error_register: int, debug_state: int)[source]
Event reported when a general error has occurred.
- class naviguider_simpleserial.meta_event.FifoOverflowMetaEvent(ticks: int, loss_count: int)[source]
Event reported when the event FIFO has overflowed.
- class naviguider_simpleserial.meta_event.FifoWatermarkMetaEvent(ticks: int, bytes_remaining: int)[source]
Event reported when the event FIFO is about to overflow.
- class naviguider_simpleserial.meta_event.InitializedMetaEvent(ticks: int, ram_version: int)[source]
Event reported when the device has completed initialization.
- class naviguider_simpleserial.meta_event.MagTransientMetaEvent(ticks: int, transient_detected: bool)[source]
Event reported when magnetic transient has been detected.
- class naviguider_simpleserial.meta_event.PowerModeChangedMetaEvent(ticks: int, sensor_type: SensorType)[source]
Event reported when the power mode for a sensor has changed.
- class naviguider_simpleserial.meta_event.SampleRateChangedMetaEvent(ticks: int, sensor_type: SensorType)[source]
Event reported when the sample rate for a sensor has changed.
- class naviguider_simpleserial.meta_event.SelfTestResultMetaEvent(ticks: int, sensor_type: SensorType, test_result: TestResult)[source]
Event reported when a self-test result is available.
- class naviguider_simpleserial.meta_event.SensorErrorMetaEvent(ticks: int, sensor_type: SensorType, status: int)[source]
Event reported when a sensor error has occurred.
Sensor Events
- class naviguider_simpleserial.sensor_event.SensorEvent(ticks: int)[source]
Base class for sensor events.
- ticks: int
Number of clock ticks since boot.
- class naviguider_simpleserial.sensor_event.AccelerometerSensorEvent(ticks: int)[source]
Event reported when accelerometer sensor data is available.
- x: float
Acceleration force along the x axis (including gravity). in m/s².
- y: float
Acceleration force along the y axis (including gravity). in m/s².
- z: float
Acceleration force along the z axis (including gravity). in m/s².
- ticks: int
Number of clock ticks since boot.
- class naviguider_simpleserial.sensor_event.GameRotationVectorSensorEvent(ticks: int)[source]
Event reported when game rotation vector sensor data is available.
- qx: float
Rotation vector component along the x axis (x * sin(θ/2)).
- qy: float
Rotation vector component along the y axis (y * sin(θ/2)).
- qz: float
Rotation vector component along the z axis (z * sin(θ/2)).
- qw: float
Scalar component of the rotation vector ((cos(θ/2)).
- ticks: int
Number of clock ticks since boot.
- class naviguider_simpleserial.sensor_event.GeomagRotationVectorSensorEvent(ticks: int)[source]
Event reported when geo-magnetic rotation vector sensor data is available.
- qx: float
Rotation vector component along the x axis (x * sin(θ/2)).
- qy: float
Rotation vector component along the y axis (y * sin(θ/2)).
- qz: float
Rotation vector component along the z axis (z * sin(θ/2)).
- qw: float
Scalar component of the rotation vector ((cos(θ/2)).
- ticks: int
Number of clock ticks since boot.
- class naviguider_simpleserial.sensor_event.GravitySensorEvent(ticks: int)[source]
Event reported when gravity sensor data is available.
- x: float
Force of gravity along the x axis in m/s².
- y: float
Force of gravity along the y axis in m/s².
- z: float
Force of gravity along the z axis in m/s².
- ticks: int
Number of clock ticks since boot.
- class naviguider_simpleserial.sensor_event.GyroscopeUncalibratedSensorEvent(ticks: int)[source]
Event reported when uncalibrated gyroscope sensor data is available.
- x: float
Rate of rotation (without drift compensation) around the x axis in rad/s
- y: float
Rate of rotation (without drift compensation) around the y axis in rad/s
- z: float
Rate of rotation (without drift compensation) around the z axis in rad/s
- bias_x: float
Estimated drift around the x axis in rad/s
- bias_y: float
Estimated drift around the y axis in rad/s
- bias_z: float
Estimated drift around the z axis in rad/s
- ticks: int
Number of clock ticks since boot.
- class naviguider_simpleserial.sensor_event.GyroscopeSensorEvent(ticks: int)[source]
Event reported when uncalibrated gyroscope sensor data is available.
- x: float
Rate of rotation around the x axis in rad/s
- y: float
Rate of rotation around the y axis in rad/s
- z: float
Rate of rotation around the z axis in rad/s
- ticks: int
Number of clock ticks since boot.
- class naviguider_simpleserial.sensor_event.LinearAccelerationSensorEvent(ticks: int)[source]
Event reported when linear acceleration sensor data is available.
- x: float
Acceleration force along the x axis (excluding gravity) in m/s².
- y: float
Acceleration force along the y axis (excluding gravity) in m/s².
- z: float
Acceleration force along the z axis (excluding gravity) in m/s².
- ticks: int
Number of clock ticks since boot.
- class naviguider_simpleserial.sensor_event.MagnetometerUncalibratedSensorEvent(ticks: int)[source]
- x: float
Geomagnetic field strength (without hard iron calibration) along the x axis in micro-Tesla (µT).
- ticks: int
Number of clock ticks since boot.
- y: float
Geomagnetic field strength (without hard iron calibration) along the y axis in micro-Tesla (µT).
- z: float
Geomagnetic field strength (without hard iron calibration) along the z axis in micro-Tesla (µT).
- offset_x: float
Iron bias estimation along the x axis in micro-Tesla (µT).
- offset_y: float
Iron bias estimation along the y axis in micro-Tesla (µT).
- offset_z: float
Iron bias estimation along the z axis in micro-Tesla (µT).
- class naviguider_simpleserial.sensor_event.MagnetometerSensorEvent(ticks: int)[source]
Event reported when magnetometer data is available.
- ticks: int
Number of clock ticks since boot.
- x: float
Geomagnetic field strength along the x axis in micro-Tesla (µT).
- y: float
Geomagnetic field strength along the y axis in micro-Tesla (µT).
- z: float
Geomagnetic field strength along the z axis in micro-Tesla (µT).
- class naviguider_simpleserial.sensor_event.OrientationSensorEvent(ticks: int)[source]
Event reported when orientation sensor data is available.
- ticks: int
Number of clock ticks since boot.
- azimuth: float
Azimuth (angle around the z-axis) in degrees.
- pitch: float
Pitch (angle around the x-axis) in degrees.
- roll: float
Roll (angle around the y-axis) in degrees.
- accuracy: float
Accuracy value
- class naviguider_simpleserial.sensor_event.PressureSensorEvent(ticks: int)[source]
Event reported when pressure sensor data is available.
- ticks: int
Number of clock ticks since boot.
- hpa: float
Ambient air pressure in hPa.
- class naviguider_simpleserial.sensor_event.RotationVectorSensorEvent(ticks: int)[source]
Event reported when rotation vector sensor data is available.
- ticks: int
Number of clock ticks since boot.
- qx: float
Rotation vector component along the x axis (x * sin(θ/2)).
- qy: float
Rotation vector component along the y axis (y * sin(θ/2)).
- qz: float
Rotation vector component along the z axis (z * sin(θ/2)).
- qw: float
Scalar component of the rotation vector ((cos(θ/2)).
Types
- class naviguider_simpleserial.application_mode.ApplicationMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Enum class representing possible application mode values.
- DRONE = 1
Slow merging.
- SLOW_TARGETING = 2
Slow-Medium merging.
- TARGETING = 3
Medium merging.
- RIFLE = 4
Medium-Fast merging.
- GAMING = 5
Fast merging.
- class naviguider_simpleserial.coordinate_system.CoordinateSystem(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Enum class representing possible coordinate system values.
- ENU = 1
East, north, up (ENU) coordinate system.
- NED = 2
North, east, down (NED) coordinate system.
- class naviguider_simpleserial.meta_event_type.MetaEventType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Enum class representing possible meta event types.
- FLUSH_COMPLETE = 1
The event FIFO has been flushed.
- SAMPLE_RATE_CHANGED = 2
A sensor’s sample rate has changed.
- POWER_MODE_CHANGED = 3
A sensor’s power mode has changed.
- ERROR = 4
A general error has occurred.
- MAGNETIC_TRANSIENT = 5
Magnetic transient has been detected.
- CAL_STATUS_CHANGED = 6
Calibration status has changed.
- STILLNESS_CHANGED = 7
Stillness has changed.
- CALIBRATION_STABLE = 9
Calibration is stable.
- SENSOR_ERROR = 11
A sensor error has occurred.
- FIFO_OVERFLOW = 12
The event FIFO has overflowed.
- DYNAMIC_RANGE_CHANGED = 13
A sensor’s dynamic range has changed.
- FIFO_WATERMARK = 14
The event FIFO is about to overflow.
- SELF_TEST_RESULT = 15
Self-test result is available.
- INITIALIZED = 16
Device initialization has completed.
- TRANSFER_CAUSE = 17
A sensor hardware bus error has occurred.
- class naviguider_simpleserial.mounting_option.MountingOption(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Enum class representing possible mounting option values.
- STD_000 = 1
Standard mounting.
- STD_090 = 4
-90° heading offset.
- STD_180 = 5
-180° heading offset.
- STD_270 = 6
-270° heading offset.
- X_UP_000 = 2
-90° pitch, 0° heading offset.
- X_UP_090 = 8
-90° pitch, -90° heading offset.
- X_UP_180 = 9
-90° pitch, -180° heading offset.
- X_UP_270 = 10
-90° pitch, -270° heading offset.
- Y_UP_000 = 3
+90° roll, 0° heading offset.
- Y_UP_090 = 11
+90° roll, -90° heading offset.
- Y_UP_180 = 12
+90° roll, -180° heading offset.
- Y_UP_270 = 13
+90° roll, -270° heading offset.
- Z_DOWN_000 = 7
+180° roll, 0° heading offset.
- Z_DOWN_090 = 14
+180° roll, -90° heading offset.
- Z_DOWN_180 = 15
+180° roll, -180° heading offset.
- Z_DOWN_270 = 16
+180° roll, -270° heading offset.
- class naviguider_simpleserial.sensor_type.SensorType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Enum class representing possible sensor types.
- ACCELEROMETER = 1
Accelerometer sensor.
- MAGNETOMETER = 2
Magnetometer sensor.
- ORIENTATION = 3
Orientation sensor.
- GYROSCOPE = 4
Gyroscope sensor.
- PRESSURE = 6
Pressure sensor.
- TEMPERATURE = 7
Temperature sensor.
- GRAVITY = 9
Gravity sensor.
- LINEAR_ACCELERATION = 10
Linear acceleration sensor.
- ROTATION_VECTOR = 11
Rotation vector sensor.
- MAGNETOMETER_UNCALIBRATED = 14
Uncalibrated magnetometer sensor.
- GAME_ROTATION_VECTOR = 15
Game rotation vector sensor.
- GYROSCOPE_UNCALIBRATED = 16
Uncalibrated gyroscope sensor.
- SIGNIFICANT_MOTION = 17
Significant motion sensor.
- GEOMAG_ROTATION_VECTOR = 20
Geo-magnetic rotation vector sensor.
- class naviguider_simpleserial.test_result.TestResult(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Enum class representing possible test result values.
- PASSED = 0
All axes passed.
- X_FAILED = 1
X axis failed.
- Y_FAILED = 2
Y axis failed.
- XY_FAILED = 3
X and Y axes failed.
- Z_FAILED = 4
Z axis failed.
- XZ_FAILED = 5
X and Z axes failed.
- YZ_FAILED = 6
Y and Z axes failed.
- XYZ_FAILED = 7
All axes failed.