From 3fddee51c21bfdb3a4e4fe043bbff598a9378be4 Mon Sep 17 00:00:00 2001 From: Thomas Clark Date: Fri, 29 Aug 2014 13:00:31 -0400 Subject: [PATCH] Make Talon the default speed controller for RobotDrive Change-Id: I87047e11efb26f5081a3e23dc8f36fa9bb76a88c --- wpilibc/wpilibC++Devices/src/RobotDrive.cpp | 18 +++++++++--------- .../java/edu/wpi/first/wpilibj/RobotDrive.java | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/wpilibc/wpilibC++Devices/src/RobotDrive.cpp b/wpilibc/wpilibC++Devices/src/RobotDrive.cpp index 97509dfde3..ab6ccddb49 100644 --- a/wpilibc/wpilibC++Devices/src/RobotDrive.cpp +++ b/wpilibc/wpilibC++Devices/src/RobotDrive.cpp @@ -9,7 +9,7 @@ #include "CANJaguar.h" #include "GenericHID.h" #include "Joystick.h" -#include "Jaguar.h" +#include "Talon.h" //#include "NetworkCommunication/UsageReporting.h" #include "Utility.h" #include "WPIErrors.h" @@ -46,15 +46,15 @@ void RobotDrive::InitRobotDrive() { /** Constructor for RobotDrive with 2 motors specified with channel numbers. * Set up parameters for a two wheel drive system where the * left and right motor pwm channels are specified in the call. - * This call assumes Jaguars for controlling the motors. + * This call assumes Talons for controlling the motors. * @param leftMotorChannel The PWM channel number that drives the left motor. * @param rightMotorChannel The PWM channel number that drives the right motor. */ RobotDrive::RobotDrive(uint32_t leftMotorChannel, uint32_t rightMotorChannel) { InitRobotDrive(); - m_rearLeftMotor = new Jaguar(leftMotorChannel); - m_rearRightMotor = new Jaguar(rightMotorChannel); + m_rearLeftMotor = new Talon(leftMotorChannel); + m_rearRightMotor = new Talon(rightMotorChannel); for (int32_t i=0; i < kMaxNumberOfMotors; i++) { m_invertedMotors[i] = 1; @@ -67,7 +67,7 @@ RobotDrive::RobotDrive(uint32_t leftMotorChannel, uint32_t rightMotorChannel) * Constructor for RobotDrive with 4 motors specified with channel numbers. * Set up parameters for a four wheel drive system where all four motor * pwm channels are specified in the call. - * This call assumes Jaguars for controlling the motors. + * This call assumes Talons for controlling the motors. * @param frontLeftMotor Front left motor channel number * @param rearLeftMotor Rear Left motor channel number * @param frontRightMotor Front right motor channel number @@ -77,10 +77,10 @@ RobotDrive::RobotDrive(uint32_t frontLeftMotor, uint32_t rearLeftMotor, uint32_t frontRightMotor, uint32_t rearRightMotor) { InitRobotDrive(); - m_rearLeftMotor = new Jaguar(rearLeftMotor); - m_rearRightMotor = new Jaguar(rearRightMotor); - m_frontLeftMotor = new Jaguar(frontLeftMotor); - m_frontRightMotor = new Jaguar(frontRightMotor); + m_rearLeftMotor = new Talon(rearLeftMotor); + m_rearRightMotor = new Talon(rearRightMotor); + m_frontLeftMotor = new Talon(frontLeftMotor); + m_frontRightMotor = new Talon(frontRightMotor); for (int32_t i=0; i < kMaxNumberOfMotors; i++) { m_invertedMotors[i] = 1; diff --git a/wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java b/wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java index b1db46bb6b..1cefc9b79b 100644 --- a/wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java +++ b/wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java @@ -79,7 +79,7 @@ public class RobotDrive implements MotorSafety { /** Constructor for RobotDrive with 2 motors specified with channel numbers. * Set up parameters for a two wheel drive system where the * left and right motor pwm channels are specified in the call. - * This call assumes Jaguars for controlling the motors. + * This call assumes Talons for controlling the motors. * @param leftMotorChannel The PWM channel number that drives the left motor. * @param rightMotorChannel The PWM channel number that drives the right motor. */ @@ -87,9 +87,9 @@ public class RobotDrive implements MotorSafety { m_sensitivity = kDefaultSensitivity; m_maxOutput = kDefaultMaxOutput; m_frontLeftMotor = null; - m_rearLeftMotor = new Jaguar(leftMotorChannel); + m_rearLeftMotor = new Talon(leftMotorChannel); m_frontRightMotor = null; - m_rearRightMotor = new Jaguar(rightMotorChannel); + m_rearRightMotor = new Talon(rightMotorChannel); for (int i = 0; i < kMaxNumberOfMotors; i++) { m_invertedMotors[i] = 1; } @@ -102,7 +102,7 @@ public class RobotDrive implements MotorSafety { * Constructor for RobotDrive with 4 motors specified with channel numbers. * Set up parameters for a four wheel drive system where all four motor * pwm channels are specified in the call. - * This call assumes Jaguars for controlling the motors. + * This call assumes Talons for controlling the motors. * @param frontLeftMotor Front left motor channel number * @param rearLeftMotor Rear Left motor channel number * @param frontRightMotor Front right motor channel number @@ -112,10 +112,10 @@ public class RobotDrive implements MotorSafety { final int frontRightMotor, final int rearRightMotor) { m_sensitivity = kDefaultSensitivity; m_maxOutput = kDefaultMaxOutput; - m_rearLeftMotor = new Jaguar(rearLeftMotor); - m_rearRightMotor = new Jaguar(rearRightMotor); - m_frontLeftMotor = new Jaguar(frontLeftMotor); - m_frontRightMotor = new Jaguar(frontRightMotor); + m_rearLeftMotor = new Talon(rearLeftMotor); + m_rearRightMotor = new Talon(rearRightMotor); + m_frontLeftMotor = new Talon(frontLeftMotor); + m_frontRightMotor = new Talon(frontRightMotor); for (int i = 0; i < kMaxNumberOfMotors; i++) { m_invertedMotors[i] = 1; }