Giter Club home page Giter Club logo

krpc.mechjeb's Introduction

kRPC.MechJeb Service

Are you tired of manually giving commands to your rockets? Do you want to automate tourist transportation? Do you know basics of programming but don't want to bother with calculating precise steering yourself? Do you like to use MechJeb for controlling your rockets but want more automation? If all of this is true, then this KSP mod is just for you!

This addon to kRPC provides remote procedures to interact with MechJeb 2. With a simple script, you can configure MechJeb autopilots and remotely control your rocket.

Installation

  1. Install kRPC and MechJeb 2 mods.
  2. Download latest release files.
  3. Copy KRPC.MechJeb.dll to Kerbal Space Program/GameData/kRPC directory.
  4. If you are using Python, Lua or similar client libraries, you can start coding right away. For C-nano, C++, C# and Java, find the relevant file in the release archive and link it with your project.
  5. Happy coding!

If you encounter any issues, please check if your kRPC and MechJeb 2 versions are supported for your chosen kRPC.MechJeb version. Newer versions may contain breaking changes, so it may be necessary to downgrade them to the latest supported versions. A popup will notify you about potential issues when you start the game, listing functions/properties which are unavailable. If you don't see the popup, kRPC.MechJeb should work as expected.

Getting started

When you enter the flight scene or switch between vessels, it is recommended to check whether the API is ready before you call other operations. Otherwise, it may throw an exception.

Contributing

All contributions to this mod are welcome. If you are interested in contributing, please read our Contribution guidelines and Code of conduct.

See Working from source for more details how to set up the project.

TO-DO

  • Implement AdvancedTransfer maneuver operation
  • Implement AttitudeAdjustment controller
  • Implement RoverAutopilot
  • Implement SpaceplaneAutopilot (known as Aircraft Approach & Autoland)

Not implemented

  • NodeEditor (replacement in kRPC.SpaceCenter service)
  • WarpHelper

krpc.mechjeb's People

Contributors

genhis avatar mingmingrr avatar vkribo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

krpc.mechjeb's Issues

Python API: connection stream not working?

Describe the bug

I am trying the dem0 python code Advanced Launch into Orbit, and encountered errors, looks like a bug to me.

Code snippet to reproduce it (ideally in Python)

import logging


def ascending(conn):
    sc = conn.space_center
    mj = conn.mech_jeb
    ascent = mj.ascent_autopilot

    ascent.desired_orbit_altitude = 100000
    ascent.desired_inclination = 0

    ascent.force_roll = True
    ascent.vertical_roll = 90
    ascent.turn_roll = 90

    ascent.ascent_path_index = 0  # use AscentClassic as the ascent path

    path = ascent.ascent_path_classic
    path.turn_shape_exponent = 0.5  # set the turn shape to 50%
    path.auto_path = False  # don't use autopath
    path.turn_start_altitude = 3000
    path.turn_start_velocity = 120
    path.turn_end_altitude = 65000

    ascent.autostage = False
    ascent.enabled = True

    with conn.stream(getattr, ascent, "enabled") as enabled:
        enabled.rate = 1  # we don't need a high throughput rate, 1 second is more than enough
        with enabled.condition:
            while enabled():
                enabled.wait()

    print("Launch complete!")
    conn.close()


if __name__ == "__main__":
    conn = krpc.connect(
    name=config['krpc']['name'],
    address=config['krpc']['address'],
    rpc_port=config['krpc']['rpc_port'],
    stream_port=config['krpc']['stream_port'],)

    ascending(conn)

Error is:

Traceback (most recent call last):
  File "C:\Users\duche\Desktop\project\ksp_scripts\ascending\ascending.py", line 50, in <module>
    ascending(conn)
  File "C:\Users\duche\Desktop\project\ksp_scripts\ascending\ascending.py", line 28, in ascending
    with conn.stream(getattr, ascent, "enabled") as enabled:
  File "C:\Users\duche\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "C:\Users\duche\AppData\Local\Programs\Python\Python310\lib\site-packages\krpc\client.py", line 108, in stream 
    stream = self.add_stream(func, *args, **kwargs)
  File "C:\Users\duche\AppData\Local\Programs\Python\Python310\lib\site-packages\krpc\client.py", line 100, in add_stream
    return_type = self._get_return_type(func, *args, **kwargs)
  File "C:\Users\duche\AppData\Local\Programs\Python\Python310\lib\site-packages\krpc\client.py", line 184, in _get_return_type
    return cast(TypeBase, return_type_fn())
