added debug class for time measurment

This commit is contained in:
2021-11-25 15:01:20 +01:00
parent c741546ba1
commit a9f34b0054
7 changed files with 67 additions and 42 deletions
+12 -2
View File
@@ -15,6 +15,8 @@ void ManualControl::init(MoveControl *moveControl, MotorControl *motorControlLef
}
void ManualControl::runManualControl() {
DebugTimes runManualDebuginFunction;
//Cancel if delay is not reached
if (millis() - this->last_millis < RUN_MANUALCONTROL_DELAY) {
return;
@@ -27,6 +29,8 @@ void ManualControl::runManualControl() {
}
this->last_millis = millis();
runManualDebuginFunction.stop("Ober teil von runManualControl", 100);
//Change controlMode
if (this->controlMode == ControMode::halt && Ps3.data.button.l3) {
this->reset();
@@ -51,9 +55,15 @@ void ManualControl::runManualControl() {
this->moveControl->setDrivingStatus(DrivingStatus::stop);
break;
case ControMode::joystick:
case ControMode::joystick: {
DebugTimes driveWithJoyDebug;
this->driveWithControllerJoystick();
driveWithJoyDebug.stop("driveWithControllerJoystick", 100);
DebugTimes moveControllDebug;
this->moveControl->runMoveControl();
moveControllDebug.stop("moveControl", 100);
}
break;
case ControMode::trigger:
@@ -78,7 +88,7 @@ void ManualControl::driveWithControllerJoystick() {
// debug->sendMsg(Loglevel::debug, str); // Kommt 1 raus bei vollausschlag
value_per_step = MANUALCONTROL_MAX_ROTATION * 2 / 256;
this->moveControl->setRotationspeed(x * value_per_step);
this->moveControl->setRotationspeed(-x * value_per_step);
}
void ManualControl::changeDriveMode(ControMode drive_mode) {
+1
View File
@@ -6,6 +6,7 @@
#include "moveControl.h"
#include "hardware/motorControl.h"
#include "debugMqtt.h"
#include "debugTimes.h"
enum ControMode {halt, joystick, trigger};
class ManualControl {