Autonomous code MUCHO MUCHO IMPORTANTE!!!!!!!!!!!!!

Hey y’all slicies!
I am stuck like a bug in a rug with this autunomous coding! I am using labview. I want a really fancy code that makes the robot follow the trailer using the camera. I have found the PID vi’s but I have no clue how to implement them. Would somebody please post a copy of their code or a sample of a working trailer follower.

I love robotics!
YATA!

Psychomonkey

Those guys did earlier today.

That guy posted c code. I am using LabView.

Sorry, shouldn’t the idea and theory still be useful to you. The words are different but the idea is the same.

Just a note- I wouldn’t expect someone to post their fully working code on here for anyone to use. People work hard on their code and I think they expect everyone to do the same hours and trial and error they did. The logic from the C code should still be able to help you out if that’s what you want.

Check out lvmastery .com/tipjar. There’s a video that shows you how to implement a state machine. A state machine can be useful for autonomous mode, where you have states that you go through one at a time, like “Move Forward”, “Spin Around”, or “Waste 'em!”.

As Akash Rastogi said, nobody is going to code an autonomous mode and hand it over to you. We will, however, point you to resources that can help you do it yourself.

Good luck!

Heres how I would do it.

First, have the camera find the green light above a trailer that you want to dump in. Next, have the robot line itself so the direction the camera is facing(hopefully in the direction of the green light) is the same direction the robot is facing. Next, drive forward. As you get closer to trailer of the robot, the camera should change pitch. You need to know at what pitch your camera is at when you are near a trailer. When you get to that pitch, tell your robot to stop moving and unload your balls.

Good luck. IMO, its really not to difficult to code. If you can follow my steps, its quite simple. Gettin the bugs out of it and making it run smooth is another story. But you need to start somewhere.

Joe’s suggestions are spot on…with one minor suggestion on my part. DO NOT WAIT until the camera locks on to a target to move forward. A human player can practically fill your trailer in the amount of time it takes to lock on.

Joe is correct, coding it to work is the easy part. Tweaking it to work accurately and consistently is a whole different story. That will take time and practice.

Note there are no green lights in this years game…

Green light, dayglow fluorescent green under strong lights, close enough.

Right?

Mmm, standing still isnt the best thing to do in auto. And yes, I realize there aren’t green lights, but I didn’t know what the green things above the trailer were called. I used green light instinctively. Everyone knew what I meant, CD seems to be a bit hypercritical nowadays.

Anyways, it seems as if the OP doesn’t have too much expierience coding. Theres no easy way to make “fancy” code do everything perfect. In fact, just asking for another team’s code is really not helping you. You have to understand the code to effectively implement it in your machine. Your best off just asking for a bit of help at regionals for code to make your robot drive forward or in a circle. I don’t mean to discourage you, by all means, go for it.

thumps head on desk I wasn’t asking to blatantly copy anybody’s code. I was just asking for somebody to show me how I would use LabView to implement the camera azimuth/elevation into autonomous. I’ve already come up with the same logic for autonomous. I’m sorry if I’ve offended anybody by being straightforward. I just need some visual examples. If anybody would like to know about where I am in the autonomous stage, here’s the link to another one of my threads:eek:

We had target tracking code that worked, but it broke when we updated the firmware and LabView. This turned out not to be such a horrible thing, because about 2/3 of the matches (and an even greater percentage in the elimination rounds) ended up with all of the robots mashed together somewhere in the middle of the field. This might change some as teams go to multiple regional competitions. However, since a lot of teams are going to just try some variations of drive straight away from human player or drive straight away and spin around, there is just not much room to try and track the target. The most important thing is to move. In the first round of qualifying our broken autonomous code caused our robot not to move, and we had 13 balls dumped in our trailer. Which was crucial our alliance losing the match.

Wow, I knew that people would jam up in the center of the field, but I never realized that it would be so bad that it would close up any possibilities of a successful homing robot. I guess now that I know this, I can rest easily and just create a timed autonomous to avoid any traffic jamming. Thank you so much for the info. :smiley: