paper: Using JeVois camera in FRC

Thread created automatically to discuss a document in CD-Media.

Using JeVois camera in FRC
by: billbo911, Team 2073.

This “Quick Start Guide” will give you all the tools to get started running your Vision Tracking code on the JeVois camera in an FRC environment.

This document makes use of many of the tutorial steps provided by JeVois.org and adds to them a practical and straight forward approach to getting started with the JeVois camera in an FRC environment. The original upload is a preliminary version. As feedback is provided, updated versions will be uploaded. As it is now, this document is fairly complete and should be able to get you tracking with your code. This is written with the assumption you will be using OpenCV and Python. Translating this document for other languages should be fairly simple, but that will be left up to the reader.

Using JeVois in FRC v0.31.pdf (335 KB)
Using JeVois in FRC v0.32.pdf (337 KB)
Using JeVois in FRC v1.0 .pdf (534 KB)

This is a preliminary release. It is written for OpenCV and Python. Translating it for use with C, C++ ect. should be fairly simple.
Please provide feedback so future versions can be even more complete.

1 Like

Ballin’. I’ll definatally look at this soon. Thanks for the hard work.

Awesome! I’ve been looking forward to this paper!

I am certainly glad to provide this. It is our hopes that it will make Vision Tracking something that even more teams can achieve.

Please provide your feedback on the document once you have taken the time to read and work through it. I fully understand that it may not be complete yet. Any and all input will be considered.

Thanks for posting this, seems like I have a new holiday project.

Wow, that means more to me than you could possibly know.
Why? It was a paper that was produced by Spectrum that inspired me several years ago to dive head first into vision tracking! In fact if you look at our code from as recently as two years ago, you can still see remnants of your code in there.
This paper, while it is not intended to show how to actually track an object, it is intended to show how to run a teams code on the JeVois.
Later this year, 2073 will release our actual code running on the JeVois. Even it will look a bit like what was originally presented by Spectrum. That is due to the fact that the approach is a commonly used approach for identifying targets based on color, shape and size.

It looks like you based your trials on this page: http://jevois.org/moddoc/ObjectTracker/modinfo.html
Is that correct?

Does it track at 30FPS? How was the reliability of the platform (shock/power cycling/etc)? How long does it take to boot?

It boots in roughly 5-15s max. It has handled me doing some pretty stupid stuff to the serial lines without issue so far… I connected up ground/power and signal wrong more than once.

The power is USB Mini and not USB Micro… and from my experience, it seems to be a more reliable connector and I like it better for moving projects.

The only weirdness I’ve seen is that it seems temperamental about certain USB cables but then not all USB cables are made the same and I know I’ve got some of questionable quality in my USB cable bin.

I’ve beat it up while it has been on my desk - 10 or so drops from a height of 1-2ft and it keeps the image going.

I’ve been recommending this thing to a lot of folks and for the price it’s worth the investment just to tinker with it.

Thanks for the info. Have you been able to interface with the roborio over USB?

I haven’t tried BUT over USB it either shows up as storage or a webcam… I suspect there is a way to get it to talk serial or network over USB too but I haven’t looked into it.

I’ve been playing with it hooked up to my laptop and a VM.

Ours shows up on tty/ACM0 - at least sending “help” to that port returns back the expected help message. I haven’t tried much more than that yet…

I do recall there’s a config file in the jevois filesystem which tells the Jevois to use hardware serial or USB serial?

This might help some of you in your exploration:

https://www.thingiverse.com/thing:2692328

Hi Tom,
I actually used many of the JeVois.org tutorials to build this guide. I combined information spread out across multiple tutorials and examples. The tracking code we running is a custom modified version of the code we have been using for the last three to four years on our robots.
The code we use to track runs at 60 FPS. It is acquiring frames from the camera in YUYV and sends the target location data to the RoboRio via USB, so at 480Mbs.

There is a bogus concept in the JeVois engine of reporting the FPS based on the time it takes to process the image and create the targeting data. This method claims ~150 FPS. In reality, you can only track as quickly as the camera can acquire images. So, 320 X 240 YUYV maxes out at 60 FPS.

The one thing I have noticed about the Mini USB connector is that it is really snug at first. When it is repeatedly inserted and removed hundreds of times during testing etc., it tends to loosen up. So, a method restrain it is advisable. The TTL connector has shown no signs of loosening up.

Boot time is on the order of < 10 seconds with reboots around 15.

As an additional note, there are four mounting holes in the bottom of the housing that provide a very convenient method of securing the camera.

As for durability, Marshal’s description says it all.

Bingo.
When seting up your scripts to run, you can use either a “script.cfg” file or use the JEVOIS/config/initscript.cfg file to set which serial interface to send data out. So, for your question:

setpar serlog None
setpar serout USB

This will prevent the error and status messages from being sent over USB and only allow sending tracking data via a command to be sent. ie

jevois.sendSerial(json_pixels)

Awesome awesome stuff, looks super useful already! Gonna toss this at the team tonight and we’ll see what we can accomplish!

…and to complete the integration between the roboRIO and JeVois, on the roboRIO side you just use the normal WPILib SerialPort API. We’ve also tested it as part of our 2018 beta testing and it worked fine…great stuff!

  • Ron

Excellent Ron, THANKS!

We had no intention of covering the roboRIO side in our original document, but maybe it would be a really good thing to add. The only question is, which language(s) to cover. We are a Java team, so that’s a no-brainer.
OK, I’ll add it to the list.

It’s always my philosophy that it is better to share and document what ever you do and don’t worry about covering things you don’t use. If there is demand someone will publish a labview or C++ example later if you publish the Java code in your document.

I just uploaded v0.32.
This version includes links to the WPILib serialPort documentation.

Thanks for the replies, this product looks really promising. I went ahead and ordered one to try out, maybe it will make it to our robot next year! The Android phone is much more expensive and annoying to deploy to.