2022-Robot
Robot code for 2022 FRC Season by Argos, FRC team #1756
Loading...
Searching...
No Matches
swerve_utils.h File Reference
#include <frc/kinematics/SwerveModuleState.h>
#include <units/angle.h>
#include <units/angular_velocity.h>
#include <units/velocity.h>
#include <optional>
#include "interpolation.h"

Go to the source code of this file.

Classes

struct  argos_lib::swerve::SwerveModulePositions
 Representation of the absolute encoder position of each module at home position. More...
 
struct  argos_lib::swerve::TranslationSpeeds
 Translation speeds as percent max output. More...
 
class  argos_lib::swerve::SwerveHomeStorageInterface
 Interface capable of saving and loading module home positions from persistent storage. More...
 

Namespaces

namespace  argos_lib
 
namespace  argos_lib::swerve
 

Functions

units::degree_t argos_lib::swerve::NearestAngle (units::degree_t desiredAngle, units::degree_t referenceAngle)
 Finds closest angle alias of desiredAngle relative to referencedAngle. All inputs are normalized so ranges are unbounded. More...
 
units::degree_t argos_lib::swerve::InvertedAngle (units::degree_t desiredAngle, units::degree_t referenceAngle)
 Finds closest angle alias of a vector 180-degrees offset from desiredAngle relative to referencedAngle. All inputs are normalized so ranges are unbounded. More...
 
units::degree_t argos_lib::swerve::ConstrainAngle (units::degree_t inVal, units::degree_t minVal, units::degree_t maxVal)
 Normalize angle to specified range. More...
 
double argos_lib::swerve::ConstrainAngle (double inVal, double minVal, double maxVal)
 Normalize angle to specified range. More...
 
frc::SwerveModuleState argos_lib::swerve::Optimize (frc::SwerveModuleState desiredState, units::degree_t currentModuleAngle, units::degrees_per_second_t currentModuleAngularRate, units::feet_per_second_t currentModuleDriveVel, units::feet_per_second_t maxVelocity)
 Optimize swerve module to minimize rotations and drive direction changes. More...
 
template<class T , int size, class V >
constexpr TranslationSpeeds argos_lib::swerve::CircularInterpolate (const TranslationSpeeds rawSpeeds, const argos_lib::InterpolationMap< T, size, V > interpMap)
 Use argos_lib::InterpolationMap to apply mapping according to joystick vector magnitude. More...