Output Data via USB?

Hey, I’m working on a large rover-type autonomous vehicle with my school’s Robotics Club. We’re using 24V DC motors instead of servos. We’re using OpenMV to detect lines, using a similar code to the donkey car code that I found on here. The main difference is that we’re avoiding lines instead of following them. We have to remain in between two lines. Another component is that it has to avoid obstacles in front of it.

Anyway, we’re using a Raspberry Pi 3 with an Emlid Navio2 attached to it, which takes up all but one pin in the Pi. The Navio2 communicates with our LIDAR unit that we’re using for object avoidance and our GPS unit to drive to certain coordinates. All that said, there are still a few USB ports on the Pi that we can use for inputs. What I’m wondering is if we can use the MicroUSB on the cam to output a 1 or 0 (if it sees a line or not) to the Pi’s USB port for the Pi (which also has ROS on it) to do with it as it needs. In other words, can the USB on the M7 output data to a Pi?

Any help would be awesome! Thanks!

Um, yes, the OpenMV Cam appears as a serial port and you can use the print method to send data out of it.

So, just develop a script in OpenMV IDE that prints the results you want to print… Then once done… Close OpenMV IDE and have an application open the serial port of the camera and read the print statements.

For coding purposes, is the serial port for the MicroUSB UART(3)? Or is it so simple that I don’t have to worry about working with pyb and UART, and just using the print function will be enough?

Print goes out the USB. If you want to use the UART you have to specify point to that.