TypeError: 'ValueType' object is not callable

Expected behavior

Expected this code can continuously check the status of asent:

    with conn.stream(getattr, ascent, "enabled") as enabled:
        enabled.rate = 1  # we don't need a high throughput rate, 1 second is more than enough
        with enabled.condition:
            while enabled():
                enabled.wait()

Screenshots

Version details
kRPC.MechJeb: v0.7.0

Kerbal Space Program: 1.12.5.3190
kRPC: v0.5.2
MechJeb2: 2.14.3.0

Add a service json file

Which MechJeb2 module is your feature request related to?
None, its a general feature for the mod

Is your feature request related to a problem? Please describe:
This project seems to support Python, Lua, etc as well as C-nano, C++, C# and Java clients. However if you use another library, for example https://github.com/Cahu/krpc-mars for rust, this module wont be usable.

Describe the solution you would like:
All the rust library needs is a service json file like the bas KRPC mod already offers, probably named KRPC.MechJeb.json. From there the rust library and probably others can generate bindings.

Attempting to set SmartASS surface vel only sets yaw

Setting surface retrograde/prograde values with Smart ASS only updates yaw values in game

Code snippet to reproduce

import krpc

conn = krpc.connect(name="plz work")
smart_ass = conn.mech_jeb.smart_ass

smart_ass.autopilot_mode = smart_ass.autopilot_mode.surface_retrograde  # or prograde
smart_ass.surface_vel_yaw = 45
smart_ass.force_roll = True
smart_ass.surface_vel_roll = 45
smart_ass.surface_vel_pitch = 45
smart_ass.update(False)

print(smart_ass.surface_vel_yaw, smart_ass.surface_vel_roll, smart_ass.surface_vel_pitch)

Expected behavior
Autopilot switches to surface retrograde mode with roll, pitch, and yaw set to 45 degrees.

Actual behavior

Only yaw is set. The print statement outputs 45.0 45.0 45.0 so the values are changed (nothing is resetting them), so presumably they're just not being sent to mechjeb.

Version details
If it's important, the game has Realism Overhaul installed and I'm on Ubuntu 19.10

kRPC.MechJeb: v0.5.1

Kerbal Space Program: 1.8.1
kRPC: 0.4.8
MechJeb2: 2.9.2.0

AirplaneAutopilot class issue

Describe the bug
kRPC seems to not work (using Kerbal Telemetry)
When starting a launch, the message supplied in the screenshots area appears.

Expected behavior
Not receiving an error and kRPC functioning with Kerbal Telemetry

Code snippet to reproduce it (ideally in Python)
Not applicable

Screenshots

image

Version details
kRPC.MechJeb: 0.6.1

Kerbal Space Program: 1.10.1
kRPC: 0.4.8
MechJeb2: 2.11.0

Update the C-nano interface to work with the current kRPC/Mechjeb version

Which MechJeb2 module is your feature request related to?
Please update the C-nano client to work with kRPC 0.4.8 and MechJeb 2.8.3 over C-nano/SerialIO.

Is your feature request related to a problem? Please describe:
The C-nano client cannot connect to MechJeb, (the python client works, and so do other kRPC C-nano services). More specifically, I get a 'false' when running the krpc_MechJeb_APIReady() function linked from MechJeb.c. Attempting to perform actions (such as enabling an autopilot) doesn't do anything.

