new ntrip client
This commit is contained in:
@@ -81,6 +81,10 @@ void MoveControl::runMoveControl() {
|
||||
}
|
||||
|
||||
void MoveControl::setDrivingStatus(DrivingStatus status) {
|
||||
this->setSpeed(0);
|
||||
this->setRotationSpeed(0);
|
||||
this->setRawPowerLeft(0);
|
||||
this->setRawPowerRight(0);
|
||||
this->driving_status = status;
|
||||
// switch (this->driving_status) {
|
||||
// case DrivingStatus::stop :
|
||||
@@ -111,6 +115,16 @@ void MoveControl::setRotationSpeed(double speed) {
|
||||
this->rotation_speed = speed;
|
||||
}
|
||||
|
||||
void MoveControl::setRawPowerLeft(int16_t power) {
|
||||
if (power <= 100 && power >= 100)
|
||||
this->rawPowerLeft = power;
|
||||
}
|
||||
|
||||
void MoveControl::setRawPowerRight(int16_t power) {
|
||||
if (power <= 100 && power >= 100)
|
||||
this->rawPowerRight = power;
|
||||
}
|
||||
|
||||
void MoveControl::setPidTunings(uint8_t side, double p, double i, double d) {
|
||||
PID* selectedPID = nullptr;
|
||||
if (side == 0)
|
||||
@@ -165,6 +179,11 @@ void MoveControl::regulateMotors() {
|
||||
this->right_motor->setTargetPower( (int8_t) this->right_pid_out);
|
||||
break;
|
||||
|
||||
case DrivingStatus::raw :
|
||||
this->left_motor->setTargetPower(this->rawPowerLeft);
|
||||
this->right_motor->setTargetPower(this->rawPowerRight);
|
||||
break;
|
||||
|
||||
default:
|
||||
Serial.println("Wrong drivingState in MoveControl::regulateMotors");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user