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