Describe the solution you would like:
Given that kRPC.MechJeb currently works over TCP and the python client, hopefully it won't be too difficult to make the C-nano client work too. I'm making an Arduino interface (https://github.com/green-codes/LDSKY) that can take advantage of MechJeb, and it'll be wonderful if you can help make that possible.

Describe alternatives you have considered:
As I can't get past krpc_MechJeb_APIReady(), all I can think of is making my Arduino interface an actual flight computer, a task that I'm in no shape to do at the moment. I really hope adding back C-nano support is something you can do relatively quickly.

Additional context:
Nothing of importance. Thank you for your attention!

Can't make a node in maneuver planner operations

Describe the bug
When I call MakeNode() on any operation, it fails with the following error:

NullReferenceException: Object reference not set to an instance of an object
	KRPC.MechJeb.Maneuver.Operation.MakeNode () (at <80555fe871a148ce8f8a632019cf2177>:0)
	UnityEngine.DebugLogHandler:LogException(Exception, Object)
	ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
	UnityEngine.Debug:LogException(Exception)
	KRPC.MechJeb.Logger:Severe(String, Exception)
	KRPC.MechJeb.Maneuver.Operation:MakeNode()
	System.Reflection.MethodBase:Invoke(Object, Object[])
	KRPC.Service.ClassMethodHandler:Invoke(Object[])
	KRPC.Service.Services:ExecuteCall(ProcedureSignature, Object[])
	KRPC.Service.Services:ExecuteCall(ProcedureSignature, ProcedureCall)
	KRPC.Service.ProcedureCallContinuation:Run()
	KRPC.Service.RequestContinuation:Run()
	KRPC.Core:ExecuteContinuation(RequestContinuation)
	KRPC.Core:RPCServerUpdate()
	KRPC.Core:Update()
	KRPC.Addon:FixedUpdate()

Expected behavior
The MakeNode() method should return a Node, not throw an exception.

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()

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

Screenshots
N/A

Version details
kRPC.MechJeb: 0.5.1

Kerbal Space Program: 1.9.1
kRPC: 0.4.8
MechJeb2: 2.9.2.0

Originally posted by @yjchun in #9 (comment)

Unable to create a transfer

Describe the bug
Upon trying to create manouver nodes for a transfer, the server gets upset

  File "b:\projects\KSP_Python_Controller\to_mun.py", line 21, in <module>
    hohmann.make_nodes()
  File "<string>", line 1, in <lambda>
  File "C:\Python39\lib\site-packages\krpc\client.py", line 163, in _invoke
    raise self._build_error(response.results[0].error)
krpc.types.MJServiceException: Object reference not set to an instance of an object
Server stack trace:
  at KRPC.MechJeb.Maneuver.Operation.MakeNodes () [0x000fb] in <f0ccb68cc19a43d1930dc76961343ebd>: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 <9577ac7a62ef43179789031239ba8798>:0

Expected behavior
It creates the manouver nodes.

Code snippet to reproduce it (ideally in Python)

import krpc

conn = krpc.connect(name="Targetmun")
sc = conn.space_center
mj = conn.mech_jeb


print("Starting Transfer")
planner = mj.maneuver_planner
hohmann = planner.operation_transfer
hohmann.make_nodes() # <- error occurs here

Version details
kRPC.MechJeb: 0.6.1
Kerbal Space Program: 1.12.3
kRPC: krpc-0.4.9
MechJeb2: 2.9.1.0

I couldn't find mechjeb 2.9.2.0 like the other issue mentioned. I was able to get the ascent guidance to work, so it's not a complete failure, just this part doesn't work. This occurs regardless of whether I had targeted the a celestial body or a vessel

I notice on startup I get "kRPC.Mechjeb may not work properly" and "MuMech.Operation_MakeNodesImpl() not found" which is probably a hint at the root cause here

autostage_limit attribute in staging controller is not read/writable

While configuring the autopilot, I noticed that, contrary to the documentation, the StagingController.autostage_limit does not change MJ2's configuration.

To reproduce:
Put a vehicle on the launch pad.
Fill the options->stop at stage# field with something characteristic (6 in the example)
Run the following program:

import krpc

conn = krpc.connect(name="Launch into orbit")

sc = conn.space_center
mj = conn.mech_jeb
ascent = mj.ascent_autopilot
st = ascent.staging_controller
st.autostage_limit
6
st.autostage_limit = 1
st.autostage_limit
6

The program reports the correct value for the field but ignores the assignment. The field does not change in MJ2's window in KSP. The attribute remains unchanged after assignment, but changes if new value is punched in via MJ2 window.

MJServiceException Error when trying randezvous script

Describe the bug
getting error when trying the Rendezvous script for python.

MJServiceException: Object reference not set to an instance of an object
Server stack trace:
at KRPC.MechJeb.Maneuver.Operation.MakeNodes () [0x000f1] in <0fc778c2e1334576bd56e9e9c3914530>: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

Expected behavior
Working without problems

Code snippet to reproduce it (ideally in Python)

import krpc
conn = krpc.connect(name="Rendezvous with target", address='192.168.1.48')
mj = conn.mech_jeb
sc = conn.space_center

print("Planning Hohmann transfer")
planner = mj.maneuver_planner
hohmann = planner.operation_transfer
hohmann.make_nodes()

#check for warnings
warning = hohmann.error_message
if warning:
    print(warning)

Screenshots

image

Version details
kRPC.MechJeb: 0.6.0

Kerbal Space Program: 1.10.2939
kRPC: 0.4.8
MechJeb2: 2.9.1
python: 3.6.9

OS:

  • Windows 10
  • Ubuntu 18.04 LTS

Unable to use any procedure of maneuver_planner

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

AscentAutopilot launch to rendezvous can not run

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)

