Go to Post ...the hardest part of engineering is communication. - EricVanWyk [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-02-2011, 17:23
Wicked Wicked is offline
Registered User
FRC #0354 (G-House Pirates)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: New York
Posts: 46
Wicked is an unknown quantity at this point
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 17-02-2011, 21:56
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-02-2011, 15:52
Wicked Wicked is offline
Registered User
FRC #0354 (G-House Pirates)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: New York
Posts: 46
Wicked is an unknown quantity at this point
Re: Vision processing

We were actually thinking of using strafing to align with the pole.

Can you elaborate on "simple trigonometry"?
Reply With Quote
  #4   Spotlight this post!  
Unread 18-02-2011, 16:16
CrazyCarl461's Avatar
CrazyCarl461 CrazyCarl461 is offline
Power User
AKA: Carl Agnew
FRC #0461 (Westside Boiler Invasion)
Team Role: Coach
 
Join Date: May 2003
Rookie Year: 2001
Location: West Lafayette, IN
Posts: 189
CrazyCarl461 has a brilliant futureCrazyCarl461 has a brilliant futureCrazyCarl461 has a brilliant futureCrazyCarl461 has a brilliant futureCrazyCarl461 has a brilliant futureCrazyCarl461 has a brilliant futureCrazyCarl461 has a brilliant futureCrazyCarl461 has a brilliant futureCrazyCarl461 has a brilliant futureCrazyCarl461 has a brilliant futureCrazyCarl461 has a brilliant future
Send a message via AIM to CrazyCarl461
Re: Vision processing

You could use a PID to strafe and line yourself up horizontally with the pole.
  1. Mount your camera such that the center of the image is "straight ahead" for the robot.
  2. If you can see the end of the peg you want to hang on in your image, make the distance between that and the center of your image equal to the error.
  3. Strafe in the correct direction until the error is zero!
As far as stopping at the right forward position. You can use a triangulation method like Alan said. If you don't want to calculate anything, just see what vertical height of the target in your image corresponds to the forward position you are looking for. Set up a PID for that as well with the setpoint equal to that vertical position in your image.
__________________
My 2011 Build Season Blog
Resistance may be futile, but capacitance has potential!
© All content is protected by the honor system
Reply With Quote
  #5   Spotlight this post!  
Unread 18-02-2011, 17:26
Wicked Wicked is offline
Registered User
FRC #0354 (G-House Pirates)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: New York
Posts: 46
Wicked is an unknown quantity at this point
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?
Reply With Quote
  #6   Spotlight this post!  
Unread 18-02-2011, 22:03
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
  #7   Spotlight this post!  
Unread 15-01-2012, 21:51
Lawlhwut Lawlhwut is offline
Registered User
None #2853
 
Join Date: Jan 2011
Location: Hawaii
Posts: 17
Lawlhwut is an unknown quantity at this point
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.
Reply With Quote
  #8   Spotlight this post!  
Unread 15-01-2012, 21:53
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
  #9   Spotlight this post!  
Unread 15-01-2012, 22:04
Lawlhwut Lawlhwut is offline
Registered User
None #2853
 
Join Date: Jan 2011
Location: Hawaii
Posts: 17
Lawlhwut is an unknown quantity at this point
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?
Reply With Quote
  #10   Spotlight this post!  
Unread 15-01-2012, 22:19
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
  #11   Spotlight this post!  
Unread 15-01-2012, 22:23
Lawlhwut Lawlhwut is offline
Registered User
None #2853
 
Join Date: Jan 2011
Location: Hawaii
Posts: 17
Lawlhwut is an unknown quantity at this point
Re: Vision processing

Thanks for your help. Really appreciate it.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi