[wpilib] Pregenerate PWM motor controllers (#6742)

Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
This commit is contained in:
PJ Reiniger
2024-06-18 10:43:08 -04:00
committed by GitHub
parent 66c0abb732
commit b6bd798f9e
49 changed files with 790 additions and 271 deletions

View File

@@ -1,46 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* Digilent DMC 60 Motor Controller.
*
* <p>Note that the DMC uses the following bounds for PWM values. These values should work
* reasonably well for most controllers, but if users experience issues such as asymmetric behavior
* around the deadband or inability to saturate the controller in either direction, calibration is
* recommended. The calibration procedure can be found in the DMC 60 User Manual available from
* Digilent.
*
* <ul>
* <li>2.004ms = full "forward"
* <li>1.520ms = the "high end" of the deadband range
* <li>1.500ms = center of the deadband range (off)
* <li>1.480ms = the "low end" of the deadband range
* <li>0.997ms = full "reverse"
* </ul>
*/
public class DMC60 extends PWMMotorController {
/**
* Constructor.
*
* @param channel The PWM channel that the DMC60 is attached to. 0-9 are on-board, 10-19 are on
* the MXP port
*/
@SuppressWarnings("this-escape")
public DMC60(final int channel) {
super("DMC60", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_DigilentDMC60, getChannel() + 1);
}
}

View File

@@ -1,45 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* Texas Instruments / Vex Robotics Jaguar Motor Controller as a PWM device.
*
* <p>Note that the Jaguar uses the following bounds for PWM values. These values should work
* reasonably well for most controllers, but if users experience issues such as asymmetric behavior
* around the deadband or inability to saturate the controller in either direction, calibration is
* recommended. The calibration procedure can be found in the Jaguar User Manual available from Vex.
*
* <ul>
* <li>2.310ms = full "forward"
* <li>1.550ms = the "high end" of the deadband range
* <li>1.507ms = center of the deadband range (off)
* <li>1.454ms = the "low end" of the deadband range
* <li>0.697ms = full "reverse"
* </ul>
*/
public class Jaguar extends PWMMotorController {
/**
* Constructor.
*
* @param channel The PWM channel that the Jaguar is attached to. 0-9 are on-board, 10-19 are on
* the MXP port
*/
@SuppressWarnings("this-escape")
public Jaguar(final int channel) {
super("Jaguar", channel);
m_pwm.setBoundsMicroseconds(2310, 1550, 1507, 1454, 697);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_Jaguar, getChannel() + 1);
}
}

View File

@@ -1,45 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* REV Robotics SPARK Flex Motor Controller with PWM control.
*
* <p>Note that the SPARK Flex uses the following bounds for PWM values. These values should work
* reasonably well for most controllers, but if users experience issues such as asymmetric behavior
* around the deadband or inability to saturate the controller in either direction, calibration is
* recommended. The calibration procedure can be found in the SPARK Flex User Manual available from
* REV Robotics.
*
* <ul>
* <li>2.003ms = full "forward"
* <li>1.550ms = the "high end" of the deadband range
* <li>1.500ms = center of the deadband range (off)
* <li>1.460ms = the "low end" of the deadband range
* <li>0.999ms = full "reverse"
* </ul>
*/
public class PWMSparkFlex extends PWMMotorController {
/**
* Common initialization code called by all constructors.
*
* @param channel The PWM channel number. 0-9 are on-board, 10-19 are on the MXP port
*/
@SuppressWarnings("this-escape")
public PWMSparkFlex(final int channel) {
super("PWMSparkFlex", channel);
m_pwm.setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_RevSparkFlexPWM, getChannel() + 1);
}
}

View File

