Jump to content

Teleporting surface craft from KSC to Baikerbanur


Recommended Posts

I've written a mickey-mouse prototype of what might become a true KSP extension.

It automates the modification of a quicksave.sfs file to transplant a KSC aircraft on the runway or on the launchpad to the Baikerbanur cosmodrome.

Everything is straightforward except for the manipulation of the VESSEL.rot quaternion that expresses the vehicle attitude (presumably in Kerbin's frame of reference).

I put the same craft in both places and observed the quaternion values, K and B.

Then I wrote code that, for a vessel at KSC with quaternion 'p', performed the computation q = B.(Kinv.p)

The idea is to use Kinv to back out the orientation for K and then use B to orient the vehicle for the destination.

I am aware that quaternion multiplication is not the same as quaternion rotation.

First difficulty is that I found I had to use different numbers for the categories os SPH (horizontal) and VAB (vertical) craft and I suspect flags fall into their own category as well.

I thought I had cracked the code but the last teleport attempt was of a Screechcraft Starship and it arrived at Baikerbanur in a devilish twist.

All of this is (necessarily) outside of Unity for the moment, but I wondered if any sage advice might be proferred?  I've had half a shot at writing a real r.q.rinv rotation but it does not look promising.

Another way of looking at this would be to find a rotation that is equivalent to rotating from KSC to Baikerbanur.  Both have known coordinates, e.g.:

      KSC: lat = -0.097168916153244286       lon = -74.557681735503166
      BKB: lat = 20.652140227285638       lon = -146.42383127125942

Any thoughts about this would be appreciated.

 

Link to comment
Share on other sites

  • 4 weeks later...
On 2017/12/27 at 11:14 PM, Hotel26 said:

the computation q = B.(Kinv.p)

I did actually get this to work properly and it's been incorporated into my Telemagic utility which has gone through several releases already.  It will become a fully-fledged KSP plug-in during 2018 Q1.

Link to comment
Share on other sites

  • 1 month later...
On 1/20/2018 at 3:14 AM, Hotel26 said:

I did actually get this to work properly and it's been incorporated into my Telemagic utility which has gone through several releases already.  It will become a fully-fledged KSP plug-in during 2018 Q1.

I don't know why you want to to that manually, but KerbalKonstructs does let you use the old KSC2 launchSite. No teleportion needed. 

If you target for 1.4.1 + DLC you can also define the new LaunchSite and add it to the LaunchSite List, then in the editor you should have a UI for selecting it. 

Link to comment
Share on other sites

  • 2 weeks later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...