Sensors, Electronics and Prototyping

UM7 Python Library

Welcome to Redshift Labs Forums UM7 Product Support UM7 Python Library

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #1106

    I’ve been working on a python package for the UM7 that handles serial com and data parsing. Right now it only handles processed accel, gyro, and euler angle/rate data but it can both catch broadcast data or request data from specific registers on demand (though the latter is generally much slower). It also has functions to zero the gyros, reset the EKF, and check on the serial buffer. As of now broadcast rates still need to be set via the CHR Interface or some other library.

    It’s moderately documented so I recommend looking through the source code and comments before jumping in, and there are a few quirks here and there. Most notably the grabsample() function doesn’t work unless the requested data type broadcast rates have been set to zero, but apart from that it should be pretty straightforward.

    I’m not a programmer by trade and this is my first python project so feedback is welcome and appreciated! You can find the library at or run ‘pip install um7’ from your terminal.


    Dan K


    Hi Daniel,

    We are currently looking at developing a cross platform interface for the UM7.
    Basically the functionality of the current CHR serial interface software, which runs as Python web/gui application. If all goes to plan, will release in a few months from now!

    I would be interested in looking at your work.
    Thanks for sharing, keep it up.

    Redshift Labs


    hi daniel,

    thanks for your work! it has made my entry to UM7 with python easy.

    i have forked to buxit/um7 and since then rewritten large parts of it. i wonder if dank93 is in indeed your github account as the github-code was behind the one on pip.

    you might consider pulling some of my commits:

    my first commit updates to version 0.9 as found on pip. the second commit adds python3 compatibility and improves packet parsing performance and robustness by correcting packet length interpretation, calculating and comparing checksums, passing only the payload as data and avoiding binary to hex-string conversions.

    the following commits further improve different aspects of the UM7 module, but also modify the logic of state updates.
    i always keep the complete state of all values requested through statevars in UM7.state, updating it as packets come in. in my app i have a separate thread that does only little more than:

    while True:

    following this logic the code will further diverge from the original, replacing host time by time values reported from the UM7. by checking for (plausibly) increasing time values it is then possible to asses if all the data from the UM7 is current / accurate.

    i have also written calibration code that calculates a rotation matrix to be applied to all measurements (to compensate for slight differences in UM7-mounting) but i’m currently not sure if (and how) i could integrate it.



Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘UM7 Product Support’ is closed to new topics and replies.