Jump to content


Photo

Landing Rate Calculations


  • Please log in to reply
1 reply to this topic

#1 TurbofanDude

TurbofanDude

    Member

  • Members
  • PipPip
  • 14 posts
  • LocationUnited States

Posted 02 August 2012 - 11:10 PM

Hello all,

I am trying to write a bit of code to record the landing rate of a plane. I have a thread pulling data from the sim 10 times per second, and handling it accordingly. The second the aircraft the plane is on the ground it sets the data to the offset from FSUIPC (to avoid bounces, etc. from being logged as the final rate).

That being said, the data that's coming out is completely inaccurate. I know I am at fault, I just do not know where. I have checked the offset within the sim, and it is the same base number my program is receiving (so it is coming out of the sim properly), but it is NOT being converned into feet per minute properly.

My code for such is below:

int TDRATE;
FSUIPC_Read(0x030C,4,&TDRATE,&result);


double landingrate = TDRATE;
landingrate = landingrate*60*3.28084/256;
p->landingrate = (int)landingrate; //p is an aircraft data struct, p->landingrate is an int.


Even if I slam the airplane down, it reads between 70 and 160, and I've never seen any rate higher than that (even though I KNOW it is harder). Any ideas?

Collin
  • 0
Collin Biedenkapp,
TFDi Design

#2 TurbofanDude

TurbofanDude

    Member

  • Members
  • PipPip
  • 14 posts
  • LocationUnited States

Posted 02 August 2012 - 11:37 PM

I'll answer my own question. The issue was reading the landing rate from raw sim data as apposed to the flight flags I set to record it. I apologize.
  • 0
Collin Biedenkapp,
TFDi Design




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users


About simFlight - simflight.com - simflight.de - simflight.fr - simflight.nl - simflight.pt - simflight.es - simflight.it - simflight.jp - simrussia.com - simMarket