Advertisement
Guest User

Trial Two

a guest
Mar 2nd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.11 KB | None | 0 0
  1. print('Program Started');
  2.  
  3. import math
  4. import krpc
  5. import time
  6.  
  7. #SETUP
  8. conn = krpc.connect(name='Duna Launcher')
  9. ship = conn.space_center.active_vessel
  10.  
  11. gravityTurn = 30000
  12. target_apoapsis = 100000
  13. target_periapsis = 100000
  14.  
  15. ut = conn.add_stream(getattr, conn.space_center, 'ut')
  16.  
  17. ######## DOES NOT WANT TO ROTATE TO PROGRADE
  18. ship.control.rcs = True
  19. for rcs in ship.parts.rcs:
  20.     rcs.enabled = True
  21.    
  22. print('RCS ACTIVE: ' + str(rcs.active))
  23. print('RCS ENABLED: ' + str(rcs.enabled))
  24. #ship.auto_pilot.target_pitch_and_heading(1,90)
  25.  
  26. ## ALIGN ROCKET WITH PITCH & HEADING
  27. print('TESTING ROTATION')
  28. ship.control.sas = True
  29. if ship.auto_pilot.sas_mode == True:
  30.     pass
  31. else:
  32.     ship.auto_pilot.sas = True
  33.    
  34. print('SAS ENABLED: ' + str(ship.control.sas))
  35.  
  36. ship.auto_pilot.target_pitch = (1)
  37. ship.auto_pilot.target_heading = (90)
  38. #ship.auto_pilot.sas_mode.maneuver
  39. print('Orienting Ship with Maneuver Node')
  40. print('OVERALL ERROR: ' + str(ship.auto_pilot.error))
  41. print('PITCH ERROR: ' + str(ship.auto_pilot.pitch_error))
  42. print('HEADING ERROR: ' + str(ship.auto_pilot.heading_error))
  43. ship.auto_pilot.wait()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement