Compare commits

..

No commits in common. "397e6fe33150ae069a86eb432bc9644491c4ec98" and "fe4af5238084d827ef6cdb7785b3419400c1951d" have entirely different histories.

4 changed files with 3 additions and 5 deletions

View File

@ -110,5 +110,5 @@ double ControlModule::ratio(double angle)
double progressPercent = progress/angularRange; double progressPercent = progress/angularRange;
double speed = minAngularSpeed + progressPercent*speedRange; double speed = minAngularSpeed + progressPercent*speedRange;
return std::fabs(speed); return abs(speed);
} }

View File

@ -2,7 +2,6 @@
#include <mutex> #include <mutex>
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include <cmath>
class ControlModule class ControlModule
{ {

View File

@ -16,7 +16,7 @@ void LFR_UART::openFile(const char *fileName) {
int LFR_UART::writeDataToFile(int8_t *buff, uint32_t bufferLength) { int LFR_UART::writeDataToFile(int8_t *buff, uint32_t bufferLength) {
//std::cout << "Sending uart: " << std::bitset<8>(buff[0]) << std::endl; //std::cout << "Sending uart: " << std::bitset<8>(buff[0]) << std::endl;
std::cout << "Sending Uart: " << std::bitset<8>(buff[0]) << ", " << std::bitset<8>(buff[1]) << ", " << std::bitset<8>(buff[2]) << ", " << std::bitset<8>(buff[3]) << " csum: " << std::bitset<8>(buff[4]) << std::endl; std::cout << "Sending uart: " << std::bitset<8>(buff[0]) << ", " << std::bitset<8>(buff[1]) << ", " << std::bitset<8>(buff[2]) << ", " << std::bitset<8>(buff[3]) << " csum: " << std::bitset<8>(buff[4]) << std::endl;
return write(this->fileDescriptor, buff, bufferLength); return write(this->fileDescriptor, buff, bufferLength);
} }
@ -66,7 +66,7 @@ double LFR_UART::byteToDouble(int8_t in){
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 < 250)
{ {
std::cout << "Too fast" << std::endl; std::cout << "Too fast" << std::endl;
return; return;

View File

@ -12,7 +12,6 @@
#include <exception> #include <exception>
#include <iostream> #include <iostream>
#include <chrono> #include <chrono>
#include <cmath>
#include <bitset> #include <bitset>