Log in

View Full Version : Axis Camera Help!!!


furiousgeorge
15-02-2009, 14:32
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?

Chris1228
15-02-2009, 14:54
wat does it need to do?

furiousgeorge
15-02-2009, 15:09
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

Chris1228
15-02-2009, 15:11
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

furiousgeorge
15-02-2009, 15:15
yeah, i'm kinda new to the whole programming thing, so i'm just not even sure where to begin.

Greg McKaskle
15-02-2009, 15:29
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

furiousgeorge
15-02-2009, 15:53
where did you find this example that you're talking about and i'm not using servos, just motors controlled by jaguars.

Greg McKaskle
15-02-2009, 16:21
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

furiousgeorge
15-02-2009, 17:36
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.

furiousgeorge
15-02-2009, 17:39
where did you get the third update from?

Greg McKaskle
15-02-2009, 17:42
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

furiousgeorge
15-02-2009, 17:44
sorry about all this, i'm still learning, but how do you get the two colored code? where is it?

Greg McKaskle
15-02-2009, 18:00
http://joule.ni.com/nidu/cds/view/p/lang/en/id/1215

Greg McKaskle

furiousgeorge
15-02-2009, 18:01
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?

Greg McKaskle
15-02-2009, 19:55
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

Hazmatt
15-02-2009, 20:02
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.

Greg McKaskle
15-02-2009, 20:09
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

furiousgeorge
19-02-2009, 16:24
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

furiousgeorge
19-02-2009, 16:26
http://joule.ni.com/nidu/cds/view/p/lang/en/id/1215

Greg McKaskle

my computer couldn't connect to this

Alan Anderson
19-02-2009, 17:32
http://joule.ni.com/nidu/cds/view/p/lang/en/id/1215my 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?

furiousgeorge
20-02-2009, 12:34
i need to know how to run the example. i'm not sure how to do it...

Greg McKaskle
20-02-2009, 16:01
First get to the URL that has been posted. If your browser doesn't work, use another computer or figure out why. If that doesn't work, get someone from another team to email it. Without the source, you will not be able to run the source.

Second, open the lvproj.

Third, set the IP address of the cRIO in the project using the properties dialog.

Fourth, open the main VI, something about tracking two colors.

Fifth, press the run arrow.

Sixth, mess with it to figure out what works, what doesn't, how to use this in your program. It is just an example and will need to be altered to integrate into your app.

Greg McKaskle