61 double roll_deg = f.
get_Phi() * SGD_RADIANS_TO_DEGREES;
62 while ( roll_deg <= -180.0 ) {
65 while ( roll_deg > 180.0 ) {
69 double pitch_deg = f.
get_Theta() * SGD_RADIANS_TO_DEGREES;
70 while ( pitch_deg <= -180.0 ) {
73 while ( pitch_deg > 180.0 ) {
77 short int heave = (int)(f.
get_wBody() * 128.0);
82 short int roll = (int)(roll_deg * 32768 / 180.0);
83 short int pitch = (int)(pitch_deg * 32768 / 180.0);
85 unsigned char roll_b1, roll_b2, pitch_b1, pitch_b2, heave_b1, heave_b2;
87 roll_b2 = roll & 0x00ff;
88 pitch_b1 = pitch >> 8;
89 pitch_b2 = pitch & 0x00ff;
90 heave_b1 = heave >> 8;
91 heave_b2 = heave & 0x00ff;
93 snprintf( buf, 10,
"p%c%c%c%c%c%c\n",
94 roll_b1, roll_b2, pitch_b1, pitch_b2, heave_b1, heave_b2 );
100 SG_LOG( SG_IO, SG_INFO,
"roll=" << roll <<
" pitch=" << pitch <<
101 " heave=" << heave );