From a8948651a8a932df98b1827cb4111e2ca940248e Mon Sep 17 00:00:00 2001 From: Jisung Kang Date: Wed, 26 Apr 2023 00:40:21 -0700 Subject: [PATCH] [LOWCAR] removed device_enable from PDB.h and set pid_enabled to false for KoalaBear.cpp --- lowcar/devices/KoalaBear/KoalaBear.cpp | 10 +++++----- lowcar/devices/PDB/PDB.h | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lowcar/devices/KoalaBear/KoalaBear.cpp b/lowcar/devices/KoalaBear/KoalaBear.cpp index 513723bd..1b2f8a9e 100644 --- a/lowcar/devices/KoalaBear/KoalaBear.cpp +++ b/lowcar/devices/KoalaBear/KoalaBear.cpp @@ -116,7 +116,7 @@ KoalaBear::KoalaBear() : Device(DeviceType::KOALA_BEAR, 13) { // initialize PID controllers this->pid_a = new PID(); this->pid_b = new PID(); - this->pid_enabled_a = this->pid_enabled_b = TRUE; // by default, PID control is enabled + this->pid_enabled_a = this->pid_enabled_b = FALSE; // by default, PID control is enabled this->pid_a->set_coefficients(KP_DEFAULT, KI_DEFAULT, KD_DEFAULT); this->pid_b->set_coefficients(KP_DEFAULT, KI_DEFAULT, KD_DEFAULT); @@ -269,8 +269,8 @@ void KoalaBear::device_enable() { pinMode(BENC1, INPUT); pinMode(BENC2, INPUT); - this->pid_enabled_a = TRUE; - this->pid_enabled_b = TRUE; + this->pid_enabled_a = FALSE; + this->pid_enabled_b = FALSE; this->led->setup_LEDs(); @@ -288,8 +288,8 @@ void KoalaBear::device_reset() { this->velocity_b = 0.0; this->curr_velocity_a = 0.0; this->curr_velocity_b = 0.0; - this->pid_enabled_a = TRUE; - this->pid_enabled_b = TRUE; + this->pid_enabled_a = FALSE; + this->pid_enabled_b = FALSE; this->online = FALSE; } diff --git a/lowcar/devices/PDB/PDB.h b/lowcar/devices/PDB/PDB.h index 76dce89a..c76a036a 100644 --- a/lowcar/devices/PDB/PDB.h +++ b/lowcar/devices/PDB/PDB.h @@ -16,7 +16,6 @@ class PDB : public Device { // overriden functions from Device class; see descriptions in Device.h virtual size_t device_read(uint8_t param, uint8_t* data_buf); - virtual void device_enable(); virtual void device_actions(); void expanderWrite(byte data); void writeString(char* str);