6#include <unordered_map>
8#include <condition_variable>
10#include <units/angle.h>
11#include <units/angular_velocity.h>
12#include <units/time.h>
13#include <units/temperature.h>
14#include "redux/canand/CanandDevice.h"
15#include "redux/canand/CanandEventLoop.h"
16#include "redux/canand/CanandSettingsManager.h"
17#include "redux/canand/CooldownWarning.h"
18#include "redux/frames/Frame.h"
20#include "redux/sensors/canandmag/CanandmagDetails.h"
21#include "redux/sensors/canandmag/CanandmagFaults.h"
22#include "redux/sensors/canandmag/CanandmagSettings.h"
23#include "redux/sensors/canandmag/CanandmagStatus.h"
132 bool SetPosition(units::turn_t newPosition, units::second_t timeout = 20_ms);
142 bool SetAbsPosition(units::turn_t newPosition, units::second_t timeout = 20_ms,
bool ephemeral =
false);
150 bool ZeroAll(units::second_t timeout = 20_ms);
259 inline CanandmagSettings GetSettings(units::second_t timeout = 350_ms, units::second_t missingTimeout = 20_ms, uint32_t attempts = 3) {
260 return stg.GetSettings(timeout, missingTimeout, attempts);
267 inline void StartFetchSettings() {
return stg.StartFetchSettings(); }
320 inline CanandmagSettings GetSettingsAsync() {
return stg.GetKnownSettings(); }
345 inline CanandmagSettings SetSettings(CanandmagSettings& settings, units::second_t timeout = 20_ms, uint32_t attempts = 3) {
346 return stg.SetSettings(settings, timeout, attempts);
358 inline CanandmagSettings ResetFactoryDefaults(
bool clearZero =
false, units::second_t timeout = 350_ms) {
361 return stg.SendReceiveSettingCommand(val, timeout,
true);
411 static constexpr double kCountsPerRotation = 16384;
414 static constexpr double kCountsPerRotationPerSecond = 1024;
434 bool dataRecvOnce{
false};
435 units::second_t lastMessageTime{0_s};
Definition: CanandAddress.h:62
Definition: CanandDevice.h:35
virtual CanandAddress & GetAddress()=0
virtual CanandFirmwareVersion GetMinimumFirmwareVersion()
Definition: CanandDevice.h:109
virtual void HandleMessage(CanandMessage &msg)=0
virtual std::string GetDeviceClassName()
Definition: CanandDevice.h:74
Definition: CanandMessage.h:26
Definition: CanandSettingsManager.h:82
Definition: CooldownWarning.h:15
Definition: CanandmagFaults.h:13
Definition: CanandmagSettings.h:54
Definition: Canandmag.h:91
bool SetPosition(units::turn_t newPosition, units::second_t timeout=20_ms)
bool ZeroAll(units::second_t timeout=20_ms)
CanandmagFaults GetActiveFaults()
units::turn_t GetPosition()
units::celsius_t GetTemperature()
CanandmagFaults GetStickyFaults()
CanandmagStatus GetStatus()
Definition: Canandmag.h:195
void SetPartyMode(uint8_t level)
units::turns_per_second_t GetVelocity()
units::turn_t GetAbsPosition()
bool SetAbsPosition(units::turn_t newPosition, units::second_t timeout=20_ms, bool ephemeral=false)
@ kResetFactoryDefaultKeepZero
Definition: CanandmagDetails.h:76
@ kResetFactoryDefault
Definition: CanandmagDetails.h:72
void RemoveCANListener(CanandDevice *device)
Definition: CanandmagSettings.h:12
Definition: CanandFirmwareVersion.h:17
Definition: CanandmagStatus.h:13