Oh, the undocumented features!!
?
How many developers have already gone mad because of this?

Yes, applying the landed state (in whatever way) should make it dead stable.@Face : so we may use this to make landed things like launchpads dead stable even at high time warp ? That would be quite a breakthrough !
void YOURVESSEL::clbkPreStep(double simt, double simdt, double mjd)
{
OBJHANDLE h_Planet;
h_Planet = oapiGetGbodyByName("Earth"); // enter the name of the planet/moon you want
OBJHANDLE h_launchpad = GetHandle();
VESSEL *v_launchpad = oapiGetVesselInterface(h_launchpad);
VESSELSTATUS2 vs;
memset(&vs, 0, sizeof(vs));
vs.version = 2;
vs.rbody = h_Planet;
vs.status = 1; // Landed
vs.arot.x = 10; // <----- Undocumented feature "command code" to land on touchdown points !! IMPORTANT !!
vs.surf_lng = 1.9364618; // example : Wenchang Satellite Center, PRC
vs.surf_lat = 0.3423356;
vs.surf_hdg = 0.0;
v_launchpad->DefSetStateEx(&vs);
}
I think making a dedicated post for it would improve those chances, probably best in the SDK subforum.Note to admins : please sticky this !
The problem in this case is that I still have to run the playbacks in real time to record the data. I won't be able to avoid doing this myself.You might want to try to mobilise the community a bit to send in replays. Not sure you'll get much, but it's worth a try.
Also, you could see if your training set is large enough to make the AI land at least a few times successfully, feed those back into the training set and go on recursively from there. Might get rather wonky at some point, of course.
That's superb, then I will now try to get my VS2019 working properly and then extend the parser of OrbConnect with a DefSetStateEx function.Ok folks, now I feel dumb. I just took a look at the ScnEditor source code to see if there is some different function used for state setting, and low and behold, I found out why the landed state setting is not working with normal state vectors: apparently Martin used a magic number to disable the "arot" field: _V(10,0,0). If you use that number - which makes no sense according to the description of it - DefSetStateEx works as designed, even for landed states (remember that parking brake problem?). No need to do the snippet dance anymore.
I think making a dedicated post for it would improve those chances, probably best in the SDK subforum.
However, I noticed the following: I undocked from the ISS with a DG and then read out the vessel status via Orb:Connect and directly read it in again. This resulted in an offset between DG and ISS of several meters. Either the accuracy is not sufficient or the 50 ms between read and write is sufficient for that issue. I assume the latter, after all it is as if the DG would stop for 50 ms relative to the earth and the ISS moves on. If this is so, it can be fixed later by extrapolation.
Have I overlooked something else?
Yep, I calculated the same numbers this morning. So it means that everything is actually in place and working as it should.That's normal, because state vectors deal with orbital velocities. 50ms with 7km/s is 350m, after all.
What I do in multiplayer systems is to timestamp the state vectors transmitted (with the MJD it was taken at), then calculate the latency, then do RK4 to extrapolate. This reduces the jitter, but is no silver bullet for big latency (e.g. seconds upwards), which you can typically have in TCP-based setups. It is good enough for millisecond ranges, which you can achieve with UDP- or RTP-based setups. Then again the later bring along a whole bunch of other problems, like session initiation due to firewall-problems and packet drop etc.
You could also use elements instead of state vectors if your object is not thrusting. Or you use relative state vectors to get down the speed numbers.
Do I need to read Pitch, Bank and Heading and then transform this into vs.arot? I am a bit lost here.