fix gamepad read and access
This commit is contained in:
@@ -45,7 +45,7 @@ void Autopilot::runAutopilot() {
|
||||
this->selfDrivingAvailable = true;
|
||||
|
||||
if (!this->selfDriving && this->selfDrivingAvailable)
|
||||
this->setSelfDriving(Ps3.data.button.triangle);
|
||||
this->setSelfDriving(this->gamepad->data.button.triangle);
|
||||
|
||||
if (this->routeInfo.currentPoint == this->routeInfo.totalPoints) {
|
||||
this->navigationEnded = true;
|
||||
|
||||
@@ -31,8 +31,8 @@ void ManualControl::loop() {
|
||||
}
|
||||
|
||||
void ManualControl::runManualControl() {
|
||||
int8_t x = Ps3.data.analog.stick.lx;
|
||||
int8_t y = Ps3.data.analog.stick.ly;
|
||||
int8_t x = this->gamepad->data.analog.stick.lx;
|
||||
int8_t y = this->gamepad->data.analog.stick.ly;
|
||||
|
||||
double value_per_step = this->max_speed * 2 / 256;
|
||||
this->moveControl->setSpeed((y * -1) * value_per_step);
|
||||
|
||||
Reference in New Issue
Block a user