how to move motors using axis 206 camera

i am the programmer from Team 2197, right now i am learning how to intigrate vision into a robot project, i have the vision processing from the rectanglular target- 2013 project into our project, but what i do not know how to do is…how to program it so we can hit a button, and the camera will track to a certain target, lets say the high goal. i have a some programming experience but i am still learning, and the camera is new to me :stuck_out_tongue: thank you for any help you can give!

If you will describe more about your robot, you’ll get better advice.

Does the robot have a turret, or do you need to drive or rotate in order to point at the target?

What sensors does the robot have on it that may help it know how much it is moving or turning?

Greg McKaskle

we have a shooter attached to the robot, it doesnt swivel, its gonna be static on the robot, we are using the kit frame, but our shooter is shooting sideways, so if we are pointing forward, the shooter is pointing to the left, and we have encoders (noooo idea how to program them yet) and working on limit switches, if you need anything else let me know!

So I assume, or suggest that the camera point to the left also, similar alignment to the shooter. Determine where the shots hit the wall and align the camera so that its image contains the shot, ideally centered horizontally and perhaps with the shot to the upper third of the screen.

When the code detects a target, it returns the position in a -1 to 1 coordinate space which you can use as an error term to drive the robot forward or backward until centered. You may need to reverse the error term before feeding it to robotDrive.

Once the error is low enough, go through your shooting sequence. Especially if you are processing on the cRIO, keep in mind that the camera is a pretty slow sensor and the robot may move too far between frames if it moves quickly. Also, once target is close enough, you can disable the vision.

Greg McKakskle

thank you, also, one other thing…do you know where i can find any documents of some sort to help me program the camera? i already intigrated the 2013 example, but i wanted to know if there was more in depth documentation how like, how to code motors to move if a certain image is shown, like the high goal is seen by the camera, so the robot adjusts so it is in the center of the camera (by moving the drivetrain so the whole robot is facing the goal for a shot)

I don’t mean to split hairs, but the camera is a sensor that returns images. It doesn’t recognize things, and it has no idea what a motor is. That is something your code needs to do. The example demonstrates how the code can identify rectangles in an image, identify where the center of the rectangle is and which type of rectangle it most likely is. Try using the coordinates returned from the camera in much the same way as a joystick to move the robot.

Greg McKaskle

thank you, im still learning labview, i was just begining to grasp it last year and then well, Labview FRC 2013 happened :stuck_out_tongue: thank you for all your help!