Skip to content

Commit

Permalink
add delay before sending the message
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaledwahba1994 committed Feb 14, 2024
1 parent f60cbe3 commit 6afee2c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Crazyflie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <cmath>
#include <inttypes.h>
#include <regex>

#include <iostream>
#define FIRMWARE_BUGGY

Logger EmptyLogger;
Expand Down Expand Up @@ -1351,10 +1351,12 @@ void CrazyflieBroadcaster::sendDesCableStatesSetpoint(
crtpDesCableStatesSetpointRequest req;
size_t j = 0;
for (const auto entry : data) {
// std::cout << "s " << (int)entry.id << std::endl;
req.add(entry.id, entry.mu_ref_x, entry.mu_ref_y, entry.mu_ref_z, entry.qid_ref_x, entry.qid_ref_y, entry.qid_ref_z);
++j;
if (j==2) {
m_connection.send(req);
std::this_thread::sleep_for(std::chrono::milliseconds(1));
req.clear();
j = 0;
}
Expand Down

0 comments on commit 6afee2c

Please sign in to comment.