View Single Post
  #12   Spotlight this post!  
Unread 14-02-2005, 23:39
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 747
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: If statement in .h file or Indirect addressing? Kevin NAV code...

This is some really good stuff guys. Thanks for posting information and sharing your ideas. I'll have to try this when I get back, I am out of town on business away from the team right, bad timing to have to leave on business for the "real" job on the last week of the build season...

Anyway, we have done pretty much what Dave has suggested:

Code:
if(thumbwheel == 0)
	{
    cmd_list = command_list_00;
	}
else if(thumbwheel == 11)
	{
    cmd_list = command_list_11;
	}
else if(thumbwheel == 21)
	{
    cmd_list = command_list_21;
	}
else if(thumbwheel == 31)
	{
    cmd_list = command_list_11;
	}
else
	{
    cmd_list = NULL;

Then our command list looks something like this...I won't post them all, but you can see how the flow goes.


Code:
//do nothing but sit here and look pretty
struct commands command_list_00[] = {
{CMD_WAIT,                  1000,        0,      0},
{NULL,                         0,        0,      0}

};

//ok robot starting on the left or right side MODE 11
struct commands command_list_11[] = {
{CMD_DRIVE_UNTIL,         	  1400,        180,      0}, //drive time with PWM value
{CMD_SELECT_GREEN,       	     0,        0,      0}, //change color to green, no values needed.
{CMD_WAIT_UNTIL_VISLOCK_GREEN,	 0,        0,      0}, //lock on green, not values needed.
{CMD_WAIT,                 		50,        0,      0}, //YOU MUST DELAY HERE! (wait for in milli-seconds)
{CMD_DRIVE_ALIGN_COLOR,      	149,        5,      20}, //line up with tetra, PWM value and SCALER number here
{CMD_WAIT,               		50,        0,      0}, //wait in milli-seconds.
{CMD_DRIVE_UNTIL_CLOSE,         160,       200,      0}, //drive straight PWM value, then how close in second value is size bigger means closer.
{CMD_DRIVE_UNTIL,         	   600,        165,      0}, //drive time with PWM value
{CMD_SELECT_YELLOW,       	     0,        0,      0}, //change color to yellow, no values needed.
{CMD_WAIT_UNTIL_VISLOCK_YELLOW,	 0,        0,      0}, //lock on yellow, not values needed.
{CMD_WAIT,                 		50,        0,      0}, //YOU MUST DELAY HERE! (wait for in milli-seconds)
{CMD_DRIVE_ALIGN_COLOR,      	149,        5,      20}, //line up with tetra, PWM value and SCALER number here
{CMD_NO_VISION,           	    0,        0,      0}, //disable vision system no values needed
{NULL,                    	    0,        0,      0} //turn off auto mode no values needed

};
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369