Skip to content
Snippets Groups Projects
Commit 34d8c75d authored by dawehr's avatar dawehr
Browse files

Allowed values to be set before Gear switch. Re-enabled x/y controllers and...

Allowed values to be set before Gear switch. Re-enabled x/y controllers and made throttle manual for autonomous mode.
parent 35bff046
No related branches found
No related tags found
No related merge requests found
......@@ -184,13 +184,13 @@
parameter_struct->pid_controllers[PITCH_ID].current_point = sensor_struct->pitch_angle_filtered;
parameter_struct->pid_controllers[PITCH_ID].setpoint =
/*(user_defined_struct->flight_mode == AUTO_FLIGHT_MODE)?
(parameter_struct->pid_controllers[LOCAL_X_ID].pid_correction) + pitch_trim :*/ user_input_struct->pitch_angle_manual_setpoint;
(user_defined_struct->flight_mode == AUTO_FLIGHT_MODE)?
(parameter_struct->pid_controllers[LOCAL_X_ID].pid_correction) + pitch_trim : user_input_struct->pitch_angle_manual_setpoint;
parameter_struct->pid_controllers[ROLL_ID].current_point = sensor_struct->roll_angle_filtered;
parameter_struct->pid_controllers[ROLL_ID].setpoint =
/*(user_defined_struct->flight_mode == AUTO_FLIGHT_MODE)?
(parameter_struct->pid_controllers[LOCAL_Y_ID].pid_correction) + roll_trim :*/ user_input_struct->roll_angle_manual_setpoint;
(user_defined_struct->flight_mode == AUTO_FLIGHT_MODE)?
(parameter_struct->pid_controllers[LOCAL_Y_ID].pid_correction) + roll_trim : user_input_struct->roll_angle_manual_setpoint;
//logging and PID computation
......@@ -239,8 +239,8 @@
if(user_defined_struct->flight_mode == AUTO_FLIGHT_MODE)
{
//THROTTLE
raw_actuator_struct->controller_corrected_motor_commands[THROTTLE] =
((int)(parameter_struct->pid_controllers[ALT_ID].pid_correction)) + sensor_struct->trims.throttle;
//raw_actuator_struct->controller_corrected_motor_commands[THROTTLE] =
// ((int)(parameter_struct->pid_controllers[ALT_ID].pid_correction)) + sensor_struct->trims.throttle;
//ROLL
raw_actuator_struct->controller_corrected_motor_commands[ROLL] =
......
......@@ -24,13 +24,10 @@ int protection_loops(modular_structs_t *structs)
// wait until throttle is low and the gear switch is engaged (so you don't immediately break out of the main loop below)
// also wait for the flight mode to be set to manual
while(rc_commands[THROTTLE] > 125000 || read_kill(rc_commands[GEAR]) || !read_flap(rc_commands[FLAP]))
read_rec_all(rc_commands);
// wait until the ground station has connected to the quad and acknowledged that its ready to start
while (!structs->user_input_struct.receivedBeginUpdate) {
while(rc_commands[THROTTLE] > 125000 || read_kill(rc_commands[GEAR]) || !read_flap(rc_commands[FLAP]) ||
!structs->user_input_struct.receivedBeginUpdate) {
process_received(structs);
usleep(10000);
read_rec_all(rc_commands);
}
// let the pilot/observers know that the quad is now active
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment