Closed SkyEagle8352 closed 4 years ago
Thank you for reporting the issue, I will look into it.
Fixed. Don't forget to engage the autopilot by setting enabled = True
after launch_to_rendezvous()
call - basically the same way as you would do in GUI. :-)
Describe the bug
When calling the function launch_to_rendezvous(using the python), it reported an error as shown in the following part. But I can operate it by hand in MJ's UI. I want to know how to call the function launch_to_rendezvous by code. Code snippet to reproduce it (ideally in Python)
Screenshots Traceback (most recent call last): File "C:\Users\XXX\KSP_simulation\test\test.py", line 17, in
conn.mech_jeb.ascent_autopilot.launch_to_rendezvous()
File "", line 1, in
File "C:\Users\XXX\AppData\Local\Programs\Python\Python36\lib\site-packages\krpc\client.py", line 163, in _invoke
raise self._build_error(response.results[0].error)
krpc.error.RPCError: Object reference not set to an instance of an object
Server stack trace:
at KRPC.MechJeb.LaunchTiming.TimeToPhaseAngle (System.Double launchPhaseAngle) [0x0003c] in :0
at KRPC.MechJeb.AscentAutopilot.LaunchToRendezvous () [0x00020] in:0
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in:0
Version details kRPC.MechJeb: 0.5.0
Kerbal Space Program: 1.9 kRPC: 0.4.8 MechJeb2: 2.9.1.0