This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import krpc | |
import time | |
import numpy | |
import math | |
def main(): | |
conn = krpc.connect() | |
vessel = conn.space_center.active_vessel | |
# Point prograde, 0 degree roll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from ctypes import * | |
from nose.tools import * | |
from six import * | |
from unittest.mock import * | |
def ref_to_pointer(ref, ctype): | |
'''convert byref() object to real pointer''' | |
addr = int(re.search(r'(0x[\dabcdefABCDEF]+)',repr(ref)).group(1), 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import krpc | |
import math | |
import time | |
# http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/ | |
class PIDController(object): | |
""" A robust PID """ | |
def __init__(self, input, setpoint, kp, ki, kd, outmin = 0, outmax = 0): |