Exemple #1
0
    def __init__(self, serialStream, PIDControllers, *thrusters):
        '''
        Initializes the thrusters and PID controllers. 
        
        **Parameters**: \n
        * **TCB1DataPacketsObject** - Object containing thruster feedback and control for 4 thrusters.
        * **TCB2DataPacketsObject** - Object containing thruster feedback and control for 4 thrusters.
        * **thrusters** -  BrushedThruster objects containing orientation and location data for the thrusters.
        
        **Returns**: \n
        * **No Return.**\n
        '''
        self.thrusters = thrusters
        self.previousPwm = [0] * len(
            self.thrusters
        )  #Allows me to keep track of previous PWM values so I don't spam TCB
        self.serialStream = serialStream

        advM = utilities.AdvancedMath()
        e1 = advM.e1  #Unit vector for x
        e2 = advM.e2  #Unit vector for y
        e3 = advM.e3  #Unit vector for z

        self.maxPwm = 80
        self.rotateFirstToggle = False

        #PID CONTROLLERS
        self.yawPIDControllerForwardMode = PIDControllers[0]
        self.yawPIDControllerBackwardsMode = PIDControllers[1]
        self.pitchPIDController = PIDControllers[2]
        self.rollPIDController = PIDControllers[3]
        self.depthPIDController = PIDControllers[4]
        self.xPIDController = PIDControllers[5]
        self.zPIDController = PIDControllers[6]
Exemple #2
0
import widget_config_logger
import time
import mission_planner_2
import platform
import subprocess
import sparton_ahrs
import externalLoggingSystem
import glob
import displayArduino
import pressureArduino
import motherBoard as motherboard
import killSwitch

useMaestro = True

advM = utilities.AdvancedMath()
e1 = advM.e1  # Unit vector for x
e2 = advM.e2  # Unit vector for y
e3 = advM.e3  # Unit vector for z

controllerTimer = utilities.Timer()
controllerYawButtonReleaseTimer = utilities.Timer()
controllerDepthButtonReleaseTimer = utilities.Timer()


class ExternalComm(QtCore.QObject):
    """
    Part of the GUI thread.  This class acts as an intermediary for the gui thread
    and the embedded thread.  Use this class to pull data from the external devices
    then store that data in the class instances.  The gui classes can then call those
    instances.