Commit bcbae7dc authored by Simon Krissel's avatar Simon Krissel
Browse files

First tests with real hardware

parent 2a9d3b11
...@@ -119,9 +119,8 @@ int gazebo_send(int sockfd, int32_t msg) { ...@@ -119,9 +119,8 @@ int gazebo_send(int sockfd, int32_t msg) {
int32_t ret; int32_t ret;
// Sanity check // Sanity check
if (sockfd >= 0) { if (sockfd >= 0) {
uint8_t buf[sizeof(msg)+1]; uint8_t buf[sizeof(msg)];
encode_int32(buf, msg); encode_int32(buf, msg);
buf[sizeof(buf)-1] = '\0';
ret = send(sockfd, buf, sizeof(buf), MSG_NOSIGNAL); ret = send(sockfd, buf, sizeof(buf), MSG_NOSIGNAL);
if (ret <= 0) { if (ret <= 0) {
...@@ -221,7 +220,8 @@ static void* gazebo_thread (void *arg) { ...@@ -221,7 +220,8 @@ static void* gazebo_thread (void *arg) {
if(heartbeat_watchdog_triggered) { if(heartbeat_watchdog_triggered) {
message = 0; message = 0;
} else { } else {
message = mc_torque; message = htonl(mc_torque); // TODO protobuf?
printf("sending: %d\n", message);
} }
if(gazebo_send(client, message) != 0) { if(gazebo_send(client, message) != 0) {
close(client); close(client);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment