YAMS
Yet Another Mechanism System
Loading...
Searching...
No Matches
Classes | Namespaces
EasyCRT.hpp File Reference

Absolute angle solver for a gear that turns more than once, read by two absolute encoders. More...

#include <optional>
#include <wpi/units/angle.hpp>
Include dependency graph for EasyCRT.hpp:

Go to the source code of this file.

Classes

class  yams::units::EasyCRT
 

Namespaces

namespace  yams
 
namespace  yams::units
 

Detailed Description

Absolute angle solver for a gear that turns more than once, read by two absolute encoders.

// 100 tooth turret gear, 19 tooth pinion on encoder A, 21 tooth pinion on encoder B.
yams::units::EasyCRT crt{100, 19, 21};
// Read once at startup, while the mechanism is not moving.
std::optional<wpi::units::turn_t> turretAngle =
crt.Solve(encoderA.GetAbsolutePosition().GetValue(),
encoderB.GetAbsolutePosition().GetValue());
Absolute angle solver for a gear that turns more than once, read by two absolute encoders.
Definition EasyCRT.hpp:44
std::optional< wpi::units::turn_t > Solve(wpi::units::turn_t encoderA, wpi::units::turn_t encoderB) const