i know it’s kinda last minute and all, but we still want to attempt to use the axis camera for our robot, even though it runs fine without it. the only problem is i’m just not sure where to begin. i’m using labview and i can see that in the basic robot main there is a while loop already set up for the camera, but i’m just not sure what to do with it. could someone please help me?
wat does it need to do?
it needs to follow the green and pink fabric that we were given as a sample in the kit of parts, and then if i am able to get that working i would like to use it in autonomous mode of the robot, so that while autonomous mode is running the robot will track/follow the pink and green fabric and use this information/signal from the camera to initiate the motors to drive in that direction
that is the same thing i am trying to get accomplished. i’m type lost on the subject as well. i can get servos to follow the fabric just not motors
yeah, i’m kinda new to the whole programming thing, so i’m just not even sure where to begin.
If you camera will be mounted on the servo gimbal, then you probably want to start with the sample code for two color tracking. Try the sample exactly as it is at first, just setup your IP address, hook up the PWMs, and see if it works.
Once that works, look at the diagram of the Robot Main, see where it Gets the image and does nothing with it? Then in the example where it gets the image and calls the Find Two Color and then the State Based Servo Tracking?
Go ahead and copy the stuff from the example into the vision loop. If you use the servos, copy that loop too and place it nearby somewhere.
If you are using servos, the servo X value tells you when the robot may need to turn to face the target.
If you are not using the servos and want to control a motor, the camera is telling you how far to turn. You need to figure out how to do that with a motor, and probably a pot.
Greg McKskle
where did you find this example that you’re talking about and i’m not using servos, just motors controlled by jaguars.
I think this example is in the examples/FRC/vision folder if you’ve installed update three. And it is also discussed at length including a demo program that incorporated it on the earliest post here
http://forums.usfirst.org/showthread.php?t=11298&page=2
Greg McKaskle
i’m sorry, but when i read that thread, i couldn’t make sense of any of it. i don’t know what to do with the labview programming part of the camera as well as the physical aspect of where things should be hooked up (besides the eithernet cable to the second port on the cRIO) so, lots of detailed help would be appretiated.
where did you get the third update from?
Fist download the two color code being provided to you.
Second open the lvproj and follow the directions on the panel to test it out.
Third reread the thread and search for similar threads where others describe and even give out code that integrates this example with the template code.
Fourth start coding.
If you have more specific questions or problems, ask away.
Greg McKaskle
sorry about all this, i’m still learning, but how do you get the two colored code? where is it?
http://joule.ni.com/nidu/cds/view/p/lang/en/id/1215
Greg McKaskle
and i’m using labview, the while loop and everything that we were given as a default is still here, i havent changed anything on that part of the loop, but how do i get it to communicate with the camera and recieve signals, and then how do i get those signals to seek out the two colors, and then how do i get the motors in auto mode to react to the camera and follow the two colors when it senses them?
Have you opened and run just the camera example yet?
Not to be a pain, but if you try to do too much at once, you will run into way more issues.
After you run the VI and get it to work, then look at the example and note that both pieces of code have a camera get. That should help you get your bearings.
Greg McKaskle
This is how Our programming team worked it out. First we got the gimbal tracking to work. Next, we went into the labview program (the 2 color servo tracking code) and found the servo position variables. These vary from 0-170 degrees. Next we ran the servo angle values through a function so that they would vary from -1 to 1 (so that the jaguars could read them) and then routed those to the drive Vi’s. This is unconventional, but works fine for us.
Not unconventional at all. That is how I’d do it. at least as a first pass. This is a PID with a P of ne.
Greg McKaskle
i don’t know how to run the example, i’m not even sure where the example is, that’s why i need help, i’m sorry but i need you to be verry specific when giving me suggestions
my computer couldn’t connect to this
I’m not sure what to tell you. It works fine for me. What happens when you try to view that page? What browser, OS, computer, etc. are you using?