11#include "wpi/sendable/Sendable.h"
12#include "wpi/sendable/SendableBuilder.h"
13#include "wpi/sendable/SendableHelper.h"
14#include <hal/SimDevice.h>
20#if defined(_WIN32) || defined(_WIN64)
22#pragma warning(disable : 4250)
31 public wpi::SendableHelper<CANcoder>
42 hal::SimDevice m_simCANcoder;
43 hal::SimDouble m_simSupplyVoltage;
44 hal::SimDouble m_simPosition;
45 hal::SimDouble m_simRawPosition;
46 hal::SimDouble m_simVelocity;
48 int32_t m_simPeriodicUid{-1};
49 std::vector<int32_t> m_simValueChangedUids;
51 static void OnValueChanged(
52 const char *name,
void *param, HAL_SimValueHandle handle,
53 HAL_Bool readonly,
const struct HAL_Value *value
55 static void OnPeriodic(
void *param);
83 "Constructing devices with a CAN bus string is deprecated for removal "
84 "in the 2027 season. Construct devices using a CANBus instance instead."
93#if defined(_WIN32) || defined(_WIN64)
Class for getting information about an available CAN bus.
Definition CANBus.hpp:19
Represents a status signal with data of type T, and operations available to retrieve information abou...
Definition StatusSignal.hpp:474
Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along w...
Definition CANcoder.hpp:32
CANcoder(int deviceId, CANBus canbus={})
Constructs a new CANcoder object.
CANcoder(int deviceId, std::string canbus)
Constructs a new CANcoder object.
void InitSendable(wpi::SendableBuilder &builder) override
Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along w...
Definition CoreCANcoder.hpp:602
StatusSignal< units::angle::turn_t > & GetPosition(bool refresh=true)
Position of the device.
Definition motor_constants.h:14