MRP.MRPBaseSensor

base class to query (b-value and temp) values from a hardware sensor running the UnifiedSensorFirmware

exception MRPBaseSensor.MMRPBaseSensorException(message='MMRPBaseSensorException thrown')
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class MRPBaseSensor.MRPBaseSensor(_sensor_connection: MRPHal)

Baseclass for the simplest sensor with static and axis_b capabilities

get_b(_sensor_id: int = 0) float

returns the b field value for a given sensor id trigger a readout first using the query_readout function if the sensor has z measurement capabilities, this axis will be used to read out the measurement prefix sign

Parameters:

_sensor_id (int) – get b axis from specified sensor_id in range from 0 to self.sensor_count

Returns:

returns the latest b field value

Return type:

float

get_temp(_sensor_id: int = 0) float

returns the sensors temperature trigger a readout first using the query_readout function

Parameters:

_sensor_id (int) – get b axis from specified sensor_id in range from 0 to self.sensor_count

Returns:

returns the temperature if not able to read temperature the result will be -254.0

Return type:

float

get_vector(_sensor_id: int = 0) -> (<class 'float'>, <class 'float'>, <class 'float'>)

returns the x,y,z vector from 3D magnetometer sensors value for a given sensor id trigger a readout first using the query_readout function

Parameters:

_sensor_id (int) – get b axis from specified sensor_id in range from 0 to self.sensor_count

Returns:

returns the latest (x, y, z) field value

Return type:

(float, float, float)

query_readout()

queries a complete readout of all connected sensors and their axis

setup_hardware_averaging(_averaging_points: int) int

setup sensors hardware averaging if supported by sensor trigger a readout first using the query_readout function

Parameters:

_averaging_points (int) – how many points to average the readout data

Returns:

True if setup was successful, False otherwise or sensor averaging is not supported by sensor firmware

Return type:

bool