Go to Post Note: Please don't actually mob them or cause them any harm. It's just a saying people. :) - CalTran [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-02-2012, 00:27
hsekhon27 hsekhon27 is offline
Registered User
FRC #0280 (TNT)
Team Role: Programmer
 
Join Date: Dec 2011
Rookie Year: 2011
Location: Taylor, MI
Posts: 23
hsekhon27 is an unknown quantity at this point
Help with image processing

After I make a vi for image processing in the vision assistant software and upload it to my robot programming, how do I make the camera track what I specified? For example, I want the camera to track a square and I mount the camera on a servo. How do I program the servo to move for the camera to track?
  #2   Spotlight this post!  
Unread 12-02-2012, 09:09
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,751
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: Help with image processing

The default code did this in 2009, and in LV the example still ships. It is called Two Servo Camera Control or something like that.

Think about the center of the camera image as the origin. If the target is not in the center, it is some distance away, and that error term can be scaled and added or subtracted to the servo value to "center" it. The servo already has mechanism to maintain its position, so you only need to give it a set point. Play around with a 1D version of this and I think you'll find it easy to do. Then add the second dimension.

Greg McKaskle
  #3   Spotlight this post!  
Unread 12-02-2012, 10:00
hsekhon27 hsekhon27 is offline
Registered User
FRC #0280 (TNT)
Team Role: Programmer
 
Join Date: Dec 2011
Rookie Year: 2011
Location: Taylor, MI
Posts: 23
hsekhon27 is an unknown quantity at this point
Re: Help with image processing

Quote:
Originally Posted by Greg McKaskle View Post

Think about the center of the camera image as the origin. If the target is not in the center, it is some distance away, and that error term can be scaled and added or subtracted to the servo value to "center" it. The servo already has mechanism to maintain its position, so you only need to give it a set point. Play around with a 1D version of this and I think you'll find it easy to do. Then add the second dimension.

Greg McKaskle
Thanks, but lets say I didn't want the servo to move and the robot had to turn to point at the target. How does the robot know whether to use a servo or the drive motors? Do I program the servo or motors in vision processing vi?
  #4   Spotlight this post!  
Unread 12-02-2012, 10:13
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,751
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: Help with image processing

Well you asked about a servo, and if you have never done this before, that is a pretty easy way to experiment.

If you later want to rotate the robot, you now need to work on getting the robot to pivot and stop at a particular direction. This is quite a bit harder than a servo or lazy-susan turret, but using a PID or other control algorithm and a gyro will be a good place to start.

The default 2010 code contained simple code that used an image to locate the circular target, and a gyro and PID to turn the robot to point at the target.

Greg McKaskle
Closed Thread


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 00:48.

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