Skip to content
Snippets Groups Projects
Commit a4474dc7 authored by burneykb's avatar burneykb
Browse files

Expanded setpid to use all controller types

parent 4e7b209e
No related branches found
No related tags found
No related merge requests found
...@@ -671,12 +671,16 @@ static void client_recv(int fd) { ...@@ -671,12 +671,16 @@ static void client_recv(int fd) {
write(fd, buffer, strlen(buffer)); write(fd, buffer, strlen(buffer));
} }
} }
} else { } else {
if(clientAddPendResponses(fd, packet) == -1) { if(clientAddPendResponses(fd, packet) == -1) {
warnx("Ran out of room! Consider increasing CLIENT_MAX_PENDING_RESPONSES!\n"); warnx("Ran out of room! Consider increasing CLIENT_MAX_PENDING_RESPONSES!\n");
} else { } else {
int datalen = (packet[6] << 8) | (packet[5]); int datalen = (packet[6] << 8) | (packet[5]);
printf("sending %lf '", getFloat(packet, 7));
for(int i = 0; i < datalen + 8; ++i) {
printf(" 0x%x", (signed) packet[i]);
}
printf("'\n");
writeQuad((char *) packet, datalen +8); writeQuad((char *) packet, datalen +8);
} }
} }
......
...@@ -440,7 +440,6 @@ struct MessageType MessageTypes[MAX_TYPE] = ...@@ -440,7 +440,6 @@ struct MessageType MessageTypes[MAX_TYPE] =
// Function pointer // Function pointer
&resprollangle &resprollangle
}, },
// resp yaw setpoint subtype // resp yaw setpoint subtype
{ {
// ID // ID
......
...@@ -18,10 +18,10 @@ int cli_setpid(struct backend_conn * conn, int argc, char **argv) { ...@@ -18,10 +18,10 @@ int cli_setpid(struct backend_conn * conn, int argc, char **argv) {
{"roll", no_argument, &setRoll, 1}, {"roll", no_argument, &setRoll, 1},
{"pitch", no_argument, &setPitch, 1}, {"pitch", no_argument, &setPitch, 1},
{"yaw", no_argument, &setYaw, 1}, {"yaw", no_argument, &setYaw, 1},
{"rollv", no_argument, &setYawV, 1}, {"rollv", no_argument, &setRollV, 1},
{"pitchv", no_argument, &setYawV, 1}, {"pitchv", no_argument, &setPitchV, 1},
{"yawv", no_argument, &setYawV, 1}, {"yawv", no_argument, &setYawV, 1},
{"height", no_argument, &setHeight, 1}, {"height", no_argument, &setHeight, 1},
{"lat", no_argument, &setLat, 1}, {"lat", no_argument, &setLat, 1},
{"long", no_argument, &setLong, 1}, {"long", no_argument, &setLong, 1},
{0, 0, 0, 0} {0, 0, 0, 0}
...@@ -62,9 +62,20 @@ int cli_setpid(struct backend_conn * conn, int argc, char **argv) { ...@@ -62,9 +62,20 @@ int cli_setpid(struct backend_conn * conn, int argc, char **argv) {
pid_data.controller = PID_YAW; pid_data.controller = PID_YAW;
} else if (setPitch) { } else if (setPitch) {
pid_data.controller = PID_PITCH; pid_data.controller = PID_PITCH;
} else if (setRollV) {
pid_data.controller = PID_ROLL_VELOCITY;
} else if (setPitchV) {
pid_data.controller = PID_PITCH_VELOCITY;
} else if (setYawV) {
pid_data.controller = PID_YAW_VELOCITY;
} else if (setHeight) {
pid_data.controller = PID_HEIGHT;
} else if (setLong) {
pid_data.controller = PID_LONG;
} else if (setLat) {
pid_data.controller = PID_LAT;
} }
frontend_setpid(conn, &pid_data, mask); frontend_setpid(conn, &pid_data, mask);
return 0; return 0;
} }
\ No newline at end of file
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