This project is based on a project I did for the Teensy 4 (Teensy 4 and LidarLite V3 3d Scanning. | Teensy Forum ) which is turn was based on a project from http://www.qcontinuum.org/lidar (note link no longer works).
For the Arduino Uno Q I tried to connect the 2 HS-645MG servos as well as the LidarLite directly to the Q but the sketch hung the Q more than likely because of lack of sufficient power. To resolve this issue I used a PCA9865 16 Channel PWM Servo Driver Board (Amazon.com: HUAREW PCA9685 16 Channel PWM Servo Driver Board 12 bit IIC Interface Module Compatible with Arduino and Raspberry Pi (2pcs) : Electronics) connected to external 5v power bank. For software I used a modified version of the Sketch and the Processing sketch I posted in the Teensy link. Libraries used are the Adafruit-PWM-Servo-Driver (adafruit/Adafruit-PWM-Servo-Driver-Library: Adafruit PWM Servo Driver Library ) and the Sparkfun LidarLiteV3 library (garmin/LIDARLite_Arduino_Library: High-performance optical distance sensing. ).
Some interesting points on using the PCA9865 library:
1. The example provided in the library only shows the setup for servos using the same min-max values for the servos. Modification was made in the sketch to use arrays of min and max values providing the correct settings for each servo.
uint16_t USMIN[] = {950, 625};
uint16_t USMAX[] = {1870, 2275};
and a function to select servo number and angle:
int angle2us(uint8_t servonum, uint16_t angle) {
return MAP_ROUND(angle, 0, 180, USMIN[servonum], USMAX[servonum]);
}
2. You will notice a MAP_ROUND function which is an improved version of the Arduino Map function:
//Thank you copilot
#define MAP_ROUND(x, in_min, in_max, out_min, out_max) \
( ((int64_t)(x) - (int64_t)(in_min)) * ((int64_t)(out_max) - (int64_t)(out_min)) + \
(((int64_t)(x) - (int64_t)(in_min)) >= 0 ? ((int64_t)(in_max) - (int64_t)(in_min)) / 2 : -((int64_t)(in_max) - (int64_t)(in_min)) / 2) ) \
/ ((int64_t)(in_max) - (int64_t)(in_min)) + (int64_t)(out_min)
Now the Processing Sketch allows you control orientation of the PCL. I added the sketches to the github repo: Lidar-Lite-v3-3d-Scanner/ArduinoUnoQ at master · mjs513/Lidar-Lite-v3-3d-Scanner
Now for the question is how can I use the qualcomm to generate the PCL using Open3D etc? From what I am seeing not sure how feasible this is?

