|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Vision processing
We want to have the robot align itself with one pole, drive forward until it reaches the pole, and then hang the ubertube.
I've been looking through the 2011 Vision Example VI. It seems to have the necessary data for this (locations of the targets and the poles), but I'm not sure how to use it to control the motors. How exactly could we do this? |
|
#2
|
|||||
|
|||||
|
Re: Vision processing
If you know the location in the camera image of the pole you want to reach, and you know the location of "straight ahead" on the robot, you can compute the angle the robot needs to turn in order to aim for that pole.
If you know the height of the target in the camera image, you can compute the distance to the target using some simple trigonometry. Use the turn angle and the drive distance to derive inputs to an Arcade Drive function. |
|
#3
|
|||
|
|||
|
Re: Vision processing
We were actually thinking of using strafing to align with the pole.
Can you elaborate on "simple trigonometry"? |
|
#4
|
|||||
|
|||||
|
Re: Vision processing
You could use a PID to strafe and line yourself up horizontally with the pole.
|
|
#5
|
|||
|
|||
|
Re: Vision processing
Okay, I think I have a basic idea of what needs to be done.
But another question: How could we get the example vision code into the FRC framework? Does it go into VisionProcessing.vi, RobotMain.vi, or somewhere else in the code? |
|
#6
|
|||
|
|||
|
Re: Vision processing
Vision Processing sounds like a good place. And to share results, write the results to a global variable or two. Make the driving code read from the globals.
Greg McKaskle |
|
#7
|
|||
|
|||
|
Re: Vision processing
So how would one connect 2 axis cameras to the robot? The CRIO only comes with 1 ethernet port for the camera.
|
|
#8
|
|||
|
|||
|
Re: Vision processing
The ethernet port is actually to plug into the dlink switch. The switch allows you to plug in other enet devices such as the camera(s).
Greg McKaskle |
|
#9
|
|||
|
|||
|
Re: Vision processing
I thought the images from the camera had to be processed by the CRIO before being sent to the computer? Or am I gravely incorrect? If you're right, is the number of ports on the router the only limitting factor for adding additional cameras?
|
|
#10
|
|||
|
|||
|
Re: Vision processing
The camera runs a web server. It can handle connections from up to five computers at once. The DLink has room for all sorts of enet devices including cameras. If the rules don't prohibit it, you could stick another switch on the robot and connect even more devices.
Greg McKaskle |
|
#11
|
|||
|
|||
|
Re: Vision processing
Thanks for your help. Really appreciate it.
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|