Quasics2016Code/SimpleRobot/src/Subsystems/DriveSystem.cpp
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS
BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS
END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS
BEGIN AUTOGENERATED CODE SOURCE = ROBOTBUILDER ID = CONSTANTS END AUTOGENERATED CODE SOURCE = ROBOTBUILDER ID = CONSTANTS
DriveSystem::DriveSystem() : Subsystem("DriveSystem") {
    leftFront = RobotMap::driveSystemLeftFront;
    leftRear = RobotMap::driveSystemLeftRear;
    rightFront = RobotMap::driveSystemRightFront;
    rightRear = RobotMap::driveSystemRightRear;
    leftEncoder = RobotMap::driveSystemLeftEncoder;
    rightEncoder = RobotMap::driveSystemRightEncoder;
    isLeftForward = false;
    isRightForward = false;
    leftPower = 0;
    rightPower = 0;
    try {
        navx.reset(new AHRS(SPI::Port::kMXP));
    }
    catch (const std::exception& ex) {
        std::string err_string = "Error instantiating navX-MXP:  ";
        err_string += ex.what();
        DriverStation::ReportError(err_string.c_str());
    }
}
DriveSystem :: DriveSystem ( ) : Subsystem ( " " ) { leftFront = RobotMap :: driveSystemLeftFront ; leftRear = RobotMap :: driveSystemLeftRear ; rightFront = RobotMap :: driveSystemRightFront ; rightRear = RobotMap :: driveSystemRightRear ; leftEncoder = RobotMap :: driveSystemLeftEncoder ; rightEncoder = RobotMap :: driveSystemRightEncoder ; isLeftForward = false ; isRightForward = false ; leftPower = 0 ; rightPower = 0 ; try { navx . reset ( new AHRS ( SPI :: Port :: kMXP ) ) ; } catch ( const std :: exception & ex ) { std :: string err_string = " " ; err_string += ex . what ( ) ; DriverStation :: ReportError ( err_string . c_str ( ) ) ; } }
BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS
END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTANTS
BEGIN AUTOGENERATED CODE SOURCE = ROBOTBUILDER ID = CONSTANTS END AUTOGENERATED CODE SOURCE = ROBOTBUILDER ID = CONSTANTS
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS /* Communicate w/navX-MXP via the MXP SPI Bus.                                       */ /* Alternatively:  I2C::Port::kMXP, SerialPort::Port::kMXP or SerialPort::Port::kUSB */ /* See http://navx-mxp.kauailabs.com/guidance/selecting-an-interface/ for details.   */