diff --git a/groundStation/src/cli/cli_getpid.c b/groundStation/src/cli/cli_getpid.c index 4eead75438f803ecb4697df862506a768c07f1fd..bcf135870f4653ea0fecaf4a2c51b71772f93694 100644 --- a/groundStation/src/cli/cli_getpid.c +++ b/groundStation/src/cli/cli_getpid.c @@ -34,33 +34,33 @@ int cli_getpid(struct backend_conn * conn, int argc, char **argv) { int result; if(getAll) { - pid_data.controller = ROLL; + pid_data.controller = PID_ROLL; if ((result = getValues(conn, &pid_data))) { return result; } - pid_data.controller = PITCH; + pid_data.controller = PID_PITCH; if ((result = getValues(conn, &pid_data))) { return result; } - pid_data.controller = YAW; + pid_data.controller = PID_YAW; if ((result = getValues(conn, &pid_data))) { return result; } } else { if(getPitch) { - pid_data.controller = PITCH; + pid_data.controller = PID_PITCH; if ((result = getValues(conn, &pid_data))) { return result; } } if(getRoll) { - pid_data.controller = ROLL; + pid_data.controller = PID_ROLL; if ((result = getValues(conn, &pid_data))) { return result; } } if(getYaw) { - pid_data.controller = YAW; + pid_data.controller = PID_YAW; if ((result = getValues(conn, &pid_data))) { return result; } @@ -78,15 +78,15 @@ int getValues(struct backend_conn * conn, struct frontend_pid_data * pid_data) { return 0; switch(pid_data->controller) { - case PITCH : + case PID_PITCH : printf("Pitch Constants: P = %f\tI = %f\tD = %f\n", pid_data->p, pid_data->i, pid_data->d); break; - case ROLL : + case PID_ROLL : printf("Roll Constants: P = %f\tI = %f\tD = %f\n", pid_data->p, pid_data->i, pid_data->d); break; - case YAW : + case PID_YAW : printf("Yaw Constants: P = %f\tI = %f\tD = %f\n", pid_data->p, pid_data->i, pid_data->d); break; diff --git a/groundStation/src/frontend/frontend_getpid.c b/groundStation/src/frontend/frontend_getpid.c index bd6b387cc9e64d60bd0e8db09d3bc0a850afadb0..fbde309c3169e4d2429f5c3cd06c7674709491a8 100644 --- a/groundStation/src/frontend/frontend_getpid.c +++ b/groundStation/src/frontend/frontend_getpid.c @@ -10,7 +10,7 @@ * Example: * * struct frontend_pid_data pid_data; - * pid_data.pid = PITCH; + * pid_data.pid = PID_PITCH; * if (frontend_getpid(conn, &pid_data)) { * error * } else { @@ -24,13 +24,13 @@ int frontend_getpid( char line[100] = ""; switch (pid_data->controller) { - case PITCH : + case PID_PITCH : strncpy(line, "getpitchp\ngetpitchd\n", 20); break; - case ROLL : + case PID_ROLL : strncpy(line, "getrollp\ngetrolld\n", 18); break; - case YAW : + case PID_YAW : strncpy(line, "getyawp\ngetyawd\n", 17); break; default : diff --git a/groundStation/src/frontend/pid_common.h b/groundStation/src/frontend/pid_common.h index e4f65625c13c49f6d785cc06fdb6e7c6187c1ab5..efa24df4a2b018b1a3b353a109cd29a044647a13 100644 --- a/groundStation/src/frontend/pid_common.h +++ b/groundStation/src/frontend/pid_common.h @@ -2,10 +2,16 @@ #define PID_COMMON_H enum pid_controller { - PITCH, - ROLL, - YAW, - NUM_PIDS + PID_PITCH, + PID_ROLL, + PID_YAW, + PID_PITCH_VELOCITY, + PID_ROLL_VELOCITY, + PID_YAW_VELOCITY, + PID_HEIGHT, /* Z */ + PID_LAT, /* X */ + PID_LONG, /* Y */ + PID_NUM_PIDS }; struct frontend_pid_data {