remove all PS3 things and begin with ControllPad

This commit is contained in:
2023-03-30 22:20:28 +02:00
parent e4cdc5f98d
commit 33fe6916ed
16 changed files with 182 additions and 150 deletions
@@ -10,9 +10,9 @@
*/
#include "manualControl.h"
ManualControl::ManualControl(MoveControl *moveControl, Ps3Controller *gamepad) {
ManualControl::ManualControl(MoveControl *moveControl, const ControllPadInput *input) {
this->moveControl = moveControl;
this->gamepad = gamepad;
this->input = input;
this->moveControl->setDrivingStatus(DrivingStatus::drive);
}
@@ -31,8 +31,8 @@ void ManualControl::loop() {
}
void ManualControl::runManualControl() {
int8_t x = this->gamepad->data.analog.stick.lx;
int8_t y = this->gamepad->data.analog.stick.ly;
int8_t x = this->input->x;
int8_t y = this->input->y;
double value_per_step = this->max_speed * 2 / 256;
this->moveControl->setSpeed((y * -1) * value_per_step);
@@ -13,6 +13,7 @@
#include "moveControl.h"
#include "driveModi/driveModi.h"
#include "controllPadInput.h"
/**
* @brief Drive the Rover with a Joystick
@@ -24,7 +25,7 @@
*/
class ManualControl : public DriveModi {
public:
ManualControl(MoveControl *moveControl, Ps3Controller *gamepad);
ManualControl(MoveControl *moveControl, const ControllPadInput *input);
/**
* @brief Destroy the Manual Control object
@@ -71,7 +72,7 @@ class ManualControl : public DriveModi {
protected:
MoveControl *moveControl;
Ps3Controller *gamepad;
const ControllPadInput* input;
private:
uint32_t lastMillis = 0;