mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Fixed robot drive for C++ Simulation
initial values for m_invertedMotors is now 1 previously it was done in some of the constructors, but not all of them. Change-Id: I2c1ce8d8a67f82d02c4c51f1c4d1aaad143f3112
This commit is contained in:
@@ -94,7 +94,7 @@ protected:
|
||||
|
||||
static const int32_t kMaxNumberOfMotors = 4;
|
||||
|
||||
int32_t m_invertedMotors[kMaxNumberOfMotors];
|
||||
int32_t m_invertedMotors[kMaxNumberOfMotors] = {1,1,1,1};
|
||||
float m_sensitivity = 0.5;
|
||||
double m_maxOutput = 1.0;
|
||||
bool m_deleteSpeedControllers;
|
||||
|
||||
@@ -52,11 +52,6 @@ RobotDrive::RobotDrive(uint32_t leftMotorChannel, uint32_t rightMotorChannel)
|
||||
InitRobotDrive();
|
||||
m_rearLeftMotor = std::make_shared<Talon>(leftMotorChannel);
|
||||
m_rearRightMotor = std::make_shared<Talon>(rightMotorChannel);
|
||||
|
||||
for (int32_t i=0; i < kMaxNumberOfMotors; i++)
|
||||
{
|
||||
m_invertedMotors[i] = 1;
|
||||
}
|
||||
SetLeftRightMotorOutputs(0.0, 0.0);
|
||||
m_deleteSpeedControllers = true;
|
||||
}
|
||||
@@ -79,10 +74,6 @@ RobotDrive::RobotDrive(uint32_t frontLeftMotor, uint32_t rearLeftMotor,
|
||||
m_rearRightMotor = std::make_shared<Talon>(rearRightMotor);
|
||||
m_frontLeftMotor = std::make_shared<Talon>(frontLeftMotor);
|
||||
m_frontRightMotor = std::make_shared<Talon>(frontRightMotor);
|
||||
for (int32_t i=0; i < kMaxNumberOfMotors; i++)
|
||||
{
|
||||
m_invertedMotors[i] = 1;
|
||||
}
|
||||
SetLeftRightMotorOutputs(0.0, 0.0);
|
||||
m_deleteSpeedControllers = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user