import math
import time
import krpc

conn = krpc.connect(name='sim_demo')
vessel = conn.space_center.active_vessel
space_center = conn.space_center
mech_jeb = conn.mech_jeb
mj_ascent = mech_jeb.ascent_autopilot

for i in conn.space_center.vessels:
    if(i.name == "target"):
        target = i
conn.space_center.target_vessel = target
conn.mech_jeb.ascent_autopilot.warp_count_down = 10
conn.mech_jeb.ascent_autopilot.launch_phase_angle = 24
conn.mech_jeb.ascent_autopilot.launch_to_rendezvous()

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

Transform public API into window-oriented approach (plans for 1.0)

I have been thinking about the public API. While it mimics MechJeb internal API, I think it's not as intuitive because some things may have different names or be in different places than expected. I think this also makes it harder to maintain.

For 1.0, I would like to transform public API into window-oriented approach. That is, what you see in MechJeb GUIs in-game should directly tell you which API function you should call. For example, Ascent Guidance (currently referred to as AscentAutopilot in the API) should include StagingController and ThrustController functions. There may be duplicate functions in some places - I am not sure how to deal with it yet. I hope this gets us a more stable API with user-friendly property/function names less prone to internal MechJeb changes.

What do you all think about this change? How do you use the API now and what are its benefits/drawbacks in your opinion?

Mechjeb2 class changed

Describe the bug

Using 2.12.x and KRPC does not see mechjeb
Expected behavior

Working
Code snippet to reproduce it (ideally in Python)

<!-- Paste your code snippet here -->

Screenshots

Version details
kRPC.MechJeb: 0.61

Kerbal Space Program: 1.11.1
kRPC: 0.48
MechJeb2: 2.12.x

Exception raised in server when creating ascent autopilot object

KRPC.Mechjeb fails its own basic example. When following the example, an exception is generated at the server when accessing conn.mech_jeb.ascent_autopilot. It is possible to instantiate AscentGT, but doing so does not work for controlling the rocket (but does not trigger an exception either).

