diff --git a/crazyflie_groundstation/src/ccrazyflie/CCrazyflie.cpp b/crazyflie_groundstation/src/ccrazyflie/CCrazyflie.cpp index 5486bc4dbdb7225c9ff5b1a42f25f64d671ffc1a..c03a37a5a300c1ffb35e5b9d3cbfd8ac12e26c55 100644 --- a/crazyflie_groundstation/src/ccrazyflie/CCrazyflie.cpp +++ b/crazyflie_groundstation/src/ccrazyflie/CCrazyflie.cpp @@ -32,8 +32,6 @@ #include <pthread.h> #include "CCrazyflie.h" #include "CCrazyRadio.h" - -int everyX = 0; CCrazyflie::CCrazyflie(CCrazyRadio *crRadio, int nRadioChannel, XferRate dataRate, int quadNum, double startTime) { m_quadNum = quadNum; @@ -351,13 +349,7 @@ bool CCrazyflie::cycle() { this->m_sendPosition = false; } else { // Send a dummy packet for keepalive otherwise - //TODO this is a hacky fix to limit amount of data sent, should use a timer instead - if(everyX >= 100){ - m_crRadio->sendDummyPacket(m_nRadioChannel, this); - everyX = 0; - }else{ - everyX++; - } + m_crRadio->sendDummyPacket(m_nRadioChannel, this); } diff --git a/crazyflie_groundstation/src/ccrazyradio/CCrazyRadio_loopFuncs.cpp b/crazyflie_groundstation/src/ccrazyradio/CCrazyRadio_loopFuncs.cpp index 0b6830a2cdd62a57a0cf27c9cfdb7648359c84e4..bc1dbc1d6d3748483dd1af5bccead90fc1607cc5 100644 --- a/crazyflie_groundstation/src/ccrazyradio/CCrazyRadio_loopFuncs.cpp +++ b/crazyflie_groundstation/src/ccrazyradio/CCrazyRadio_loopFuncs.cpp @@ -23,7 +23,7 @@ void CCrazyRadio::mainLoop() { (*it)->writeLogData(); } - usleep(200); + usleep(1000); // Check if the thread has been told to terminate if (this->m_exitThread) { diff --git a/crazyflie_groundstation/src/userInput.cpp b/crazyflie_groundstation/src/userInput.cpp index bddd7fe761174be08176d868823d065888140cb1..84d95f710196a452eeb25756fd69ae352ff6f72b 100644 --- a/crazyflie_groundstation/src/userInput.cpp +++ b/crazyflie_groundstation/src/userInput.cpp @@ -43,7 +43,7 @@ int max_fd = 0; #define MAX_CLIENTS 32 #define CLIENT_BUFFER_SIZE 64 -#define CLIENT_MAX_PENDING_RESPONSES 15 +#define CLIENT_MAX_PENDING_RESPONSES 64 static struct command* client_buffers[MAX_CLIENTS][CLIENT_BUFFER_SIZE]; static int client_fds[MAX_CLIENTS]; static int client_pending_responses[MAX_CLIENTS][CLIENT_MAX_PENDING_RESPONSES];