|
| | SwerveInputStream (SwerveDrive< NumModules > &drive, std::function< double()> x, std::function< double()> y, std::function< double()> rot) |
| |
| | SwerveInputStream (SwerveDrive< NumModules > &drive, std::function< double()> x, std::function< double()> y, std::function< double()> headingX, std::function< double()> headingY) |
| |
| SwerveInputStream | Clone () const |
| |
| SwerveInputStream & | WithTelemetry (std::string name, TelemetryVerbosity verbosity) |
| |
| std::optional< std::reference_wrapper< SwerveInputStreamTelemetry< NumModules > > > | GetTelemetry () |
| |
| std::string | GetCurrentModeName () const |
| |
| double | GetAxisDeadband () const |
| |
| void | SetAxisDeadband (double deadband) |
| |
| double | GetTranslationAxisScale () const |
| |
| void | SetTranslationAxisScale (double scale) |
| |
| double | GetOmegaAxisScale () const |
| |
| void | SetOmegaAxisScale (double scale) |
| |
| wpi::units::meters_per_second_t | GetMaximumChassisLinearVelocity () const |
| |
| void | SetMaximumChassisLinearVelocity (wpi::units::meters_per_second_t velocity) |
| |
| wpi::units::radians_per_second_t | GetMaximumChassisAngularVelocity () const |
| |
| void | SetMaximumChassisAngularVelocity (wpi::units::radians_per_second_t velocity) |
| |
| bool | IsTranslationCubeEnabled () const |
| |
| void | SetTranslationCubeEnabled (bool enabled) |
| |
| bool | IsOmegaCubeEnabled () const |
| |
| void | SetOmegaCubeEnabled (bool enabled) |
| |
| bool | IsAllianceRelativeEnabled () const |
| |
| void | SetAllianceRelativeEnabled (bool enabled) |
| |
| bool | IsRobotRelativeEnabled () const |
| |
| void | SetRobotRelativeEnabled (bool enabled) |
| |
| SwerveInputStream & | WithMaximumLinearVelocity (wpi::units::meters_per_second_t velocity) |
| |
| SwerveInputStream & | WithMaximumAngularVelocity (wpi::units::radians_per_second_t velocity) |
| |
| SwerveInputStream & | WithControllerRotationAxis (std::function< double()> rot) |
| |
| SwerveInputStream & | WithControllerHeadingAxis (std::function< double()> headingX, std::function< double()> headingY) |
| |
| SwerveInputStream & | WithDeadband (double deadband) |
| |
| SwerveInputStream & | Deadband (double deadband) |
| |
| SwerveInputStream & | WithScaleTranslation (double scale) |
| |
| SwerveInputStream & | WithScaleRotation (double scale) |
| |
| SwerveInputStream & | WithHeadingControl (std::function< bool()> trigger) |
| |
| SwerveInputStream & | WithHeading (std::function< wpi::units::radian_t()> heading) |
| |
| SwerveInputStream & | WithAim (std::function< wpi::math::Pose2d()> aimTarget, std::function< bool()> trigger) |
| |
| SwerveInputStream & | WithAimLookahead (wpi::units::second_t lookahead) |
| |
| SwerveInputStream & | WithAimFeedforward (wpi::math::SimpleMotorFeedforward< wpi::units::radians > feedforward) |
| |
| SwerveInputStream & | WithAimHeadingOffset (wpi::math::Rotation2d offset, std::function< bool()> enabled) |
| |
| SwerveInputStream & | WithAimHeadingOffset (wpi::math::Rotation2d offset) |
| |
| bool | IsAimLocked (wpi::units::radian_t tolerance) |
| |
| wpi::math::Translation2d | GetTargetVector (const wpi::math::Pose2d &target) |
| |
| wpi::units::radians_per_second_t | CalculateAngularVelocity (wpi::units::radian_t target) |
| |
| SwerveInputStream & | WithTranslationOnly (std::function< bool()> trigger) |
| |
| SwerveInputStream & | WithCubeRotationControllerAxis (std::function< bool()> enabled) |
| |
| SwerveInputStream & | WithCubeRotationControllerAxis () |
| |
| SwerveInputStream & | WithCubeTranslationControllerAxis (std::function< bool()> enabled) |
| |
| SwerveInputStream & | WithCubeTranslationControllerAxis () |
| |
| SwerveInputStream & | WithAllianceRelativeControl (std::function< bool()> enabled) |
| |
| SwerveInputStream & | WithAllianceRelativeControl () |
| |
| SwerveInputStream & | WithRobotRelative (std::function< bool()> enabled) |
| |
| SwerveInputStream & | WithRobotRelative () |
| |
| SwerveInputStream & | WithTranslationHeadingOffset (wpi::math::Rotation2d angle, std::function< bool()> enabled) |
| |
| SwerveInputStream & | WithTranslationHeadingOffset (wpi::math::Rotation2d angle) |
| |
| wpi::math::ChassisVelocities | Get () |
| |
| wpi::math::ChassisVelocities | operator() () |
| |
template<
size_t NumModules = 4>
Aim from where the robot will be after a delay, instead of where it is now. The pose is moved along the robot's field relative velocity by this time before the direction to the target is worked out.
A game piece leaves the robot a moment after the aim was calculated: the camera, the loop, the motors and the feed all take time, and the robot keeps moving through all of it. Add those delays together for a starting value, then tune it. It is often 100 to 200 milliseconds.
This assumes the robot keeps its current velocity, so it works best while driving in a straight line.