template<typename DriveMotorT, typename SteerMotorT, typename EncoderT, typename = std::enable_if_t<std::is_base_of_v<hardware::traits::CommonTalon, DriveMotorT>>, typename = std::enable_if_t<std::is_base_of_v<hardware::traits::CommonTalon, SteerMotorT>>, typename = std::enable_if_t<std::disjunction_v< std::is_same<hardware::CANcoder, EncoderT>, std::is_same<hardware::CANdi, EncoderT>, std::is_same<hardware::TalonFXS, EncoderT> >>>
class ctre::phoenix6::swerve::SimSwerveDrivetrain< DriveMotorT, SteerMotorT, EncoderT, typename, typename, typename >
Simplified swerve drive simulation class.
This class assumes that the swerve drive is perfect, meaning that there is no scrub and the wheels do not slip.
In addition, it assumes the inertia of the robot is governed only by the inertia of the steer module and the individual drive wheels. Robot-wide inertia is not accounted for, and neither is translational vs rotational inertia of the robot.
These assumptions provide a simplified example that can demonstrate the behavior of a swerve drive in simulation. Users are encouraged to expand this model for their own use.
template<typename DriveMotorT , typename SteerMotorT , typename EncoderT , typename = std::enable_if_t<std::is_base_of_v<hardware::traits::CommonTalon, DriveMotorT>>, typename = std::enable_if_t<std::is_base_of_v<hardware::traits::CommonTalon, SteerMotorT>>, typename = std::enable_if_t<std::disjunction_v< std::is_same<hardware::CANcoder, EncoderT>, std::is_same<hardware::CANdi, EncoderT>, std::is_same<hardware::TalonFXS, EncoderT> >>>
template<typename... ModuleConstants, typename = std::enable_if_t<std::conjunction_v< std::is_same< ModuleConstants, SwerveModuleConstants<typename DriveMotorT::Configuration, typename SteerMotorT::Configuration, typename EncoderT::Configuration> >... >>>
template<typename DriveMotorT , typename SteerMotorT , typename EncoderT , typename = std::enable_if_t<std::is_base_of_v<hardware::traits::CommonTalon, DriveMotorT>>, typename = std::enable_if_t<std::is_base_of_v<hardware::traits::CommonTalon, SteerMotorT>>, typename = std::enable_if_t<std::disjunction_v< std::is_same<hardware::CANcoder, EncoderT>, std::is_same<hardware::CANdi, EncoderT>, std::is_same<hardware::TalonFXS, EncoderT> >>>
Applies the effects of friction to dampen the motor voltage.
- Parameters
-
motorVoltage | Voltage output by the motor |
frictionVoltage | Voltage required to overcome friction |
- Returns
- Friction-dampened motor voltage