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<CANrange>
43 hal::SimDevice m_simCANrange;
44 hal::SimDouble m_simSupplyVoltage;
45 hal::SimDouble m_simDistance;
46 hal::SimBoolean m_simIsDetected;
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 CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front o...
Definition CANrange.hpp:32
CANrange(int deviceId, std::string canbus)
Constructs a new CANrange object.
void InitSendable(wpi::SendableBuilder &builder) override
CANrange(int deviceId, CANBus canbus={})
Constructs a new CANrange object.
Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front o...
Definition CoreCANrange.hpp:735
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 motor_constants.h:14