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.