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

Added support for setpid

Example: setpid --pitch -p 5.0

Support is not fully fleshed out because the quad
doesn't support everything. Some backend changes
will be needed to support the rest of the PID constants that
are in the design document.

Right now, the P and the D of pitch, roll, and yaw are
supported. The Height/Lat/Long PID controllers are
not supported by the quad<->backend protocol,
nor are the I constants of anything. The quad<->backend
protocol is aware of a Throttle controller, which is
nowhere in the documentation.
parent e7a2ea0a
No related branches found
No related tags found
No related merge requests found
......@@ -2,29 +2,29 @@
#define __CLI_H
#include "cli_monitor.h"
// #include "cli_setpid.h"
#include "cli_setpid.h"
#include "cli_getpid.h"
// #include "cli_getimu.h"
enum CommandNameIds{
CMD_MONITOR,
CMD_SETPID,
CMD_GETPID,
CMD_SETPID,
CMD_GETIMU,
MAX_COMMANDS
};
typedef int (*cli_function_ptr)(struct backend_conn *, int, char **);
static cli_function_ptr cli_functions[2] = {
static cli_function_ptr cli_functions[] = {
&cli_monitor,
&cli_getpid
// &cli_setpid,
// &cli_getimu
&cli_getpid,
&cli_setpid
//&cli_getimu
};
static char* commandNames[MAX_COMMANDS] = {
"monitor",
"getPid",
"setPid",
"getpid",
"setpid",
"getImu"
};
......
#ifndef _CLI_SETPID_H
#define _CLI_SETPID_H
#include "frontend_setpid.h"
int cli_setpid(struct backend_conn * conn, int argc, char ** argv);
#endif
......@@ -27,7 +27,7 @@ int frontend_setpid(
break;
/* What is the "throttle" pid constant? */
default:
warnx("Unsupported PID variable");
warnx("Unsupported PID constant");
return -1;
}
......
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