![]() |
Qwiic_OTOS_Py
2.0.0
Python for SFE Qwiic OTOS
|
Class for the SparkFun Qwiic Optical Tracking Odometry Sensor (OTOS). More...
Public Member Functions | |
def | __init__ (self, address=None, i2c_driver=None) |
Constructor. More... | |
def | is_connected (self) |
Determines if this device is connected. More... | |
def | begin (self) |
Initializes this device with default parameters. More... | |
def | getVersionInfo (self) |
Gets the hardware and firmware version numbers from the OTOS. More... | |
def | selfTest (self) |
Performs a self-test on the OTOS. More... | |
def | calibrateImu (self, numSamples=255, waitUntilDone=True) |
Calibrates the IMU on the OTOS, which removes the accelerometer and gyroscope offsets. More... | |
def | getImuCalibrationProgress (self) |
Gets the progress of the IMU calibration. More... | |
def | getLinearUnit (self) |
Gets the linear unit used by all methods using a pose. More... | |
def | setLinearUnit (self, unit) |
Sets the linear unit used by all methods using a pose. More... | |
def | getAngularUnit (self) |
Gets the angular unit used by all methods using a pose. More... | |
def | setAngularUnit (self, unit) |
Sets the angular unit used by all methods using a pose. More... | |
def | getLinearScalar (self) |
Gets the linear scalar used by the OTOS. More... | |
def | setLinearScalar (self, scalar) |
Sets the linear scalar used by the OTOS. More... | |
def | getAngularScalar (self) |
Gets the angular scalar used by the OTOS. More... | |
def | setAngularScalar (self, scalar) |
Sets the angular scalar used by the OTOS. More... | |
def | resetTracking (self) |
Resets the tracking algorithm, which resets the position to the origin, but can also be used to recover from some rare tracking errors. More... | |
def | getSignalProcessConfig (self) |
Gets the signal processing configuration from the OTOS. More... | |
def | setSignalProcessConfig (self, config) |
Sets the signal processing configuration for the OTOS. More... | |
def | getStatus (self) |
Gets the status register from the OTOS, which includes warnings and errors reported by the sensor. More... | |
def | getOffset (self) |
Gets the offset of the OTOS. More... | |
def | setOffset (self, pose) |
Gets the offset of the OTOS. More... | |
def | getPosition (self) |
Gets the position measured by the OTOS. More... | |
def | setPosition (self, pose) |
Sets the position measured by the OTOS. More... | |
def | getVelocity (self) |
Gets the velocity measured by the OTOS. More... | |
def | getAcceleration (self) |
Gets the acceleration measured by the OTOS. More... | |
def | getPositionStdDev (self) |
Gets the standard deviation of the measured position. More... | |
def | getVelocityStdDev (self) |
Gets the standard deviation of the measured velocity. More... | |
def | getAccelerationStdDev (self) |
Gets the standard deviation of the measured acceleration. More... | |
def | getPosVelAcc (self) |
Gets the position, velocity, and acceleration measured by the OTOS in a single burst read. More... | |
def | getPosVelAccStdDev (self) |
Gets the standard deviation of the measured position, velocity, and acceleration in a single burst read. More... | |
def | getPosVelAccAndStdDev (self) |
Gets the position, velocity, acceleration, and standard deviation of each in a single burst read. More... | |
Public Attributes | |
address | |
Static Public Attributes | |
device_name = _DEFAULT_NAME | |
available_addresses = _AVAILABLE_I2C_ADDRESS | |
int | kRegProductId = 0x00 |
int | kRegHwVersion = 0x01 |
int | kRegFwVersion = 0x02 |
int | kRegScalarLinear = 0x04 |
int | kRegScalarAngular = 0x05 |
int | kRegImuCalib = 0x06 |
int | kRegReset = 0x07 |
int | kRegSignalProcess = 0x0E |
int | kRegSelfTest = 0x0F |
int | kRegOffXL = 0x10 |
int | kRegOffXH = 0x11 |
int | kRegOffYL = 0x12 |
int | kRegOffYH = 0x13 |
int | kRegOffHL = 0x14 |
int | kRegOffHH = 0x15 |
int | kRegStatus = 0x1F |
int | kRegPosXL = 0x20 |
int | kRegPosXH = 0x21 |
int | kRegPosYL = 0x22 |
int | kRegPosYH = 0x23 |
int | kRegPosHL = 0x24 |
int | kRegPosHH = 0x25 |
int | kRegVelXL = 0x26 |
int | kRegVelXH = 0x27 |
int | kRegVelYL = 0x28 |
int | kRegVelYH = 0x29 |
int | kRegVelHL = 0x2A |
int | kRegVelHH = 0x2B |
int | kRegAccXL = 0x2C |
int | kRegAccXH = 0x2D |
int | kRegAccYL = 0x2E |
int | kRegAccYH = 0x2F |
int | kRegAccHL = 0x30 |
int | kRegAccHH = 0x31 |
int | kRegPosStdXL = 0x32 |
int | kRegPosStdXH = 0x33 |
int | kRegPosStdYL = 0x34 |
int | kRegPosStdYH = 0x35 |
int | kRegPosStdHL = 0x36 |
int | kRegPosStdHH = 0x37 |
int | kRegVelStdXL = 0x38 |
int | kRegVelStdXH = 0x39 |
int | kRegVelStdYL = 0x3A |
int | kRegVelStdYH = 0x3B |
int | kRegVelStdHL = 0x3C |
int | kRegVelStdHH = 0x3D |
int | kRegAccStdXL = 0x3E |
int | kRegAccStdXH = 0x3F |
int | kRegAccStdYL = 0x40 |
int | kRegAccStdYH = 0x41 |
int | kRegAccStdHL = 0x42 |
int | kRegAccStdHH = 0x43 |
int | kProductId = 0x5F |
float | kMeterToInch = 39.37 |
float | kInchToMeter = 1.0 / kMeterToInch |
float | kRadianToDegree = 180.0 / 3.14159 |
float | kDegreeToRadian = 3.14159 / 180.0 |
float | kMeterToInt16 = 32768.0 / 10.0 |
float | kInt16ToMeter = 1.0 / kMeterToInt16 |
float | kMpsToInt16 = 32768.0 / 5.0 |
float | kInt16ToMps = 1.0 / kMpsToInt16 |
float | kMpssToInt16 = 32768.0 / (16.0 * 9.80665) |
float | kInt16ToMpss = 1.0 / kMpssToInt16 |
float | kRadToInt16 = 32768.0 / 3.14159 |
float | kInt16ToRad = 1.0 / kRadToInt16 |
float | kRpsToInt16 = 32768.0 / (2000.0 * kDegreeToRadian) |
float | kInt16ToRps = 1.0 / kRpsToInt16 |
float | kRpssToInt16 = 32768.0 / (3.14159 * 1000.0) |
float | kInt16ToRpss = 1.0 / kRpssToInt16 |
float | kMinScalar = 0.872 |
float | kMaxScalar = 1.127 |
int | kLinearUnitMeters = 0 |
int | kLinearUnitInches = 1 |
int | kAngularUnitRadians = 0 |
int | kAngularUnitDegrees = 1 |
Properties | |
connected = property(is_connected) | |
Class for the SparkFun Qwiic Optical Tracking Odometry Sensor (OTOS).
Includes methods to communicate with the sensor, such as getting the tracked location, configuring the sensor, etc. This class is a base class that must be derived to implement the delay function and I2C communication bus.
def qwiic_otos.QwiicOTOS.__init__ | ( | self, | |
address = None , |
|||
i2c_driver = None |
|||
) |
Constructor.
int,optional | address: The I2C address to use for the device If not provided, the default address is used |
I2CDriver,optional | i2c_driver: An existing i2c driver object If not provided, a driver object is created |
def qwiic_otos.QwiicOTOS.begin | ( | self | ) |
Initializes this device with default parameters.
True
if successful, otherwise False
def qwiic_otos.QwiicOTOS.calibrateImu | ( | self, | |
numSamples = 255 , |
|||
waitUntilDone = True |
|||
) |
Calibrates the IMU on the OTOS, which removes the accelerometer and gyroscope offsets.
int,optional | numSamples: Number of samples to take for calibration. Each sample takes about 2.4ms, so fewer samples can be taken for faster calibration, defaults to 255 |
bool,optional | waitUntilDone: hether to wait until the calibration is complete. Set false to calibrate asynchronously, see getImuCalibrationProgress(), defaults to True |
def qwiic_otos.QwiicOTOS.getAcceleration | ( | self | ) |
Gets the acceleration measured by the OTOS.
def qwiic_otos.QwiicOTOS.getAccelerationStdDev | ( | self | ) |
Gets the standard deviation of the measured acceleration.
These values are just the square root of the diagonal elements of the covariance matrices of the Kalman filters used in the firmware, so they are just statistical quantities and do not represent actual error!
def qwiic_otos.QwiicOTOS.getAngularScalar | ( | self | ) |
Gets the angular scalar used by the OTOS.
def qwiic_otos.QwiicOTOS.getAngularUnit | ( | self | ) |
Gets the angular unit used by all methods using a pose.
def qwiic_otos.QwiicOTOS.getImuCalibrationProgress | ( | self | ) |
Gets the progress of the IMU calibration.
Used for asynchronous calibration with calibrateImu()
def qwiic_otos.QwiicOTOS.getLinearScalar | ( | self | ) |
Gets the linear scalar used by the OTOS.
def qwiic_otos.QwiicOTOS.getLinearUnit | ( | self | ) |
Gets the linear unit used by all methods using a pose.
def qwiic_otos.QwiicOTOS.getOffset | ( | self | ) |
Gets the offset of the OTOS.
def qwiic_otos.QwiicOTOS.getPosition | ( | self | ) |
Gets the position measured by the OTOS.
def qwiic_otos.QwiicOTOS.getPositionStdDev | ( | self | ) |
Gets the standard deviation of the measured position.
These values are just the square root of the diagonal elements of the covariance matrices of the Kalman filters used in the firmware, so they are just statistical quantities and do not represent actual error!
def qwiic_otos.QwiicOTOS.getPosVelAcc | ( | self | ) |
Gets the position, velocity, and acceleration measured by the OTOS in a single burst read.
def qwiic_otos.QwiicOTOS.getPosVelAccAndStdDev | ( | self | ) |
Gets the position, velocity, acceleration, and standard deviation of each in a single burst read.
def qwiic_otos.QwiicOTOS.getPosVelAccStdDev | ( | self | ) |
Gets the standard deviation of the measured position, velocity, and acceleration in a single burst read.
def qwiic_otos.QwiicOTOS.getSignalProcessConfig | ( | self | ) |
Gets the signal processing configuration from the OTOS.
def qwiic_otos.QwiicOTOS.getStatus | ( | self | ) |
Gets the status register from the OTOS, which includes warnings and errors reported by the sensor.
def qwiic_otos.QwiicOTOS.getVelocity | ( | self | ) |
Gets the velocity measured by the OTOS.
def qwiic_otos.QwiicOTOS.getVelocityStdDev | ( | self | ) |
Gets the standard deviation of the measured velocity.
These values are just the square root of the diagonal elements of the covariance matrices of the Kalman filters used in the firmware, so they are just statistical quantities and do not represent actual error!
def qwiic_otos.QwiicOTOS.getVersionInfo | ( | self | ) |
Gets the hardware and firmware version numbers from the OTOS.
def qwiic_otos.QwiicOTOS.is_connected | ( | self | ) |
Determines if this device is connected.
True
if connected, otherwise False
def qwiic_otos.QwiicOTOS.resetTracking | ( | self | ) |
Resets the tracking algorithm, which resets the position to the origin, but can also be used to recover from some rare tracking errors.
def qwiic_otos.QwiicOTOS.selfTest | ( | self | ) |
Performs a self-test on the OTOS.
def qwiic_otos.QwiicOTOS.setAngularScalar | ( | self, | |
scalar | |||
) |
Sets the angular scalar used by the OTOS.
Can be used to compensate for scaling issues with the sensor measurements
float | scalar: Angular scalar, must be between 0.872 and 1.127 |
def qwiic_otos.QwiicOTOS.setAngularUnit | ( | self, | |
unit | |||
) |
Sets the angular unit used by all methods using a pose.
int | unit: Angular unit |
def qwiic_otos.QwiicOTOS.setLinearScalar | ( | self, | |
scalar | |||
) |
Sets the linear scalar used by the OTOS.
Can be used to compensate for scaling issues with the sensor measurements
float | scalar: Linear scalar, must be between 0.872 and 1.127 |
def qwiic_otos.QwiicOTOS.setLinearUnit | ( | self, | |
unit | |||
) |
Sets the linear unit used by all methods using a pose.
int | unit: Linear unit |
def qwiic_otos.QwiicOTOS.setOffset | ( | self, | |
pose | |||
) |
Gets the offset of the OTOS.
This is useful if your sensor is mounted off-center from a robot. Rather than returning the position of the sensor, the OTOS will return the position of the robot
Pose2D | pose: Offset of the sensor relative to the center of the robot |
def qwiic_otos.QwiicOTOS.setPosition | ( | self, | |
pose | |||
) |
Sets the position measured by the OTOS.
This is useful if your robot does not start at the origin, or you have another source of location information (eg. vision odometry); the OTOS will continue tracking from this position
Pose2D | pose: New position for the OTOS to track from |
def qwiic_otos.QwiicOTOS.setSignalProcessConfig | ( | self, | |
config | |||
) |
Sets the signal processing configuration for the OTOS.
int | config: Signal processing configuration |
qwiic_otos.QwiicOTOS.address |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |