a lot of bullshit

This commit is contained in:
2021-12-14 19:22:06 +01:00
parent 1fc5a75f33
commit cd29191bb4
27 changed files with 703 additions and 551 deletions
@@ -0,0 +1,42 @@
/**
* @file manualControl.cpp
* @author Alexander Klein (alex@kleiax.de)
* @brief Implementation of the class manualControl.h
* @version 0.1
* @date 2021-12-13
*
* @copyright Copyright (c) 2021
*
*/
#include "manualControl.h"
ManualControl::ManualControl() { }
ManualControl::~ManualControl() {
this->moveControl->setSpeed(0);
this->moveControl->setRotationspeed(0);
this->moveControl->setDrivingStatus(DrivingStatus::stop);
}
void ManualControl::init(MoveControl *moveControl) {
this->moveControl = moveControl;
this->moveControl->setDrivingStatus(DrivingStatus::drive);
}
void ManualControl::loop() {
static uint32_t last_millis = 0;
if (millis() - last_millis < delay) {
return;
}
}
void ManualControl::runManualControl() {
int8_t x = Ps3.data.analog.stick.lx;
int8_t y = Ps3.data.analog.stick.ly;
double value_per_step = this->max_speed * 2 / 256;
this->moveControl->setSpeed((y * -1) * value_per_step);
value_per_step = this->max_rotation * 2 / 256;
this->moveControl->setRotationspeed(-x * value_per_step);
}