added debug class for time measurment
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "moveControl.h"
|
||||
#include "hardware/motorControl.h"
|
||||
#include "debugMqtt.h"
|
||||
#include "debugTimes.h"
|
||||
|
||||
enum ControMode {halt, joystick, trigger};
|
||||
class ManualControl {
|
||||
|
||||
Reference in New Issue
Block a user