Go to Post A good robot can score a lot of points. A great robot can do it when the other alliance does everything they can to stop it. - Rick TYler [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 11-02-2006, 23:48
LightWaves1636's Avatar
LightWaves1636 LightWaves1636 is offline
is all over it.
AKA: Sarah Le
no team
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Austin, TX
Posts: 603
LightWaves1636 is a splendid one to beholdLightWaves1636 is a splendid one to beholdLightWaves1636 is a splendid one to beholdLightWaves1636 is a splendid one to beholdLightWaves1636 is a splendid one to beholdLightWaves1636 is a splendid one to beholdLightWaves1636 is a splendid one to behold
Send a message via AIM to LightWaves1636 Send a message via Yahoo to LightWaves1636
Question camera in autonomous

Sorry if this thread is bothersome but I need help. I haven't had time to ask our mentor because of his work and our captain is too busy with getting a successful launcher. I know how to program for the RC and to get the robot to move in autonomous like forward, back, left, right, and for a certain amount of time but with adding the camera, I have no clue how to add the camera to autonomous since I have no idea about it except configuring it. So can anyone give me an example because I'm pretty good at self-learning from example.
__________________
FLL Team - Hackberry Hill Elementary - Arvada, CO ('08 - '10 Coach)
FRC Team 1636 - Reds Robotics - Arvada High School - Arvada, CO ('05 - '07 Alumni)
FRC Team 1583 - Rambotics - Ridgeview Academy - Watkins, CO (Volunteer/Supporter)
FRC Team 2859 - Blasterbots - CSM Robotics Outreach - Golden, CO ('09 - '10 Coach)
FRC Team 3320 - Miracles & Machines - Eastside Memorial High School - Austin, TX ('10 - '12 Mentor)
  #2   Spotlight this post!  
Unread 12-02-2006, 00:20
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: camera in autonomous

Quote:
Originally Posted by LightWaves1636
Sorry if this thread is bothersome but I need help. I haven't had time to ask our mentor because of his work and our captain is too busy with getting a successful launcher. I know how to program for the RC and to get the robot to move in autonomous like forward, back, left, right, and for a certain amount of time but with adding the camera, I have no clue how to add the camera to autonomous since I have no idea about it except configuring it. So can anyone give me an example because I'm pretty good at self-learning from example.
This is assuming you have been able to make the camera work in normal mode and I am using the "bells and whistles" version of Kevin Watson's camera code.

Copy this function into the user_routines.c then create a function prototype in user_routines.h and delete ONLY THE THINGS IN THIS FUNCTION from the user_routine.c in the Kevin Watson's camera code form the function:
void Process_Data_From_Master_Up(void)
Leave everything else in this is function as it is.

Quote:
void Camera_Control(void)
{
static unsigned char count = 0;
static unsigned char camera_menu_active = 0;
static unsigned char tracking_menu_active = 0;
unsigned char terminal_char;
unsigned char returned_value;

// send diagnostic information to the terminal, but don't
// overwrite the camera or tracking menu if it's active
if(camera_menu_active == 0 && tracking_menu_active == 0)
{
Tracking_Info_Terminal();
}

// This function is responsable for camera initialization
// and camera serial data interpretation. Once the camera
// is initialized and starts sending tracking data, this
// function will continuously update the global T_Packet_Data
// structure with the received tracking information.
Camera_Handler();

// This function reads data placed in the T_Packet_Data
// structure by the Camera_Handler() function and if new
// tracking data is available, attempts to keep the center
// of the tracked object in the center of the camera's
// image using two servos that drive a pan/tilt platform.
// If the camera doesn't have the object within it's field
// of view, this function will execute a search algorithm
// in an attempt to find the object.
if(tracking_menu_active == 0)
{
Servo_Track();
}

// this logic guarantees that only one of the menus can be
// active at any giiven time
if(camera_menu_active == 1)
{
// This function manages the camera menu functionality,
// which is used to enter camera initialization and
// color tracking parameters.
camera_menu_active = Camera_Menu();
}
else if(tracking_menu_active == 1)
{
// This function manages the tracking menu functionality,
// which is used to enter parameters that describe how
// the pan and tilt servos will behave while in searching
// and tracking modes.
tracking_menu_active = Tracking_Menu();
}
else
{
// has the user sent any data via the terminal?
terminal_char = Read_Terminal_Serial_Port();
// check to see if any "hotkeys" have been pressed
if(terminal_char == CM_SETUP_KEY)
{
camera_menu_active = 1;
}
else if(terminal_char == TM_SETUP_KEY)
{
tracking_menu_active = 1;
}
}

// This funtion is used by the functions Camera_Menu() and
// Tracking_Menu() to manage the writing of initialization
// parameters to your robot controller's non-volatile
// Electrically Erasable Programmable Read-Only Memory
// (EEPROM)
EEPROM_Write_Handler();
}
This is basicly just copying the camera stuff to a different function so I can call it somewhere else.
Now you can call this function from user_routines_fast.c in the autonomous code.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripting Setup and the Camera + Serial Port Drivers CJO Programming 22 11-01-2006 17:42
Camera in Autonomous tamirms Programming 2 19-02-2005 23:47
Autonomous With Camera schenkin Programming 20 16-02-2005 23:52
Autonomous Camera Integration GregC Programming 2 06-02-2005 14:34


All times are GMT -5. The time now is 17:52.

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