From c34344520f3f695438eaa3e41787c179225e5e3e Mon Sep 17 00:00:00 2001 From: Jake Drahos <j@kedrahos.com> Date: Fri, 2 Dec 2016 16:56:20 -0600 Subject: [PATCH] Support for all coefficients in frontend --- groundStation/src/cli/cli_setpid.c | 12 ++++++------ groundStation/src/frontend/frontend_setpid.c | 19 ++++++++++++++++++- groundStation/src/frontend/pid_common.h | 6 +++--- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/groundStation/src/cli/cli_setpid.c b/groundStation/src/cli/cli_setpid.c index b0ed03cf1..2fdc16fdb 100644 --- a/groundStation/src/cli/cli_setpid.c +++ b/groundStation/src/cli/cli_setpid.c @@ -63,19 +63,19 @@ int cli_setpid(struct backend_conn * conn, int argc, char **argv) { } else if (setPitch) { pid_data.controller = PID_PITCH; } else if (setRollV) { - pid_data.controller = PID_ROLL_VELOCITY; + pid_data.controller = PID_ROLL_RATE; } else if (setPitchV) { - pid_data.controller = PID_PITCH_VELOCITY; + pid_data.controller = PID_PITCH_RATE; } else if (setYawV) { - pid_data.controller = PID_YAW_VELOCITY; + pid_data.controller = PID_YAW_RATE; } else if (setHeight) { pid_data.controller = PID_HEIGHT; } else if (setLong) { - pid_data.controller = PID_LONG; - } else if (setLat) { pid_data.controller = PID_LAT; + } else if (setLat) { + pid_data.controller = PID_LONG; } frontend_setpid(conn, &pid_data, mask); return 0; -} \ No newline at end of file +} diff --git a/groundStation/src/frontend/frontend_setpid.c b/groundStation/src/frontend/frontend_setpid.c index 0a25d8e3c..58bf4109c 100644 --- a/groundStation/src/frontend/frontend_setpid.c +++ b/groundStation/src/frontend/frontend_setpid.c @@ -25,7 +25,24 @@ int frontend_setpid( case PID_YAW: controller = "yaw"; break; - /* What is the "throttle" pid constant? */ + case PID_PITCH_RATE: + controller = "pitchrate"; + break; + case PID_ROLL_RATE: + controller = "rollrate"; + break; + case PID_YAW_RATE: + controller = "yawrate"; + break; + case PID_HEIGHT: + controller = "height"; + break; + case PID_LAT: + controller = "lat"; + break; + case PID_LONG: + controller = "long"; + break; default: warnx("Unsupported PID constant"); return -1; diff --git a/groundStation/src/frontend/pid_common.h b/groundStation/src/frontend/pid_common.h index efa24df4a..c40c4fb42 100644 --- a/groundStation/src/frontend/pid_common.h +++ b/groundStation/src/frontend/pid_common.h @@ -5,9 +5,9 @@ enum pid_controller { PID_PITCH, PID_ROLL, PID_YAW, - PID_PITCH_VELOCITY, - PID_ROLL_VELOCITY, - PID_YAW_VELOCITY, + PID_PITCH_RATE, + PID_ROLL_RATE, + PID_YAW_RATE, PID_HEIGHT, /* Z */ PID_LAT, /* X */ PID_LONG, /* Y */ -- GitLab