ensure that heading is between -M_PI and M_PI.