Search the Community
Showing results for tags 'coordinate'.
The search index is currently processing. Current results may not be complete.
-
Since the autorove mod is not updated, and it does not seem like it will happen soon, I'm considering assume maintenance. However, my first attempt in getting it to work in KSP 1.1.2 was only partially successfull. My first autorove ended up underground.... That's no good Currently the mod is calculating the height at which to place the rover, at a given latitude/longitude on a specific body like this. internal static double surfaceHeight(double latitude, double longitude, CelestialBody body) { Vector3d pqsRadialVector = QuaternionD.AngleAxis(longitude, Vector3d.down) * QuaternionD.AngleAxis(latitude, Vector3d.forward) * Vector3d.right; double altitude = body.pqsController.GetSurfaceHeight(pqsRadialVector) - body.pqsController.radius; return altitude; } Now my question is, what is the best way to calculate the height to put the vessel after moving it. There must be some robust way of determining where to spawn the vessel, I'm just not sure how. Can anybody help me figuring this out?
-
I'm working on yet another landing guidance plugin. I'm almost ready to share an early version, but I'm having trouble with the coordinate system. In particular, I'm trying to find the latitude and longitude of the active vessel on its current orbit at some arbitrary time in the future, taking into account the rotation of the planet. The code looks something like this (with a nod to KER for inspiration): Vector3d position = vessel.GetOrbit().getPositionAtUT(currentTime + deltaT); double bodyRot = 360 * (deltaT) / body.rotationPeriod; double lat = body.GetLatitude(position); double lon = NormAngle(body.GetLongitude(position) - bodyRot); //NormAngle normalises the angle between -180, 180. When I continue on the current orbit and sample the actual lat and long at UT = currentTime + deltaT, I find: a ) Lat and long are both a bit off (0-2 degrees), thought long is usually more wrong than lat (possibly suggesting that my bodyRot is incorrect). b ) The error is greater the further in advance I try to calculate the lat and long (if I calculate no more than a few minutes into the future the error is negligible). I suspect that my understanding of the value returned by Orbit.getPositionAtUT() might be incorrect. It seems to return a value which is sort of "the position that the vessel would be in at time UT if the main body stopped moving", which I think would make my logic consistent. But either of those assumptions may be wrong. Can anyone offer any advice, or an alternative method?
-
- orbit
- coordinate
-
(and 1 more)
Tagged with: