CyberAtom Python Library

2.5.0

Public Member Functions | Public Attributes | List of all members
cyberatom.Device Class Reference

Implementation of logical CyberAtom device. More...

Inheritance diagram for cyberatom.Device:

Public Member Functions

def __init__ (self, connection, response)
 Constructs logical device object using given connection and forwards responses to given handler object. More...
 
def __del__ (self, release=cyberatom.IDevice_release)
 
def onMessage (self, code, payload, payload_size)
 
def checkForMessages (self)
 Triggers communication with the device and checks whether there are any incoming messages from the device.
 
def getSysInfo (self)
 Requests sending back information on the device type and firmware version.
 
def getQuatData (self)
 Requests information about actual device spatial orientation expressed in form of quaternion.
 
def getEulerData (self)
 Requests information about actual device spatial orientation expressed in form of Euler angles.
 
def getRotRateData (self)
 Requests actual rotation rate information from the device.
 
def reboot (self)
 Requests the device to reboot.
 
def factoryReset (self)
 Requests loading factory settings into device RAM memory.
 
def setAccCalibMatrix (self, cal, bias)
 Changes accelerometer calibration settings the device is using at the moment. More...
 
def setMagCalibMatrix (self, cal, bias)
 Changes magnetometer calibration settings the device is using at the moment. More...
 
def setGyrCalibMatrix (self, cal, bias)
 Changes gyroscope calibration settings the device is using at the moment. More...
 
def setFilterMagMatrix (self, mat)
 Changes Kalman filter coeficiences for magnetometer sensor. More...
 
def setFilterAccMatrix (self, mat)
 Changes Kalman filter coeficiences for accelerometer sensor. More...
 
def setFilterGyrMatrix (self, mat)
 Changes Kalman filter coeficiences for gyroscope sensor. More...
 
def setFilterProcMatrix (self, mat)
 
def getFilterMagMatrix (self)
 Requests Kalman filter coeficiences for magnetometer measurement noise.
 
def getFilterAccMatrix (self)
 Requests Kalman filter coeficiences for accelerometer measurement noise.
 
def getFilterGyrMatrix (self)
 Requests Kalman filter coeficiences for gyroscope measurement noise.
 
def getFilterProcMatrix (self)
 Requests Kalman filter coeficiences for process noise.
 
def getTemperature (self)
 Requests actual tempereature data.
 
def setBaudRate (self, rate)
 Changes baud rate for UART interface. More...
 
def setI2cAddress (self, address)
 Changes 7-bit address as an I2C slave device. More...
 
def getI2cAddress (self)
 Requests sending actual I2C device address.
 
def getBaudRate (self)
 Requests sending actual baud rate used for UART interface. More...
 
def resetGyr (self)
 Resets gyroscope bias estimates. More...
 
def writeFlash (self)
 Saves current settings in device RAM into internal non-volotile flash memory.
 
def getRawAccData (self)
 Requests sending RAW type of accelerometer measurements.
 
def getRawMagData (self)
 Requests sending RAW type of magnetometer measurements.
 
def getRawGyrData (self)
 Requests sending RAW type of gyroscope measurements.
 
def getNormAccData (self)
 Requests sending normalized values of accelerometer measurements.
 
def getNormMagData (self)
 Requests sending normalized values of magnetometer measurements.
 
def getNormGyrData (self)
 Requests sending normalized values of gyroscope measurements.
 
def getCalibAccData (self)
 Requests sending post-calibration values of accelerometer measurements.
 
def getCalibMagData (self)
 Requests sending post-calibration values of magnetometer measurements.
 
def getCalibGyrData (self)
 Requests sending post-calibration values of gyroscope measurements.
 
def getAccCalibMatrix (self)
 Requests calibration matrices used for accelerometer measurements.
 
def getMagCalibMatrix (self)
 Requests calibration matrices used for magnetometer measurements.
 
def getGyrCalibMatrix (self)
 Requests calibration matrices used for gyroscope measurements.
 
def getStats (self)
 

Public Attributes

 connection
 
 response
 
 responseStruct
 
 handle
 

Detailed Description

Implementation of logical CyberAtom device.

Constructor & Destructor Documentation

def cyberatom.Device.__init__ (   self,
  connection,
  response 
)

Constructs logical device object using given connection and forwards responses to given handler object.

Parameters
connectionA connection that this device object will use to communicate with physical device.
responseA response object that will receive response messages from the device.
Note
Make sure you maintain lifecycle of given connection and response interfaces accordingly with the lifecycle of the Device class instance itself.

Member Function Documentation

def cyberatom.Device.getBaudRate (   self)

Requests sending actual baud rate used for UART interface.

def cyberatom.Device.onMessage (   self,
  code,
  payload,
  payload_size 
)
Parameters
code
payload
payload_size
def cyberatom.Device.resetGyr (   self)

Resets gyroscope bias estimates.

Note
Should be performed when the device is not rotating.
def cyberatom.Device.setAccCalibMatrix (   self,
  cal,
  bias 
)

Changes accelerometer calibration settings the device is using at the moment.

Parameters
calArray of 9 matrix (3x3) elements for missalignment calibration.
biasArray of 9 matrix (3x3) elements for bias and temperature and temperature bias calibration.
def cyberatom.Device.setBaudRate (   self,
  rate 
)

Changes baud rate for UART interface.

Parameters
rateInteger value representing new baud rate.
Note
This call changes settings stored in device RAM. However, the device takes into account baud rate only at the power-on or reset event. So this call should be followed by writeFlash().
def cyberatom.Device.setFilterAccMatrix (   self,
  mat 
)

Changes Kalman filter coeficiences for accelerometer sensor.

Parameters
mata11,a22 and a33 matrix coeficiences for magnetometer accelerometer noise matrix.
def cyberatom.Device.setFilterGyrMatrix (   self,
  mat 
)

Changes Kalman filter coeficiences for gyroscope sensor.

Parameters
mata11,a22 and a33 matrix coeficiences for magnetometer gyroscope noise matrix.
def cyberatom.Device.setFilterMagMatrix (   self,
  mat 
)

Changes Kalman filter coeficiences for magnetometer sensor.

Parameters
mata11,a22 and a33 matrix coeficiences for magnetometer measurement noise matrix.
def cyberatom.Device.setFilterProcMatrix (   self,
  mat 
)
Parameters
matAn array with 7 matrix elements for the filter process matric to set.
def cyberatom.Device.setGyrCalibMatrix (   self,
  cal,
  bias 
)

Changes gyroscope calibration settings the device is using at the moment.

Parameters
calArray of 9 matrix (3x3) elements for missalignment calibration.
biasArray of 9 matrix (3x3) elements for bias and temperature and temperature bias calibration.
def cyberatom.Device.setI2cAddress (   self,
  address 
)

Changes 7-bit address as an I2C slave device.

Parameters
addressNew I2c device address.
Note
This call changes settings stored in device RAM. However, the device takes into account baud rate only at the power-on or reset event. So this call should be followed by writeFlash().
def cyberatom.Device.setMagCalibMatrix (   self,
  cal,
  bias 
)

Changes magnetometer calibration settings the device is using at the moment.

Parameters
calArray of 9 matrix (3x3) elements for missalignment calibration.
biasArray of 9 matrix (3x3) elements for bias and temperature and temperature bias calibration.

The documentation for this class was generated from the following file: