Jump to content

sylink

Members
  • Posts

    5
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Yes it is the pre-release, so if thats it, then it explains a lot I'm trying to do all the math manually now to do the burn without nodes anyway, which is apparently hard. Below is the trace for you. python FirstOrbit.py Calculating circular burn Traceback (most recent call last): File "FirstOrbit.py", line 26, in <module> node = vessel.control.add_node(vessel.orbit.time_to_apoapsis, prograde=delta_v) File "<string>", line 1, in <lambda> File "C:\Python35\lib\site-packages\krpc\client.py", line 88, in _invoke raise RPCError(response.error) krpc.error.RPCError: 'SpaceCenter.Control_AddNode' threw an exception. System.NullReferenceException: Object reference not set to an instance of an object at ManeuverNode.OnGizmoUpdated (Vector3d dV, Double ut) [0x00000] in <filename unknown>:0 at KRPC.SpaceCenter.Services.Node..ctor (.Vessel vessel, Double ut, Single prograde, Single normal, Single radial) [0x00000] in <filename unknown>:0 at KRPC.SpaceCenter.Services.Control.AddNode (Double ut, Single prograde, Single normal, Single radial) [0x00000] in <filename unknown>: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 <filename unknown>:0
  2. Maybe this is a bug? I was trying out the orbit tutorial and the node creation always fails, here is the tl dr to reproduce # Set up streams for telemetry import krpc, time, math conn = krpc.connect(name='Launch into orbit') vessel = conn.space_center.active_vessel ut = conn.add_stream(getattr, conn.space_center, 'ut') altitude = conn.add_stream(getattr, vessel.flight(), 'mean_altitude') apoapsis = conn.add_stream(getattr, vessel.orbit, 'apoapsis_altitude') periapsis = conn.add_stream(getattr, vessel.orbit, 'periapsis_altitude') eccentricity = conn.add_stream(getattr, vessel.orbit, 'eccentricity') print('Calculating circular burn') mu = vessel.orbit.body.gravitational_parameter r = vessel.orbit.apoapsis a1 = vessel.orbit.semi_major_axis a2 = r v1 = math.sqrt(mu*((2./r)-(1./a1))) v2 = math.sqrt(mu*((2./r)-(1./a2))) delta_v = v2 - v1 node = vessel.control.add_node(vessel.orbit.time_to_apoapsis, prograde=delta_v) The burn is actually at the end of the script but I shortened it to reproduce the error, it fails with Calculating circular burn Traceback (most recent call last): File "FirstOrbit.py", line 25, in <module> node = vessel.control.add_node(vessel.orbit.time_to_apoapsis, prograde=delta_v) File "<string>", line 1, in <lambda> File "C:\Python35\lib\site-packages\krpc\client.py", line 88, in _invoke raise RPCError(response.error) krpc.error.RPCError: Object reference not set to an instance of an object I can't tell if its a krpc problem or a me problem.
  3. Ok, I see how that works now. But for me if I use that code on a rocket it launches etc then at about 1000m it always wobbles and tips over. Is the auto pilot particularly slow/overreactive? If I use the launch to orbit example and craft file it works perfectly but I think this is because it fits the rocket very well.
  4. If I run this it works: But if I cut the script off and take out the final loop and leave the last command to set SAS to true it turns it off and stays set to false. It seems it has to be set in every loop or something? Setting the mode works but the status True/False seems to get turned off by something.
  5. I am familiar with Python but have no idea how to use your mechjeb project, can you point me to some direction how to add it to the existing lib with Python 2.7? Also I've been trying out krpc but cannot get the sas to work correctly. It never triggers and every rocket seems to fall over and never turn on the sas. Is there an example of this somehow? Setting to true does nothing as far as I can tell.
×
×
  • Create New...