Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use any procedure of maneuver_planner #9

Closed
Wozahru opened this issue Apr 19, 2020 · 5 comments
Closed

Unable to use any procedure of maneuver_planner #9

Wozahru opened this issue Apr 19, 2020 · 5 comments

Comments

@Wozahru
Copy link

Wozahru commented Apr 19, 2020

Describe the bug

krpc.types.MJServiceException: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at KRPC.MechJeb.Maneuver.Operation..ctor (System.String operationType) [0x00054] in <80555fe871a148ce8f8a632019cf2177>:0 
  at KRPC.MechJeb.Maneuver.TimedOperation..ctor (System.String operationName) [0x00000] in <80555fe871a148ce8f8a632019cf2177>:0 
  at KRPC.MechJeb.Maneuver.OperationTransfer..ctor () [0x00000] in <80555fe871a148ce8f8a632019cf2177>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
   --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0007a] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at KRPC.MechJeb.ExtensionMethods.TypeExtensions.CreateInstance[T] (System.Type type, System.Object[] args) [0x00043] in <80555fe871a148ce8f8a632019cf2177>:0 
Server stack trace:
  at KRPC.MechJeb.ExtensionMethods.TypeExtensions.CreateInstance[T] (System.Type type, System.Object[] args) [0x00080] in <80555fe871a148ce8f8a632019cf2177>:0 
  at KRPC.MechJeb.ManeuverPlanner.GetOperation[T] (System.Int32 id) [0x00010] in <80555fe871a148ce8f8a632019cf2177>:0 
  at KRPC.MechJeb.ManeuverPlanner.get_OperationTransfer () [0x00000] in <80555fe871a148ce8f8a632019cf2177>: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 <ad04dee02e7e4a85a1299c7ee81c79f6>:0

Code snippet to reproduce it (ideally in Python)

sc = conn.space_center
mj = conn.mech_jeb

sc.target_body = sc.bodies['Mun']

planner = mj.maneuver_planner
hohmann = planner.operation_transfer
hohmann.make_node()

Version details
kRPC.MechJeb: 0.5.1
Kerbal Space Program: 1.9.1
kRPC: 0.4.8
MechJeb2: 2.9.1.0 and 2.8.3.0

@Wozahru
Copy link
Author

Wozahru commented Apr 19, 2020

Clearing mods and reinstalling with CKAN instead of curse solve the issue

@Wozahru Wozahru closed this as completed Apr 19, 2020
@yjchun
Copy link

yjchun commented Apr 28, 2020

I am having same problem. It was ok with Mechjeb2 2.8.4 but after updating to 2.9.1.0, this error occurs.

@Genhis
Copy link
Owner

Genhis commented Apr 28, 2020

@yjchun Could you please send me the log file?

  1. Open KSP, load a save and run your script
  2. If you got the same error, close KSP
  3. Attach Kerbal Space Program/KSP.log to your github comment

@yjchun
Copy link

yjchun commented Apr 29, 2020

Tested again. First two errors are testing of maneuver_planner.operation_transfer.make_node(), and last one error with maneuver_planner.operation_circularize.make_node().

Version details
kRPC.MechJeb: 0.5.1
Kerbal Space Program: 1.9.1
kRPC: 0.4.8
MechJeb2: 2.9.2.0

sc = conn.space_center
mj = conn.mech_jeb
#
#sc.target_body = sc.bodies['Mun']

# planner = mj.maneuver_planner
# hohmann = planner.operation_transfer
# hohmann.make_node()

circularize = mj.maneuver_planner.operation_circularize
circularize.time_selector.time_reference = mj.TimeReference.apoapsis
circularize.make_node()

KSP.log

@yjchun
Copy link

yjchun commented Apr 29, 2020

Sorry for confusion but it seems this error is new with MechJeb2 2.9.2.0. Works ok with 2.9.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants