Jump to content

danderson

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by danderson

  1. For my own project, I need a bunch of things that mechjeb's VesselState helpfully defines - things like a north/east/up coordinate system, velocity vectors in various reference frames, and vectors for various useful attitudes (radial, normal etc.). I'm having trouble grokking the definition and use of surfaceRotation. From the code (I'll assume for the discussion that we're analyzing a ship in a standard 100km orbit around Kerbin): // Define a coordinate system in which up is away from the planet, east is in the direction of // the planet's rotation, and north points north-ish (while remaining normal to east/up). public Vector3d east, north, up; public Vector3d CoM; // Vessel's center of mass. // ??? public Quaternion surfaceRotation = Quaternion.LookRotation(north, up); // Velocity in the universe inertial reference frame. public Vector3d velocityVesselOrbit = vessel.orbit.GetVel(); // Velocity in the planet's rotating reference frame, i.e. velocity relative to the surface. public Vector3d velocityVesselSurface = velocityVesselOrbit - vessel.mainBody.getRFrmVel(CoM); // ??? public Vector3d velocityMainBodySurface = rotationSurface * velocityVesselSurface; My current understanding is that surfaceRotation defines a rotation that would take the world coordinate system and rotate it such that, standing on the point of Kerbin directly below the ship, the Y axis increases away from the surface and X increases with latitude. Then, we move on to the velocity vectors. velocityVesselOrbit is the ship's velocity vector in Unity world coordinates, roughly equivalent to an inertial reference frame anchored to the planet's center (this ignores the fact that the world origin moves around to maintain floating point precision, but everything is consistent within one physics update). velocityVesselSurface is the ship's velocity vector in the planet's rotating reference frame, in other words speed relative to the point of the planet's surface directly below. And finally, velocityMainBodySurface... Assuming my understanding of surfaceRotation is correct, I think that this just transforms the rotating frame velocity vector to a coordinate system where Y is away from the surface, instead of Y being an arbitrary direction defined by Unity. In other words, if you plunk a Jeb down at the point directly below the ship, he would say that the vessel is moving at velocityMainBodySurface relative to him, assuming that X is north and Y is up into the sky, and Z is whatever direction matches unity's coordinate handedness. Does all this sound correct? velocityMainBodySurface isn't used in MJ as far as I can tell, so all I have to go on is what I think I understand of quaternions and Unity's coordinate system.
  2. Nice! I'm doing something similar, with a few more mods thrown in (life support, deadly reentry, FAR aerodynamics). So far, RemoteTech has provided the most fun by far. Stupid question: what is the purpose of the elliptical equatorial constellation around Kerbin? From your screenshots, it seems the polar satellite can get a signal down to the LKO constellation without them, and that polar satellite is all that's needed for beyond Kerbin comms.
  3. So, is vector math known to be broken? I was expecting "lock x to facing - prograde" to give me a vector that I could then reason about to determine whether or not I'm at the attitude I locked in, but I get back values which don't wrap correctly, e.g. R(1,361,724). As other posts in this thread seem to confirm, this makes it very hard to reason about any kind of orientation in space. Or am I just doing something wrong?
  4. I've been testing RT2, and I can't seem to get remote command to work. I have the stock 3-person capsule (fully manned) with a small omni, and one of the RT microsats within 100m (antenna and solar panels deployed), but the microsat still says it has no connection. Am I doing something wrong, or is remote command not functional yet?
×
×
  • Create New...