@@ -1,45 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* REV Robotics SPARK MAX Motor Controller with PWM control.
*
* <p>Note that the SPARK MAX uses the following bounds for PWM values. These values should work
* reasonably well for most controllers, but if users experience issues such as asymmetric behavior
* around the deadband or inability to saturate the controller in either direction, calibration is
* recommended. The calibration procedure can be found in the SPARK MAX User Manual available from
* REV Robotics.
*
* <ul>
* <li>2.003ms = full "forward"
* <li>1.550ms = the "high end" of the deadband range
* <li>1.500ms = center of the deadband range (off)
* <li>1.460ms = the "low end" of the deadband range
* <li>0.999ms = full "reverse"
* </ul>
*/
public class PWMSparkMax extends PWMMotorController {
/**
* Common initialization code called by all constructors.
*
* @param channel The PWM channel number. 0-9 are on-board, 10-19 are on the MXP port
*/
@SuppressWarnings("this-escape")
public PWMSparkMax(final int channel) {
super("PWMSparkMax", channel);
m_pwm.setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_RevSparkMaxPWM, getChannel() + 1);
}
}

View File

@@ -1,46 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* Cross the Road Electronics (CTRE) Talon FX Motor Controller with PWM control.
*
* <p>Note that the TalonFX uses the following bounds for PWM values. These values should work
* reasonably well for most controllers, but if users experience issues such as asymmetric behavior
* around the deadband or inability to saturate the controller in either direction, calibration is
* recommended. The calibration procedure can be found in the TalonFX User Manual available from
* CTRE.
*
* <ul>
* <li>2.004ms = full "forward"
* <li>1.520ms = the "high end" of the deadband range
* <li>1.500ms = center of the deadband range (off)
* <li>1.480ms = the "low end" of the deadband range
* <li>0.997ms = full "reverse"
* </ul>
*/
public class PWMTalonFX extends PWMMotorController {
/**
* Constructor for a TalonFX connected via PWM.
*
* @param channel The PWM channel that the Talon FX is attached to. 0-9 are on-board, 10-19 are on
* the MXP port
*/
@SuppressWarnings("this-escape")
public PWMTalonFX(final int channel) {
super("PWMTalonFX", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_TalonFX, getChannel() + 1);
}
}

View File

@@ -1,46 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* Cross the Road Electronics (CTRE) Talon SRX Motor Controller with PWM control.
*
* <p>Note that the TalonSRX uses the following bounds for PWM values. These values should work
* reasonably well for most controllers, but if users experience issues such as asymmetric behavior
* around the deadband or inability to saturate the controller in either direction, calibration is
* recommended. The calibration procedure can be found in the TalonSRX User Manual available from
* CTRE.
*
* <ul>
* <li>2.004ms = full "forward"
* <li>1.520ms = the "high end" of the deadband range
* <li>1.500ms = center of the deadband range (off)
* <li>1.480ms = the "low end" of the deadband range
* <li>0.997ms = full "reverse"
* </ul>
*/
public class PWMTalonSRX extends PWMMotorController {
/**
* Constructor for a TalonSRX connected via PWM.
*
* @param channel The PWM channel that the Talon SRX is attached to. 0-9 are on-board, 10-19 are
* on the MXP port
*/
@SuppressWarnings("this-escape")
public PWMTalonSRX(final int channel) {
super("PWMTalonSRX", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_PWMTalonSRX, getChannel() + 1);
}
}

View File

@@ -1,45 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* Playing with Fusion Venom Smart Motor with PWM control.
*
* <p>Note that the Venom uses the following bounds for PWM values. These values should work
* reasonably well for most controllers, but if users experience issues such as asymmetric behavior
* around the deadband or inability to saturate the controller in either direction, calibration is
* recommended.
*
* <ul>
* <li>2.004ms = full "forward"
* <li>1.520ms = the "high end" of the deadband range
* <li>1.500ms = center of the deadband range (off)
* <li>1.480ms = the "low end" of the deadband range
* <li>0.997ms = full "reverse"
* </ul>
*/
public class PWMVenom extends PWMMotorController {
/**
* Constructor for a Venom connected via PWM.
*
* @param channel The PWM channel that the Venom is attached to. 0-9 are on-board, 10-19 are on
* the MXP port
*/
@SuppressWarnings("this-escape")
public PWMVenom(final int channel) {
super("PWMVenom", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_FusionVenom, getChannel() + 1);
}
}

