diff --git a/wpilibc/simulation/include/RobotDrive.h b/wpilibc/simulation/include/RobotDrive.h index ac69359fc9..8e9f8caed9 100644 --- a/wpilibc/simulation/include/RobotDrive.h +++ b/wpilibc/simulation/include/RobotDrive.h @@ -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; diff --git a/wpilibc/simulation/src/RobotDrive.cpp b/wpilibc/simulation/src/RobotDrive.cpp index 483cc4a453..b6216d00eb 100644 --- a/wpilibc/simulation/src/RobotDrive.cpp +++ b/wpilibc/simulation/src/RobotDrive.cpp @@ -52,11 +52,6 @@ RobotDrive::RobotDrive(uint32_t leftMotorChannel, uint32_t rightMotorChannel) InitRobotDrive(); m_rearLeftMotor = std::make_shared(leftMotorChannel); m_rearRightMotor = std::make_shared(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(rearRightMotor); m_frontLeftMotor = std::make_shared(frontLeftMotor); m_frontRightMotor = std::make_shared(frontRightMotor); - for (int32_t i=0; i < kMaxNumberOfMotors; i++) - { - m_invertedMotors[i] = 1; - } SetLeftRightMotorOutputs(0.0, 0.0); m_deleteSpeedControllers = true; }