6#include <units/acceleration.h>
7#include <units/angle.h>
8#include <units/angular_velocity.h>
9#include <units/length.h>
10#include <units/time.h>
11#include <units/velocity.h>
18 namespace swerve_drive {
26 constexpr units::degree_t
ToAngle(
const double sensorunit) {
36 constexpr units::inch_t
ToDistance(
const double sensorunit) {
43 constexpr units::inches_per_second_t
ToVelocity(
const double sensorVelocity) {
44 return ToDistance(sensorVelocity) / units::decisecond_t{1};
53 namespace arm_extension {
62 constexpr units::inch_t
ToExtension(
const double sensorUnit) {
71 constexpr units::inches_per_second_t
ToVelocity(
const double sensorVelocity) {
72 return units::inches_per_second_t{
ToExtension(sensorVelocity) / units::decisecond_t{1}};
85 units::make_unit<units::dimensionless::scalar_t>((angle.to<
double>() / 360.0));
95 constexpr units::degree_t
ToAngle(
const double sensorUnit) {
103 constexpr units::degrees_per_second_t
ToVelocity(
const double sensorVelocity) {
104 return units::degrees_per_second_t{
ToAngle(sensorVelocity) / units::decisecond_t{1}};
117 constexpr units::degree_t
ToAngle(
const double sensorUnit) {
121 constexpr units::degrees_per_second_t
ToVelocity(
const double sensorVelocity) {
122 return units::degrees_per_second_t{
ToAngle(sensorVelocity) / units::decisecond_t{1}};
128 namespace shoulder_actuator {
145 constexpr units::inches_per_second_t
ToVelocity(
const double sensorVelocity) {
146 return units::inches_per_second_t{
ToExtension(sensorVelocity) / units::decisecond_t{1}};
153 namespace bashguard {
167 constexpr units::inches_per_second_t
ToVelocity(
const double sensorVelocity) {
168 return units::inches_per_second_t{
ToExtension(sensorVelocity) / units::decisecond_t{1}};
175 namespace oui_oui_place {
184 constexpr units::degree_t
ToAngle(
const double sensorUnits) {
188 constexpr units::degrees_per_second_t
ToVelocity(
const double sensorVelocity) {
189 return units::degrees_per_second_t{
ToAngle(sensorVelocity) / units::decisecond_t{1}};
constexpr double gearboxReduction
Definition sensor_conversions.h:155
constexpr double ToSensorVelocity(const units::inches_per_second_t velocity)
Definition sensor_conversions.h:170
constexpr double sensorToMotorRevolution
Definition sensor_conversions.h:154
constexpr units::inches_per_second_t ToVelocity(const double sensorVelocity)
Definition sensor_conversions.h:167
constexpr double ToSensorUnit(const units::inch_t extension)
Definition sensor_conversions.h:162
constexpr double extensionInchesPerTooth
Definition sensor_conversions.h:157
constexpr double driveSprocketTeeth
Definition sensor_conversions.h:156
constexpr units::inch_t ToExtension(const double sensorUnit)
Definition sensor_conversions.h:158
constexpr double driveSprocketTeeth
Definition sensor_conversions.h:56
constexpr double gearboxReduction
Definition sensor_conversions.h:55
constexpr units::inch_t ToExtension(const double sensorUnit)
Definition sensor_conversions.h:62
constexpr units::inch_t ExtensionFromRotation(const units::degree_t angle)
Find the travel of the extension given a rotation "angle" of the CANCoder.
Definition sensor_conversions.h:83
constexpr double ToSensorVelocity(const units::inches_per_second_t velocity)
Definition sensor_conversions.h:74
constexpr double absEncoderReduction
Definition sensor_conversions.h:58
constexpr units::inches_per_second_t ToVelocity(const double sensorVelocity)
Definition sensor_conversions.h:71
constexpr double extensionInchesPerTooth
Definition sensor_conversions.h:57
constexpr double ToSensorUnit(const units::inch_t extension)
Definition sensor_conversions.h:66
constexpr double sensorToMotorRevolution
Definition sensor_conversions.h:54
constexpr units::inch_t extensionPerEncoderRevolution
Definition sensor_conversions.h:59
constexpr double sensorToMotorRev
Definition sensor_conversions.h:129
constexpr double fudgeFactor
This seems to be due to some discrepancy on comp bot.
Definition sensor_conversions.h:132
constexpr double beltReduction
Definition sensor_conversions.h:130
constexpr double ToSensorVelocity(const units::inches_per_second_t velocity)
Definition sensor_conversions.h:148
constexpr double ToSensorUnit(const units::inch_t extension)
Definition sensor_conversions.h:134
constexpr double extensionMillimetersPerRevolution
Definition sensor_conversions.h:131
constexpr units::inch_t ToExtension(const double sensorUnits)
Definition sensor_conversions.h:140
constexpr units::inches_per_second_t ToVelocity(const double sensorVelocity)
Definition sensor_conversions.h:145
constexpr units::degrees_per_second_t ToVelocity(const double sensorVelocity)
Definition sensor_conversions.h:121
constexpr units::degree_t ToAngle(const double sensorUnit)
Definition sensor_conversions.h:117
constexpr double sensorConversionFactor
multiply to convert raw sensor units to module degrees
Definition sensor_conversions.h:112
constexpr double ToSensorUnit(const units::degree_t degrees)
Definition sensor_conversions.h:114
constexpr double ToSensorVelocity(const units::degrees_per_second_t velocity)
Definition sensor_conversions.h:124
constexpr double sensorUnitsPerRevolution
Definition sensor_conversions.h:89
constexpr units::degrees_per_second_t ToVelocity(const double sensorVelocity)
Definition sensor_conversions.h:103
constexpr double ToSensorUnit(const units::degree_t degrees)
Definition sensor_conversions.h:99
constexpr units::degree_t ToAngle(const double sensorUnit)
Definition sensor_conversions.h:95
constexpr double extraReduction
Definition sensor_conversions.h:91
constexpr double gearBoxReduction
Definition sensor_conversions.h:90
constexpr double ToSensorVelocity(const units::degrees_per_second_t velocity)
Definition sensor_conversions.h:106
constexpr double sensorConversionFactor
Definition sensor_conversions.h:92
constexpr double sensorConversionFactor
multiply to convert raw sensor units to module degrees
Definition sensor_conversions.h:177
constexpr double ToSensorUnit(const units::degree_t angle)
Definition sensor_conversions.h:180
constexpr double gearboxReduction
Definition sensor_conversions.h:178
constexpr units::degrees_per_second_t ToVelocity(const double sensorVelocity)
Definition sensor_conversions.h:188
constexpr double ToSensorVelocity(const units::degrees_per_second_t velocity)
Definition sensor_conversions.h:192
constexpr units::degree_t ToAngle(const double sensorUnits)
Definition sensor_conversions.h:184
constexpr auto wheelCircumference
Definition sensor_conversions.h:32
constexpr double ToSensorVelocity(const units::inches_per_second_t velocity)
Definition sensor_conversions.h:46
constexpr double sensorUnitsPerMotorRevolution
Definition sensor_conversions.h:33
constexpr auto wheelDiameter
Definition sensor_conversions.h:31
constexpr double ToSensorPosition(const units::inch_t distance)
Definition sensor_conversions.h:39
constexpr units::inch_t ToDistance(const double sensorunit)
Definition sensor_conversions.h:36
constexpr double driveGearRatio
Definition sensor_conversions.h:34
constexpr units::inches_per_second_t ToVelocity(const double sensorVelocity)
Definition sensor_conversions.h:43
constexpr double ToSensorUnit(const units::degree_t degrees)
Definition sensor_conversions.h:23
constexpr double sensorConversionFactor
multiply to convert raw sensor units to module degrees
Definition sensor_conversions.h:21
constexpr units::degree_t ToAngle(const double sensorunit)
Definition sensor_conversions.h:26
Definition sensor_conversions.h:17