KRPC.Mechjeb used is latest as indicated in the documentation in this project, KRPC version is 0.4.8 and KSP version is 1.6.1.2401.
KRPC was tested and is running correctly.

Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import krpc
conn = krpc.connect(name="Launch into orbit")
sc = conn.space_center
mj = conn.mech_jeb
ascent = mj.ascent_autopilot
Traceback (most recent call last):
File "", line 1, in
File "", line 1, in
File "/home/ealvarez/.local/lib/python2.7/site-packages/krpc/client.py", line 163, in _invoke
raise self._build_error(response.results[0].error)
krpc.types.MJServiceException: Exception has been thrown by the target of an invocation.: Non-static field requires a target
Server stack trace:
at KRPC.MechJeb.ExtensionMethods.TypeExtensions.CreateInstance[AscentAutopilot] (System.Type type, System.Object[] args) [0x00000] in :0
at KRPC.MechJeb.MechJeb.GetComputerModule[AscentAutopilot] (System.Object[] modules, Int32 id, System.Object[] args) [0x00000] in :0
at KRPC.MechJeb.MechJeb.GetComputerModule[AscentAutopilot] (System.Object[] modules, Int32 id) [0x00000] in :0
at KRPC.MechJeb.MechJeb.get_AscentAutopilot () [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0

KRPC fails to load with KRPC.MechJeb because KRPC.Utils.Tuple no longer exists

Describe the bug
As of 0.5.2, the KRPC mod no longer includes KRPC.Utils.Tuple and uses System.Tuple instead: krpc/krpc@c3c3207

This addon still expects it to be there and as such the entire KRPC mod fails to load.

using Tuple3 = KRPC.Utils.Tuple<double, double, double>;

It might be worth noting that I attempted a fix by compiling the plugin with that line changed to using Tuple3 = System.Tuple<double, double, double>; and while that fixed that issue, that caused another issue with attempting to connect to KRPC via Python, specifically this assertion was failing upon successful connection.

Exception

[LOG 03:54:48.451] [AddonLoader]: Instantiating addon 'Addon' from assembly 'KRPC'
[EXC 03:54:49.091] TypeLoadException: Could not resolve type with token 0100002a (from typeref, class/assembly KRPC.Utils.Tuple`3, KRPC, Version=0.4.8.0, Culture=neutral, PublicKeyToken=null)
	System.Reflection.MonoMethodInfo.GetMethodInfo (System.IntPtr handle) (at <9577ac7a62ef43179789031239ba8798>:0)
	System.Reflection.MonoMethod.GetPseudoCustomAttributes () (at <9577ac7a62ef43179789031239ba8798>:0)
	System.MonoCustomAttrs.GetPseudoCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType) (at <9577ac7a62ef43179789031239ba8798>:0)
	System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) (at <9577ac7a62ef43179789031239ba8798>:0)
	System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) (at <9577ac7a62ef43179789031239ba8798>:0)
	System.Reflection.MonoMethod.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) (at <9577ac7a62ef43179789031239ba8798>:0)
	KRPC.Utils.Reflection.HasAttribute[T] (System.Reflection.ICustomAttributeProvider member) (at <bfca7052818745ee95133536e4da4f10>:0)
	KRPC.Service.TypeUtils.ValidateKRPCMethod (System.Type cls, System.Reflection.MethodBase method) (at <bfca7052818745ee95133536e4da4f10>:0)
	KRPC.Service.Scanner.ServiceSignature.AddClassMethod (System.String cls, System.Type classType, System.Reflection.MethodInfo method) (at <bfca7052818745ee95133536e4da4f10>:0)
	KRPC.Service.Scanner.Scanner.GetServices (System.Collections.Generic.IList`1[T] errors) (at <bfca7052818745ee95133536e4da4f10>:0)
	KRPC.Service.Services..ctor () (at <bfca7052818745ee95133536e4da4f10>:0)
	KRPC.Service.Services.Init () (at <bfca7052818745ee95133536e4da4f10>:0)
	KRPC.Core..ctor () (at <bfca7052818745ee95133536e4da4f10>:0)
	KRPC.Core.get_Instance () (at <bfca7052818745ee95133536e4da4f10>:0)
	KRPC.Addon.Init () (at <bfca7052818745ee95133536e4da4f10>:0)
	KRPC.Addon.Awake () (at <bfca7052818745ee95133536e4da4f10>:0)
	UnityEngine.DebugLogHandler:LogException(Exception, Object)
	ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
	UnityEngine.GameObject:AddComponent(Type)
	AddonLoader:StartAddon(LoadedAssembly, Type, KSPAddon, Startup)
	AddonLoader:StartAddons(Startup)
	AddonLoader:OnLevelLoaded(GameScenes)
	AddonLoader:OnSceneLoaded(Scene, LoadSceneMode)
	UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)

Version details
kRPC.MechJeb: 0.6.1

Kerbal Space Program: 1.12.5
kRPC: 0.5.2
MechJeb2: 2.14.3.0

AssertionError on Connection

Describe the bug

When using KRPC MechJeb, KRPC connection no longer works and throws an AssertionError. KRPC works as normal when KRPC MechJeb is uninstalled.

Expected behavior

No error.

Code snippet to reproduce it (ideally in Python)

import krpc

conn = krpc.connect(name='Test')

Screenshots

image

Version details
kRPC.MechJeb: 0.7.0

Kerbal Space Program: 1.12.5
kRPC: 0.5.2
MechJeb2: 2.14.3.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.