Rescue mission almost done docking part behaves weirdly)

This commit is contained in:
2023-09-05 20:30:18 +02:00
parent 1499e737c1
commit 84b9d10c85
11 changed files with 377 additions and 231 deletions

View File

@@ -1,14 +1,44 @@
from time import sleep
import numpy as np
from simple_pid import PID
import numpy as np
import krpc
from maneuvers.utils import get_required_rcs_thrust
conn = krpc.connect()
sc = conn.space_center
vessel = sc.active_vessel
target = sc.target_vessel
target.velocity(vessel.reference_frame)
conn.drawing.add_direction(target.velocity(vessel.reference_frame), vessel.reference_frame)
get_required_rcs_thrust(vessel, target.velocity(vessel.reference_frame))
from maneuvers.utils import magnitude
kill_relative_velocity_rcs(vessel, target)
mj = conn.mech_jeb
sa = mj.smart_ass
reference_frame = sc.ReferenceFrame.create_relative(target.reference_frame, rotation=(1., 0., 0., 0.))
conn.drawing.add_direction((0, 1, 0), reference_frame)
from time import sleep
import krpc
from maneuvers.utils import magnitude
conn = krpc.connect()
sc = conn.space_center
vessel = sc.active_vessel
target = sc.target_vessel
mj = conn.mech_jeb
sa = mj.smart_ass
sa.autopilot_mode = conn.mech_jeb.SmartASSAutopilotMode.target_plus
sa.update(False)
sa.autopilot_mode = conn.mech_jeb.SmartASSAutopilotMode.target_minus
sa.update(False)
while True:
print(magnitude(vessel.angular_velocity(target.reference_frame)))
sleep(.1)
from mission_control import ShuttleKerbin
s = ShuttleKerbin("KKS Gagarin")
s.recover_probe()