Passby/Direct Control

Intro

Since certain stages of the flight sequence require direct control of certain control surfaces and inputs, there needs to be a way for the state machine to pass by the PIDs of coordinated turns and attitude manager. For example, in the takeoff sequence, maximum throttle percentage is needed during the takeoff roll.

 

Solution

To solve this problem, a pass-by control structure was created in pathDatatypes, which contains each of the control percentages, along with booleans to determine if they should be used. An instance of this structure will be used in path manager and passed onto attitude manager, where the booleans will determine if the respective control will pass by the PID controls of attitude manager.

 

Usage

To use this structure, simply set the desired control percentage and the corresponding boolean to true. This information is then passed onto attitude manager and to safety.

 

Additional Info

Since the instance of this structure is held within one of the states of the path manager state machine, the variables within need to be reset when direct control is not needed. To do this, a state named resetVariables is inserted between sensorFusion and the control stages. This state will take care of resetting all booleans to false and the enum decision that determines what stage the state machine should switch to.