Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sudden aircraft crash after "pauseSim" command #91

Closed
EnderUPC opened this issue Mar 29, 2016 · 7 comments
Closed

Sudden aircraft crash after "pauseSim" command #91

EnderUPC opened this issue Mar 29, 2016 · 7 comments

Comments

@EnderUPC
Copy link

Hi folks,

There is a sudden aircraft crash after using pauseSim(0,Socket). After that, aircraft has abnormal attitude For example, pitch deg goes to 80 deg suddenly and then other attitudes become useless.
Is there anyone who has any idea?

My code is simple as in matlab example file in Xplane Connect
Xpconnect.txt

Thank you,

@teubert
Copy link
Contributor

teubert commented Mar 29, 2016

Hello Endf22,

This is interesting. The cause is not immediately obvious to me. I'll try your script and get back to you later today.

In the meantime could you attach the XPCLog file created by the plugin. It should be in the same directory as the Plugin.

Thanks,
Chris

@EnderUPC
Copy link
Author

Hello,
I am trying to understand the reason why aircraft behaves like that.
I sent the XPCLog file
XPCLog.txt
Thank you,
Ender

@teubert
Copy link
Contributor

teubert commented Mar 30, 2016

Hello again Endf22,

I ran your scripts and I'm getting exactly the same behavior as you described. I reran the Matlab Example script and I get this behavior as well. I now remember this being an unanswered issue where the transition between paused and unpaused can be violent. I'm going to leave this open and continue to investigate.

A few possible causes come to mind:

  1. There is another control/state variable that is not set that is acting on the plane
  2. After resuming it takes a timestep for the changes to take affect.

@jason-watkins Do you have anything else to add here?

I want to get to the bottom of this though. Let me know if you discover anything in your investigations.

Sorry I can't be more help at this point.

Thanks,
Chris

@EnderUPC
Copy link
Author

Hi again,
I have found this info about the transitioning from disabled to enabled flight model.
http://www.xsquawkbox.net/xpsdk/mediawiki/MovingThePlane#Transitioning_From_Disabled_to_Enabled_Flight_Model
That link mentions that velocity vector and the quaternion q should be calculated in order to match with other flight control parameters such as angular rotation variables (p,q,r).

The other problem I have found so far in the plugin is that sendPOSI command is not working as expected. The altitude and the position inputs dont match with the outputs. For example altitude input is 1500 ft. (alt_msl) but it moves aircraft to somewhere else and then A/C crashes.

Thank you,

@jason-watkins
Copy link
Contributor

Thanks for the research Enf!

I don't have my PC with me today, but I'll take a look and make sure our code conforms to the information provided in your link when I get a chance.

The sendPOSI command should work, but there are a lot of edge cases. Could you post the approximate location of the airplane before sending the command along withe the coordinates you are moving it to?

Chris, I remember this issue as well. In fact, I thought I had fixed it, but I can't find a matching issue so maybe not. It looks like the link above addresses the issue directly, so it should be a straightforward fix.

@EnderUPC
Copy link
Author

Hi,
The approximate location is that;
Airport: KSAN (San Diego Intl)
Situation: Approach 10nm
lat: 37.78
long:-117.4
alt:1500 ft. (alt_msl)

@jason-watkins
Copy link
Contributor

Finally found time to review this. We were not resetting the speed and orientation. I've added code to update the orientation. Updating velocity is going to take significantly more work, and I'm not entirely sure that it's actually necessary for normal use.

@teubert teubert mentioned this issue Apr 24, 2017
@teubert teubert closed this as completed in 35285ca May 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants