11#include "wpi/sendable/Sendable.h"
12#include "wpi/sendable/SendableBuilder.h"
13#include "wpi/sendable/SendableHelper.h"
14#include <hal/SimDevice.h>
26 public wpi::SendableHelper<CANrange>
38 hal::SimDevice m_simCANrange;
39 hal::SimDouble m_simSupplyVoltage;
40 hal::SimDouble m_simDistance;
41 hal::SimBoolean m_simIsDetected;
43 int32_t m_simPeriodicUid{-1};
44 std::vector<int32_t> m_simValueChangedUids;
46 static void OnValueChanged(
const char *name,
void *param, HAL_SimValueHandle handle,
47 HAL_Bool readonly,
const struct HAL_Value *value);
48 static void OnPeriodic(
void *param);
65 CANrange(
int deviceId, std::string canbus =
"");
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:656
Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front o...
Definition CANrange.hpp:27
CANrange(int deviceId, CANBus canbus)
Constructs a new CANrange object.
Definition CANrange.hpp:72
CANrange(int deviceId, std::string canbus="")
Constructs a new CANrange object.
void InitSendable(wpi::SendableBuilder &builder) override
Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front o...
Definition CoreCANrange.hpp:728
StatusSignal< bool > & GetIsDetected(bool refresh=true)
Whether the CANrange detects an object using the configured proximity parameters.
StatusSignal< units::length::meter_t > & GetDistance(bool refresh=true)
Distance to the nearest object in the configured field of view of the CANrange.
Definition MotionMagicExpoTorqueCurrentFOC.hpp:18