Output Data via USB?

General discussion about topics related to OpenMV.
westonchambers
Posts: 2
Joined: Thu Oct 11, 2018 2:07 pm

Output Data via USB?

Postby westonchambers » Thu Oct 11, 2018 4:06 pm

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!
User avatar
kwagyeman
Posts: 2291
Joined: Sun May 24, 2015 2:10 pm

Re: Output Data via USB?

Postby kwagyeman » Thu Oct 11, 2018 6:36 pm

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.
Nyamekye,
westonchambers
Posts: 2
Joined: Thu Oct 11, 2018 2:07 pm

Re: Output Data via USB?

Postby westonchambers » Fri Oct 12, 2018 1:17 pm

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?
User avatar
kwagyeman
Posts: 2291
Joined: Sun May 24, 2015 2:10 pm

Re: Output Data via USB?

Postby kwagyeman » Sat Oct 13, 2018 12:27 am

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

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest