View Single Post
  #2   Spotlight this post!  
Unread 23-04-2009, 09:11
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: How many Robots at the nationals had an operational Camera Track Autonomous?

Quote:
Originally Posted by Charlie View Post
Ok so now that the season is over would any of you that programmed in labview be willing to send me the code for tracking? i could never figure out how to track properly.
We were in C++, but our general idea could be adapted to Labview:

You need a gyro and the camera

1) Set up a PID controller to maintain your robot's heading at some set target (sensor input: gyro. setpoint input: some variable, let's call it targetHeading. PID output: a virtual joystick's x axis).
2) Whenever the camera detects a target, set targetHeading to (your current heading + angle offset that the camera sees the target). The robot will point itself at the target.

Having a PID heading controller is also useful if you want to run along the side of the field against the wall to pick up balls. With human control, robots tend to spin off because of the higher-grip carpet. With a heading controller, it automatically adjusts your motor's power levels to maintain its orientation relative to the wall, allowing for long runs of picking up the balls that gather on the outside of the field.

Last edited by Bongle : 23-04-2009 at 09:16.