Last feature addition for CANTalon java/C++ user-facing API.

- CANJaguar also touched up to report it can't do the new control mode (just like with follower).
- New third optional param for talon c'tor to speed up enable control frame.
- The pulse width routines have been moved to where the script generator puts them.  No actual changes there but should help Peter integrate the latest code generator.

Last feature additions for TalonSRX HAL for FRC2015-FRC-2016 season.

-HAL driver uses control_5 frame if firmware supports it.  This allows teams to see/confirm control settings taking effect before enabling the robot.
  For example selecting the sensor type and going to web-dash to check sensor values now works without having to enable the robot.
-Motion profile HAL routines added.  Tested on Single-Speed Double reduction (with slave Talon too).
-Start moving ctre frame defs into a new common header (better then shoving a bunch of struct defs at top of module).
-New child class in CANTalonSRX for buffering motion profile points.  Not sure it would be best to leave it as is or make another module.  It's trivial now so I thought that was acceptable, (in future it will likely possess compression strategies => no longer trivial).

Change-Id: I803680c1a6669ca3f5157d7875942def6f75b540
This commit is contained in:
Omar Zrien
2015-11-30 14:42:02 -05:00
committed by Peter Johnson
parent ec69c6a866
commit cd5765559a
14 changed files with 2462 additions and 511 deletions

View File

@@ -1010,6 +1010,7 @@ void CANJaguar::SetP(double p) {
case kPercentVbus:
case kVoltage:
case kFollower:
case kMotionProfile:
wpi_setWPIErrorWithContext(
IncompatibleMode,
"PID constants only apply in Speed, Position, and Current mode");
@@ -1045,6 +1046,7 @@ void CANJaguar::SetI(double i) {
case kPercentVbus:
case kVoltage:
case kFollower:
case kMotionProfile:
wpi_setWPIErrorWithContext(
IncompatibleMode,
"PID constants only apply in Speed, Position, and Current mode");
@@ -1080,6 +1082,7 @@ void CANJaguar::SetD(double d) {
case kPercentVbus:
case kVoltage:
case kFollower:
case kMotionProfile:
wpi_setWPIErrorWithContext(
IncompatibleMode,
"PID constants only apply in Speed, Position, and Current mode");
@@ -1516,7 +1519,7 @@ void CANJaguar::SetControlMode(ControlMode controlMode) {
// Disable the previous mode
DisableControl();
if (controlMode == kFollower)
if ((controlMode == kFollower) || (controlMode == kMotionProfile))
wpi_setWPIErrorWithContext(IncompatibleMode,
"The Jaguar only supports Current, Voltage, "
"Position, Speed, and Percent (Throttle) "