You might try splitting things up, temporarily to get to the bottom of it...
Code:
int nav_heading;
int new_pos;
int old_pos;
int dist=0;
int nav_x;
int nav_y;
void Navigation(void)
{
float temp ;
nav_heading = Get_Gyro_Angle();
new_pos = (int)( Get_Left_Encoder_Count() + Get_Right_Encoder_Count() )/2;
dist = (new_pos - old_pos);
/*nav_x+= (int) cos((float) nav_heading /1000) * dist;*/
/* ...add printfs to keep checking the value of temp*/
temp = (float) nav_heading ;
temp /= 1000. ;
temp = cos(temp) ;
temp *= (float)dist ;
nav_x = (int)temp ;
nav_y+= (int) sin((float)nav_heading/1000) * dist;
old_pos = new_pos;
}
That always helps me figure out casting peculiarities...
Eric