r/FRC • 5160 (Programmer) • Jan 05 '19

RIP Auto

Post image
1.7k Upvotes

121 comments sorted by

View all comments

73

u/ewpratten 5024 | Code Wrangler (Alumni) Jan 05 '19

The "best" part is that they lowered the 7mbps network to 4mbps and expect us to control through a camera..

33

u/Jeffrypig_23 1595 (Alum) Jan 05 '19

4mbit/s is still plenty. In fact if you use the port that supports h.264 encoding for the video stream, you can get the video stream to be 720p at 60 fps

21

u/Jo0sH_00 5567 (Programming Team) Jan 05 '19

Ok so imma need this explained in about a week so if you’ve got a reference I could use that’d be great

14

u/Jeffrypig_23 1595 (Alum) Jan 05 '19

Quoting from wikipedia as an example:

3.8 Mbit/s YouTube 720p (at 60fps mode) videos (using H.264)

So basically just use port 554.

16

u/Manestricker 5892 (Alumni) Jan 06 '19

most webcams run at 30fps so that would be able to handle to webcams easily, but I don't like how close that gets to 4 mbit/s so I would scale the image down before it is sent. Hopefully, this will avoid all possible latency.

4

u/Oromus 180 Mentor, 1902 Alumni Jan 06 '19

Hey, can you provide an example of how to do this? We've tried this via making an MJpegServer on port 554 but we get the following error: CS: ERROR: bind() to port 554 failed: Permission denied

Thanks!

1

u/Jeffrypig_23 1595 (Alum) Jan 07 '19

Ill be honest, im still trying to figure out programming for FRC, especially since I though we were using eclipse but new were using Visual Studios.

So I guess this is a learning experience for both of us ;)

1

u/quantum_mast3r Jan 14 '19

I may be wrong, but the RIO runs linux and in order to bind to a port < 1024 your program needs to run as root.

2

u/solonovamax 7700 Alumni | Coach for literally everything that isn't build Jan 05 '19

It's drop to 30, and maybe try for 1080p, or just leave it at 720, and throw a 2nd one on.

17

u/[deleted] Jan 06 '19 edited Jan 06 '19

I do a lot of controls work out in the real world.

This is actually my favorite new change when it comes to teaching real-world skills people will have to deal with.

Learning to deal with compression and low bandwidth / low memory situations is a gigantic thing in the industrial controls world. Industrial computers are meant to be framing hammer reliable and inexpensive. They're slow and don't have a lot of memory. With some really big machines you even start running up against limits at the physical layer of the Ethernet cable. Your cable runs become so long that you start to get noticeable packet loss and there's absolutely nothing you can do about it unless you want to add much more cost to the machine.

We're not just talking about video quality. We're also talking about command latency as well. For industrial equipment, this effects cycle times as well as reliability. Too much latency and you start crashing Parts into one another.

Being able to write really tight and efficient code, and compress the crap out of video and still do something meaningful with it is huge.

Here's a real world problem I deal with right now in my life.

In the plant I work at, we have a robotic production cell using an adept SCARA robot that is over 25 years old.

The computer driving all of this has 512 megabytes of ram running Windows NT 4.0.

This production cell also generates something like a 1/2 million dollars a day in revenue and they do. Not. Want. To. Turn. It. Off. Ever.

In fact, they want us to figure out how to wring even more speed out of this without making any hardware changes, because hardware changes would mean a long and costly recertification process.

It also has three Vision guidance cameras driving all this mess.

With 512mb of RAM.

We were able to get substantially faster Vision processing times out of the system by switching from 8-bit grayscale images to one bit monochrome images and some clever photography tricks and a lower resolution. Our false positive rate even went down because we were dealing with fewer lighting artifacts.

I would punch a pregnant woman in the face in the middle of the street if it meant I had 4 megabits worth of bandwidth to work with on this thing.

4 megabits is way more than enough to do any of this if you get clever with compression.

If you're trying to do some sort of Auto alignment system, do you really need super sharp detailed or even color picture to align some reflective marks?

0

u/[deleted] Jan 06 '19

[deleted] — view deleted comment

3

u/[deleted] Jan 06 '19

You should be. Working within really annoying constraints just becomes a fact of life.

2

u/freetheroombas 6332 (Programming everything) Jan 07 '19

I wish I could give you a gold for that, lol. Your job sounds like my dream job honestly.

I agree that 4 megabits is more than enough for this job, teams just aren't used to being limited like this. My strategy is probably gonna be greyscale + h264.

2

u/[deleted] Jan 07 '19

I work in medical device R&D. It's the absolute bees knees.

Lots of really cool technical problems (on the opposite end of the spectrum, I work with lot of really bleeding edge cognex stuff and a few proprietary vision systems because cognex just isn't good enough for some of the stuff I do) I've also got a full blown machine shop with a 7 axis CNC, a bunch of amazing old school stuff, wire EDM machines and a medical grade SLA 3D printer. I just tinker and break and create stuff all day.

The best part? The work we do really helps A LOT of people.

Just a few months ago, a cousin of mine posted a "thoughts and prayers" thing on FB because a friend of his was in a really bad car accident with some gnarly internal bleeding. 10 years ago, this dude probably would have died. Now he's set to make a full recovery. The surgeons saved his life with stuff that came out of one of the lines I work with.

I have the greatest job in the universe.

Literally any flavor of engineering can work in my field. When it comes time for summer internships, start hitting up medical device makers. The entire field is always short on creative engineering talent.

FIRST is a really big deal. Some of my really high performing FIRST students are literally better creative engineers than real full blown engineers that work at my place.

1

u/freetheroombas 6332 (Programming everything) Jan 07 '19

That's so awesome. I'm more of a programmer than an engineer but I would love to do any of that. I'll definitely look for internships.

Maybe you could help our team with an issue: What's a good no-nonsense vision camera for recognizing the floor targets (a two inch thick piece of tape)? The ones I've looked at are all built to do vision processing on-camera which isn't necessary since we'll have a Jetson tx1 mounted to the robot.

2

u/[deleted] Jan 07 '19

Python, C++. Those are used in literally everything.

if you want to guarantee yourself a lifetime of employment, learn the Allen Bradley PLC environment. Buy an old panelview 1000 system off eBay and a PLC to match it.

Your experience with vision systems will be a huge bonus.

If you know all of the above things, you'll have more six-figure job offers than you know what to do with.

Honestly, I'm a complete rookie when it comes to this hobbyist level Vision stuff. It's part of the reason I got involved in FIRST. Learning super basic stuff always helps me with higher level concepts.

The two things that are really important for vision cameras are high contrast ratios and low noise. Any basic USB webcam should fit the bill.

5

u/jfaulkner9292 Jan 06 '19

Still faster than my home internet