Moving the mission and mission control in their own file. Adapting the rescue mission for the new shuttle

This commit is contained in:
2023-08-31 17:31:43 +02:00
parent c403da605b
commit 1499e737c1
8 changed files with 450 additions and 246 deletions

View File

@@ -3,7 +3,7 @@ from krpc.services.spacecenter import SASMode
import numpy as np
from time import time, sleep
from .utils import magnitude, unitary, kill_relative_velocity, correct_course
from .utils import magnitude, unitary, kill_relative_velocity, correct_course, get_safety_radius, point_toward_direction
from . import Maneuver
@@ -52,26 +52,6 @@ class ApproachManeuver(Maneuver):
return True
def get_safety_radius(vessel):
bbox = vessel.bounding_box(vessel.reference_frame)
return max(magnitude(bbox[0]), magnitude(bbox[1]))
def point_toward_direction(vessel, direction, reference_frame):
ap = vessel.auto_pilot
ap.reference_frame = reference_frame
ap.target_direction = unitary(direction)
ap.target_roll = 0
ap.sas = False
ap.engage()
sleep(1)
ap.wait()
ap.disengage()
ap.sas_mode = SASMode.stability_assist
ap.sas = True
THROTTLE = .1
VELOCITY_TOLERANCE = .1