done with all changes for new encoder
This commit is contained in:
+8
-6
@@ -13,8 +13,8 @@
|
||||
MoveControl::MoveControl() {
|
||||
this->left_motor = new MotorControl();
|
||||
this->right_motor = new MotorControl();
|
||||
this->left_speedometer = new Speedometer;
|
||||
this->right_speedometer = new Speedometer;
|
||||
this->left_speedometer = new Speedometer(M_ENCODE_LEFT, WHEEL_DIAMETER, ENC_STEPS);
|
||||
this->right_speedometer = new Speedometer(M_ENCODE_RIGHT, WHEEL_DIAMETER, ENC_STEPS);
|
||||
|
||||
this->left_pid = new PID( &this->wheelspeed_left,
|
||||
&this->left_pid_out,
|
||||
@@ -36,15 +36,17 @@ MoveControl::MoveControl() {
|
||||
this->right_pid->SetMode(AUTOMATIC);
|
||||
|
||||
this->left_motor->init(M_PWM_1, PWM_CHANNEL_M1, M_DIR_11, M_DIR_12);
|
||||
this->right_motor->init(M_PWM_2, PWM_CHANNEL_M2, M_DIR_21, M_DIR_22);
|
||||
|
||||
this->left_speedometer->init(M_ENCODE_1A, M_ENCODE_1B, WHEEL_DIAMETER, ENC_STEPS);
|
||||
this->right_speedometer->init(M_ENCODE_2A, M_ENCODE_2B, WHEEL_DIAMETER, ENC_STEPS);
|
||||
this->right_motor->init(M_PWM_2, PWM_CHANNEL_M2, M_DIR_21, M_DIR_22);
|
||||
}
|
||||
|
||||
MoveControl::~MoveControl() {
|
||||
this->left_motor->emergencyStop();
|
||||
this->right_motor->emergencyStop();
|
||||
|
||||
delete this->left_motor;
|
||||
delete this->right_motor;
|
||||
delete this->left_speedometer;
|
||||
delete this->right_speedometer;
|
||||
}
|
||||
|
||||
void MoveControl::loop() {
|
||||
|
||||
Reference in New Issue
Block a user