View File

@@ -1,46 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* Cross the Road Electronics (CTRE) Victor SPX Motor Controller with PWM control.
*
* <p>Note that the Victor SPX uses the following bounds for PWM values. These values should work
* reasonably well for most controllers, but if users experience issues such as asymmetric behavior
* around the deadband or inability to saturate the controller in either direction, calibration is
* recommended. The calibration procedure can be found in the Victor SPX User Manual available from
* CTRE.
*
* <ul>
* <li>2.004ms = full "forward"
* <li>1.520ms = the "high end" of the deadband range
* <li>1.500ms = center of the deadband range (off)
* <li>1.480ms = the "low end" of the deadband range
* <li>0.997ms = full "reverse"
* </ul>
*/
public class PWMVictorSPX extends PWMMotorController {
/**
* Constructor for a Victor SPX connected via PWM.
*
* @param channel The PWM channel that the PWMVictorSPX is attached to. 0-9 are on-board, 10-19
* are on the MXP port
*/
@SuppressWarnings("this-escape")
public PWMVictorSPX(final int channel) {
super("PWMVictorSPX", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_PWMVictorSPX, getChannel() + 1);
}
}

View File

@@ -1,46 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* Mindsensors SD540 Motor Controller.
*
* <p>Note that the SD540 uses the following bounds for PWM values. These values should work
* reasonably well for most controllers, but if users experience issues such as asymmetric behavior
* around the deadband or inability to saturate the controller in either direction, calibration is
* recommended. The calibration procedure can be found in the SD540 User Manual available from
* Mindsensors.
*
* <ul>
* <li>2.05ms = full "forward"
* <li>1.55ms = the "high end" of the deadband range
* <li>1.50ms = center of the deadband range (off)
* <li>1.44ms = the "low end" of the deadband range
* <li>0.94ms = full "reverse"
* </ul>
*/
public class SD540 extends PWMMotorController {
/**
* Constructor.
*
* @param channel The PWM channel that the SD540 is attached to. 0-9 are on-board, 10-19 are on
* the MXP port
*/
@SuppressWarnings("this-escape")
public SD540(final int channel) {
super("SD540", channel);
m_pwm.setBoundsMicroseconds(2050, 1550, 1500, 1440, 940);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_MindsensorsSD540, getChannel() + 1);
}
}

View File

@@ -1,46 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* REV Robotics SPARK Motor Controller.
*
* <p>Note that the SPARK uses the following bounds for PWM values. These values should work
* reasonably well for most controllers, but if users experience issues such as asymmetric behavior
* around the deadband or inability to saturate the controller in either direction, calibration is
* recommended. The calibration procedure can be found in the Spark User Manual available from REV
* Robotics.
*
* <ul>
* <li>2.003ms = full "forward"
* <li>1.550ms = the "high end" of the deadband range
* <li>1.500ms = center of the deadband range (off)
* <li>1.460ms = the "low end" of the deadband range
* <li>0.999ms = full "reverse"
* </ul>
*/
public class Spark extends PWMMotorController {
/**
* Constructor.
*
* @param channel The PWM channel that the SPARK is attached to. 0-9 are on-board, 10-19 are on
* the MXP port
*/
@SuppressWarnings("this-escape")
public Spark(final int channel) {
super("Spark", channel);
m_pwm.setBoundsMicroseconds(2003, 1550, 1500, 1460, 999);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_RevSPARK, getChannel() + 1);
}
}

View File

