cave-crawler microcontroller firmware code (Teensy 3.5)
See also:
- cave-crawler-lib that communicates with this firmware
- cave-crawler for "top-level" project
Precise time synchronization of multiple sensors:
- IMU (EM71780)
- encoders
- lidars (RPLidar A3, XV11Lidar)
Communication with embedded CPU.
Functional.
Code was carefully written in non-blocking manner:
- IMU (EM1780) is timestamped in interrupt
- encoders are flagged for ASAP readout to get sync between IMU/encoders
- IMU is read through asynchronous I2C (non-blocking)
- lidar communication is non-blocking and timestamped on first received packet byte
- embedded CPU (host controller) communication is non blocking
All together this achieves 10s of microseconds order worst case loop time.
Firmware code written for Teensy 3.5.
Combination of:
- IMU (EM71780)
- lidars (RPLidar A3, XV11Lidar)
- encoders
- embedded CPU running cave-crawler-lib
Using subset of above hardware requires modification of top-level cave-crawler-mcu.ino
- serial-nb-arduino
- xv11lidar-arduino
- rplidar-a3-arduino
- EM7180 (async-i2c branch)
If somebody needs to relax the license from GPL to say MPL, let me know. There is no problem with that but I no longer work on this project.