YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
EasyCRT.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 Yet Another Software Suite
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#pragma once
5
6#include <optional>
7#include <wpi/units/angle.hpp>
8
26namespace yams::units {
27
44class EasyCRT {
45 public:
55 EasyCRT(int sharedGearTeeth, int encoderATeeth, int encoderBTeeth);
56
65 std::optional<wpi::units::turn_t> Solve(wpi::units::turn_t encoderA,
66 wpi::units::turn_t encoderB) const;
67
79 std::optional<wpi::units::turn_t> Solve(wpi::units::turn_t encoderA, wpi::units::turn_t encoderB,
80 wpi::units::turn_t minAngle,
81 wpi::units::turn_t maxAngle) const;
82
88 wpi::units::turn_t GetUniqueRange() const;
89
90 private:
101 std::optional<wpi::units::turn_t> SolveRotations(double encoderA, double encoderB,
102 double minRotations,
103 double maxRotations) const;
104
106 double m_ratioA;
108 double m_ratioB;
110 double m_uniqueRangeRotations;
112 double m_toleranceRotations;
113};
114
115} // namespace yams::units
Definition EasyCRT.hpp:44
wpi::units::turn_t GetUniqueRange() const
std::optional< wpi::units::turn_t > Solve(wpi::units::turn_t encoderA, wpi::units::turn_t encoderB, wpi::units::turn_t minAngle, wpi::units::turn_t maxAngle) const
EasyCRT(int sharedGearTeeth, int encoderATeeth, int encoderBTeeth)
std::optional< wpi::units::turn_t > Solve(wpi::units::turn_t encoderA, wpi::units::turn_t encoderB) const
Definition EasyCRT.hpp:26