View Single Post
  #2   Spotlight this post!  
Unread 21-03-2009, 11:26
Sentient's Avatar
Sentient Sentient is offline
Registered User
FRC #0639 (Code Red)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Ithaca
Posts: 21
Sentient is on a distinguished road
Re: HELP: Robot Crash in Autonomous

I'm not sure if this is the root of your problem, but I don't believe you are using structs properly, and I think it's strange the compiler didn't catch it. You only need the "struct" keyword before Command when you declare the struct. So, you don't need so say

Code:
struct Command command_list_0[] = {	//DEFAULT - STAY STOPPED
		//   Command        parm 1     	parm 2   	parm 3  
		//	Steer mode		Time(Sec)	Speed		Angle
		{AUTO_STOP,       	0.0,        0.0,     	0.0}		
};
but rather

Code:
Command command_list_0[] = {	//DEFAULT - STAY STOPPED
		//   Command        parm 1     	parm 2   	parm 3  
		//	Steer mode		Time(Sec)	Speed		Angle
		{AUTO_STOP,       	0.0,        0.0,     	0.0}		
};

The only place you need the struct keyword is here, when you declare the struct:

Code:
struct Command
{
	int command;	//what command to run
	double param1;	//usually time
	double param2;	//usually speed
	double param3;	//usually angle
};
You did this quite a bit. I hope this fixes the problem. C++ may be doing something weird and unpredictable because of all those extra struct keywords.

Last edited by Sentient : 21-03-2009 at 11:29.
Reply With Quote