Quad i2c rework
Problem
Currently, the I2C device specific functions are residing in the application layer. This doesn't make much sense; it would be more appropriate for these hardware level details (registers numbers and offsets) to reside in the hardware layer.
Solution
Add a few more hardware interfaces, specifically one for each of the I2C sensors we use (IMU, Lidar, Optical flow). This will make dependency injection of the I2C bus on a particular bus much easier (which will be important if we want to make a new I2C bus specifically for the optical flow sensor). As a bonus, this change also makes it much easier to implement the I2C devices in the virtual quad, and allows us to make some cool tests (like verifying that certain motors get stronger when you "tilt" the quad...).
Reviewers
Merge request reports
Activity
added 1 commit
- 8ccfe097 - quad: move i2c device functions into the hardware interface
The functional virtual quad tests have been updated to included some "sanity" checks.
Specifically, the test verifies that the correct motors have greater thrust when the quad is tilted in certain directions:
Check that when quad is tilted, motors respond correctly Tilting forwards... [0.8060557999999999, 0.22479697999999965, 0.8067574399999998, 0.22403645999999963] Tilting backwards... [0.3412184299999999, 0.6907702600000002, 0.33985340999999986, 0.6921104600000002] Tilting right... [0.30387248999999944, 0.24451783999999993, 0.7873231000000003, 0.7273246900000007] Tilting left... [0.7837717200000002, 0.6890350400000002, 0.34151948, 0.2454619499999999]
mentioned in commit 2888cf88