|
|
|
|
|
|
|
|
void LFR_UART::sendTelegram(double wheel1, double wheel2, double wheel3, double wheel4){ |
|
|
void LFR_UART::sendTelegram(double wheel1, double wheel2, double wheel3, double wheel4){ |
|
|
std::chrono::milliseconds now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()); |
|
|
std::chrono::milliseconds now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()); |
|
|
unsigned int deltaMs = static_cast<unsigned int>((now-last).count()); |
|
|
unsigned int deltaMs = static_cast<unsigned int>((now-last).count()); |
|
|
if (deltaMs < 250 && (std::fabs(wheel1)+std::fabs(wheel2)+std::fabs(wheel3)+std::fabs(wheel4)) > 0.0005) |
|
|
|
|
|
|
|
|
if (deltaMs < 50 && (std::fabs(wheel1)+std::fabs(wheel2)+std::fabs(wheel3)+std::fabs(wheel4)) > 0.0005) |
|
|
{ |
|
|
{ |
|
|
std::cout << "Too fast" << std::endl; |
|
|
std::cout << "Too fast" << std::endl; |
|
|
return; |
|
|
return; |