Skip to content
Snippets Groups Projects
Unverified Commit b462ade8 authored by Jake Drahos's avatar Jake Drahos
Browse files

Renamed a "pid" to a "controller"

Because that's what it is.
parent d6b16bfe
No related branches found
No related tags found
No related merge requests found
......@@ -34,33 +34,33 @@ int cli_getpid(struct backend_conn * conn, int argc, char **argv) {
int result;
if(getAll) {
pid_data.pid = ROLL;
pid_data.controller = ROLL;
if ((result = getValues(conn, &pid_data))) {
return result;
}
pid_data.pid = PITCH;
pid_data.controller = PITCH;
if ((result = getValues(conn, &pid_data))) {
return result;
}
pid_data.pid = YAW;
pid_data.controller = YAW;
if ((result = getValues(conn, &pid_data))) {
return result;
}
} else {
if(getPitch) {
pid_data.pid = PITCH;
pid_data.controller = PITCH;
if ((result = getValues(conn, &pid_data))) {
return result;
}
}
if(getRoll) {
pid_data.pid = ROLL;
pid_data.controller = ROLL;
if ((result = getValues(conn, &pid_data))) {
return result;
}
}
if(getYaw) {
pid_data.pid = YAW;
pid_data.controller = YAW;
if ((result = getValues(conn, &pid_data))) {
return result;
}
......@@ -77,7 +77,7 @@ int getValues(struct backend_conn * conn, struct frontend_pid_data * pid_data) {
return 0;
switch(pid_data->pid) {
switch(pid_data->controller) {
case PITCH :
printf("Pitch Constants: P = %f\tI = %f\tD = %f\n",
pid_data->p, pid_data->i, pid_data->d);
......@@ -94,4 +94,4 @@ int getValues(struct backend_conn * conn, struct frontend_pid_data * pid_data) {
break;
}
return 0;
}
\ No newline at end of file
}
......@@ -23,7 +23,7 @@ int frontend_getpid(
struct backend_conn * conn, struct frontend_pid_data * pid_data) {
char line[100] = "";
switch (pid_data->pid) {
switch (pid_data->controller) {
case PITCH :
strncpy(line, "getpitchp\ngetpitchd\n", 20);
break;
......@@ -43,4 +43,4 @@ int frontend_getpid(
}
return 0;
}
\ No newline at end of file
}
#ifndef PID_COMMON_H
#define PID_COMMON_H
enum frontend_pid {
enum pid_controller {
PITCH,
ROLL,
YAW,
......@@ -9,7 +9,7 @@ enum frontend_pid {
};
struct frontend_pid_data {
enum frontend_pid pid;
enum pid_controller controller;
float p;
float i;
......
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