@@ -1,45 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* Cross the Road Electronics (CTRE) Talon and Talon SR Motor Controller.
*
* <p>Note that the Talon uses the following bounds for PWM values. These values should work
* reasonably well for most controllers, but if users experience issues such as asymmetric behavior
* around the deadband or inability to saturate the controller in either direction, calibration is
* recommended. The calibration procedure can be found in the Talon User Manual available from CTRE.
*
* <ul>
* <li>2.037ms = full "forward"
* <li>1.539ms = the "high end" of the deadband range
* <li>1.513ms = center of the deadband range (off)
* <li>1.487ms = the "low end" of the deadband range
* <li>0.989ms = full "reverse"
* </ul>
*/
public class Talon extends PWMMotorController {
/**
* Constructor for a Talon (original or Talon SR).
*
* @param channel The PWM channel that the Talon is attached to. 0-9 are on-board, 10-19 are on
* the MXP port
*/
@SuppressWarnings("this-escape")
public Talon(final int channel) {
super("Talon", channel);
m_pwm.setBoundsMicroseconds(2037, 1539, 1513, 1487, 989);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_Talon, getChannel() + 1);
}
}

View File

@@ -1,49 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* VEX Robotics Victor 888 Motor Controller The Vex Robotics Victor 884 Motor Controller can also be
* used with this class but may need to be calibrated per the Victor 884 user manual.
*
* <p>Note that the Victor uses the following bounds for PWM values. These values were determined
* empirically and optimized for the Victor 888. These values should work reasonably well for Victor
* 884 controllers also but if users experience issues such as asymmetric behavior around the
* deadband or inability to saturate the controller in either direction, calibration is recommended.
* The calibration procedure can be found in the Victor 884 User Manual available from VEX Robotics:
* <a
* href="http://content.vexrobotics.com/docs/ifi-v884-users-manual-9-25-06.pdf">http://content.vexrobotics.com/docs/ifi-v884-users-manual-9-25-06.pdf</a>
*
* <ul>
* <li>2.027ms = full "forward"
* <li>1.525ms = the "high end" of the deadband range
* <li>1.507ms = center of the deadband range (off)
* <li>1.490ms = the "low end" of the deadband range
* <li>1.026ms = full "reverse"
* </ul>
*/
public class Victor extends PWMMotorController {
/**
* Constructor.
*
* @param channel The PWM channel that the Victor is attached to. 0-9 are on-board, 10-19 are on
* the MXP port
*/
@SuppressWarnings("this-escape")
public Victor(final int channel) {
super("Victor", channel);
m_pwm.setBoundsMicroseconds(2027, 1525, 1507, 1490, 1026);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k2X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_Victor, getChannel() + 1);
}
}

View File

@@ -1,46 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.wpilibj.motorcontrol;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.wpilibj.PWM;
/**
* VEX Robotics Victor SP Motor Controller.
*
* <p>Note that the VictorSP uses the following bounds for PWM values. These values should work
* reasonably well for most controllers, but if users experience issues such as asymmetric behavior
* around the deadband or inability to saturate the controller in either direction, calibration is
* recommended. The calibration procedure can be found in the VictorSP User Manual available from
* CTRE.
*
* <ul>
* <li>2.004ms = full "forward"
* <li>1.520ms = the "high end" of the deadband range
* <li>1.500ms = center of the deadband range (off)
* <li>1.480ms = the "low end" of the deadband range
* <li>0.997ms = full "reverse"
* </ul>
*/
public class VictorSP extends PWMMotorController {
/**
* Constructor.
*
* @param channel The PWM channel that the VictorSP is attached to. 0-9 are on-board, 10-19 are on
* the MXP port
*/
@SuppressWarnings("this-escape")
public VictorSP(final int channel) {
super("VictorSP", channel);
m_pwm.setBoundsMicroseconds(2004, 1520, 1500, 1480, 997);
m_pwm.setPeriodMultiplier(PWM.PeriodMultiplier.k1X);
m_pwm.setSpeed(0.0);
m_pwm.setZeroLatch();
HAL.report(tResourceType.kResourceType_VictorSP, getChannel() + 1);
}
}