Moving the mission and mission control in their own file. Adapting the rescue mission for the new shuttle
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user