Hey all, I'm working on a DLL based spacecraft project in my spare time and can't figure out how to accomplish something fairly important to the project. I looked through the forum history and the SDK docs but haven't had much luck; hoping the forum can help out.
What I am looking to do is detect whether or not my spacecraft is currently the payload of an off the shelf launcher. And more specifically, I want to be able to detect the "your spacecraft has been jettisoned by the launcher and is now no it's own in orbit" so that I can initiate my spacecraft's startup/main functions.
The two launcher's I'm using are the Energia and The Falcon collection.. both are really great launchers and I am particularly fond of the Falcons since I'm looking to get as realistic as I can with the project. Both also produce exactly the same results in the following cases.
I've tried GetFlightStatus() and the freeflight/vs landed bit accurately reflects the status of my craft while attached to either launcher. When the launcher lifts off my craft is shown as in flight. But, in either state the second bit is always 0.. so my craft doesn't know it's attached to something.. Tried getting similar info back from GetStatus() and didn't have any luck.
Say mine is a mothership which launches cubesats or something.. it wouldn't help to detect freeflight at lift off and then start ejecting the cubesats.. it's got to wait till orbit.
I tried counting attachments with AttachmentCount(), both parent and child.. no luck. Tried grabbing dock handles but always get Null back... So I am assuming that the launchers do something in their own code to manage payloads which doesn't really allow for easy detection.
I suppose I could always use freeflight status + altitude to detect if I am in orbit or not... but then the spacecraft is specific to one body as a lunar orbit could be under 100km which earth could not..
Anyone know of a way to solve this sort of thing and actually detect this kind of thing explicitly?
What I am looking to do is detect whether or not my spacecraft is currently the payload of an off the shelf launcher. And more specifically, I want to be able to detect the "your spacecraft has been jettisoned by the launcher and is now no it's own in orbit" so that I can initiate my spacecraft's startup/main functions.
The two launcher's I'm using are the Energia and The Falcon collection.. both are really great launchers and I am particularly fond of the Falcons since I'm looking to get as realistic as I can with the project. Both also produce exactly the same results in the following cases.
I've tried GetFlightStatus() and the freeflight/vs landed bit accurately reflects the status of my craft while attached to either launcher. When the launcher lifts off my craft is shown as in flight. But, in either state the second bit is always 0.. so my craft doesn't know it's attached to something.. Tried getting similar info back from GetStatus() and didn't have any luck.
Say mine is a mothership which launches cubesats or something.. it wouldn't help to detect freeflight at lift off and then start ejecting the cubesats.. it's got to wait till orbit.
I tried counting attachments with AttachmentCount(), both parent and child.. no luck. Tried grabbing dock handles but always get Null back... So I am assuming that the launchers do something in their own code to manage payloads which doesn't really allow for easy detection.
I suppose I could always use freeflight status + altitude to detect if I am in orbit or not... but then the spacecraft is specific to one body as a lunar orbit could be under 100km which earth could not..
Anyone know of a way to solve this sort of thing and actually detect this kind of thing explicitly?