41 std::shared_ptr<Odometry> iodometry,
43 const QLength &imoveThreshold = 0_mm,
44 const QAngle &iturnThreshold = 0_deg,
63 driveToPoint(
const Point &ipoint,
bool ibackwards =
false,
const QLength &ioffset = 0_mm) = 0;
145 std::shared_ptr<Odometry>
odom;
static std::shared_ptr< Logger > getDefaultLogger()
~OdomChassisController() override
std::atomic_bool dtorCalled
OdomChassisController & operator=(OdomChassisController &&other)=delete
virtual void turnToPoint(const Point &ipoint)=0
Turns the robot to face a point in the odom frame.
void startOdomThread()
Starts the internal odometry thread.
virtual QLength getMoveThreshold() const
CrossplatformThread * getOdomThread() const
CrossplatformThread * odomTask
StateMode defaultStateMode
void setDefaultStateMode(const StateMode &imode)
Sets a default StateMode that will be used to interpret target points and query the Odometry state.
OdomChassisController(OdomChassisController &&other)=delete
virtual void setMoveThreshold(const QLength &imoveThreshold)
Set a new move threshold.
virtual OdomState getState() const
std::shared_ptr< Odometry > getOdometry()
static void trampoline(void *context)
OdomChassisController & operator=(const OdomChassisController &other)=delete
virtual void driveToPoint(const Point &ipoint, bool ibackwards=false, const QLength &ioffset=0_mm)=0
Drives the robot straight to a point in the odom frame.
virtual void turnToAngle(const QAngle &iangle)=0
Turns the robot to face an angle in the odom frame.
OdomChassisController(const OdomChassisController &)=delete
virtual void setTurnThreshold(const QAngle &iturnTreshold)
Set a new turn threshold.
std::shared_ptr< Logger > logger
std::atomic_bool odomTaskRunning
OdomChassisController(TimeUtil itimeUtil, std::shared_ptr< Odometry > iodometry, const StateMode &imode=StateMode::FRAME_TRANSFORMATION, const QLength &imoveThreshold=0_mm, const QAngle &iturnThreshold=0_deg, std::shared_ptr< Logger > ilogger=Logger::getDefaultLogger())
Odometry based chassis controller.
std::shared_ptr< Odometry > odom
virtual QAngle getTurnThreshold() const
virtual void setState(const OdomState &istate)
Set a new state to be the current state.
Utility class for holding an AbstractTimer, AbstractRate, and SettledUtil together in one class since...
StateMode
The mode for the OdomState calculated by Odometry.
@ FRAME_TRANSFORMATION
+x is forward, +y is right, 0 degrees is along +x