Python library to interface with CH Robotics / Redshift Labs UM7 IMU
Provides a class UM7 with the following methods:
readreg(start, length=0)to read register valueswritereg(start, length=0, data=None)to write to registersreadpacket()to read and parse incoming packet data from the serial portcatchsample()to read and parse incoming data and update the internalstateaccoringlycatchallsamples(wanted_state, timeout)wait at mosttimeoutseconds for new data listed inwanted_state
usage example:
import um7
u = um7.UM7('um7', '/dev/ttyS0', ['health', 'pitch', 'roll', 'yaw'])
print('GET_FW_REVISION=' + u.get_fw_revision())
u.zero_gyros()
u.catchallsamples(['pitch', 'roll', 'yaw'], 0.5)
print('{0[health]:010b} {0[pitch]:8.2f} {0[roll]:8.2f} {0[yaw]:8.2f}'.format(u.state))