2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
sensor_conversions.h File Reference
#include <units/acceleration.h>
#include <units/angle.h>
#include <units/angular_velocity.h>
#include <units/length.h>
#include <units/time.h>
#include <units/velocity.h>
#include <numbers>
#include "custom_units.h"

Go to the source code of this file.

Namespaces

namespace  sensor_conversions
 
namespace  sensor_conversions::swerve_drive
 
namespace  sensor_conversions::swerve_drive::turn
 
namespace  sensor_conversions::swerve_drive::drive
 
namespace  sensor_conversions::lifter
 
namespace  sensor_conversions::lifter::arm_extension
 
namespace  sensor_conversions::lifter::wrist
 
namespace  sensor_conversions::lifter::shoulder
 
namespace  sensor_conversions::lifter::shoulder_actuator
 
namespace  sensor_conversions::bashguard
 
namespace  sensor_conversions::oui_oui_place
 

Functions

constexpr double sensor_conversions::swerve_drive::turn::ToSensorUnit (const units::degree_t degrees)
 
constexpr units::degree_t sensor_conversions::swerve_drive::turn::ToAngle (const double sensorunit)
 
constexpr units::inch_t sensor_conversions::swerve_drive::drive::ToDistance (const double sensorunit)
 
constexpr double sensor_conversions::swerve_drive::drive::ToSensorPosition (const units::inch_t distance)
 
constexpr units::inches_per_second_t sensor_conversions::swerve_drive::drive::ToVelocity (const double sensorVelocity)
 
constexpr double sensor_conversions::swerve_drive::drive::ToSensorVelocity (const units::inches_per_second_t velocity)
 
constexpr units::inch_t sensor_conversions::lifter::arm_extension::ToExtension (const double sensorUnit)
 
constexpr double sensor_conversions::lifter::arm_extension::ToSensorUnit (const units::inch_t extension)
 
constexpr units::inches_per_second_t sensor_conversions::lifter::arm_extension::ToVelocity (const double sensorVelocity)
 
constexpr double sensor_conversions::lifter::arm_extension::ToSensorVelocity (const units::inches_per_second_t velocity)
 
constexpr units::inch_t sensor_conversions::lifter::arm_extension::ExtensionFromRotation (const units::degree_t angle)
 Find the travel of the extension given a rotation "angle" of the CANCoder.
 
constexpr units::degree_t sensor_conversions::lifter::wrist::ToAngle (const double sensorUnit)
 
constexpr double sensor_conversions::lifter::wrist::ToSensorUnit (const units::degree_t degrees)
 
constexpr units::degrees_per_second_t sensor_conversions::lifter::wrist::ToVelocity (const double sensorVelocity)
 
constexpr double sensor_conversions::lifter::wrist::ToSensorVelocity (const units::degrees_per_second_t velocity)
 
constexpr double sensor_conversions::lifter::shoulder::ToSensorUnit (const units::degree_t degrees)
 
constexpr units::degree_t sensor_conversions::lifter::shoulder::ToAngle (const double sensorUnit)
 
constexpr units::degrees_per_second_t sensor_conversions::lifter::shoulder::ToVelocity (const double sensorVelocity)
 
constexpr double sensor_conversions::lifter::shoulder::ToSensorVelocity (const units::degrees_per_second_t velocity)
 
constexpr double sensor_conversions::lifter::shoulder_actuator::ToSensorUnit (const units::inch_t extension)
 
constexpr units::inch_t sensor_conversions::lifter::shoulder_actuator::ToExtension (const double sensorUnits)
 
constexpr units::inches_per_second_t sensor_conversions::lifter::shoulder_actuator::ToVelocity (const double sensorVelocity)
 
constexpr double sensor_conversions::lifter::shoulder_actuator::ToSensorVelocity (const units::inches_per_second_t velocity)
 
constexpr units::inch_t sensor_conversions::bashguard::ToExtension (const double sensorUnit)
 
constexpr double sensor_conversions::bashguard::ToSensorUnit (const units::inch_t extension)
 
constexpr units::inches_per_second_t sensor_conversions::bashguard::ToVelocity (const double sensorVelocity)
 
constexpr double sensor_conversions::bashguard::ToSensorVelocity (const units::inches_per_second_t velocity)
 
constexpr double sensor_conversions::oui_oui_place::ToSensorUnit (const units::degree_t angle)
 
constexpr units::degree_t sensor_conversions::oui_oui_place::ToAngle (const double sensorUnits)
 
constexpr units::degrees_per_second_t sensor_conversions::oui_oui_place::ToVelocity (const double sensorVelocity)
 
constexpr double sensor_conversions::oui_oui_place::ToSensorVelocity (const units::degrees_per_second_t velocity)
 

Variables

constexpr double sensor_conversions::swerve_drive::turn::sensorConversionFactor
 multiply to convert raw sensor units to module degrees
 
constexpr auto sensor_conversions::swerve_drive::drive::wheelDiameter = 3.5_in
 
constexpr auto sensor_conversions::swerve_drive::drive::wheelCircumference = wheelDiameter * std::numbers::pi
 
constexpr double sensor_conversions::swerve_drive::drive::sensorUnitsPerMotorRevolution = 2048
 
constexpr double sensor_conversions::swerve_drive::drive::driveGearRatio = 36000.0 / 5880.0
 
constexpr double sensor_conversions::lifter::arm_extension::sensorToMotorRevolution = 1.0 / 2048
 
constexpr double sensor_conversions::lifter::arm_extension::gearboxReduction = 1.0 / 12.0
 
constexpr double sensor_conversions::lifter::arm_extension::driveSprocketTeeth = 15.0
 
constexpr double sensor_conversions::lifter::arm_extension::extensionInchesPerTooth = 0.375 / 1
 
constexpr double sensor_conversions::lifter::arm_extension::absEncoderReduction = 1.0 / 10
 
constexpr units::inch_t sensor_conversions::lifter::arm_extension::extensionPerEncoderRevolution
 
constexpr double sensor_conversions::lifter::wrist::sensorUnitsPerRevolution = 2048.0
 
constexpr double sensor_conversions::lifter::wrist::gearBoxReduction = 9.0
 
constexpr double sensor_conversions::lifter::wrist::extraReduction = 60.0 / 20.0
 
constexpr double sensor_conversions::lifter::wrist::sensorConversionFactor
 
constexpr double sensor_conversions::lifter::shoulder::sensorConversionFactor
 multiply to convert raw sensor units to module degrees
 
constexpr double sensor_conversions::lifter::shoulder_actuator::sensorToMotorRev = 1.0 / 2048
 
constexpr double sensor_conversions::lifter::shoulder_actuator::beltReduction = 30.0 / 18.0
 
constexpr double sensor_conversions::lifter::shoulder_actuator::extensionMillimetersPerRevolution = 4.0
 
constexpr double sensor_conversions::lifter::shoulder_actuator::fudgeFactor = 0.992
 This seems to be due to some discrepancy on comp bot.
 
constexpr double sensor_conversions::bashguard::sensorToMotorRevolution = 1.0 / 2048
 
constexpr double sensor_conversions::bashguard::gearboxReduction = 1.0 / 5
 
constexpr double sensor_conversions::bashguard::driveSprocketTeeth = 15.0
 
constexpr double sensor_conversions::bashguard::extensionInchesPerTooth = 0.375 / 1
 
constexpr double sensor_conversions::oui_oui_place::sensorConversionFactor = 360.0 / 2048
 multiply to convert raw sensor units to module degrees
 
constexpr double sensor_conversions::oui_oui_place::gearboxReduction = 1.0 / 15.0