CTRE Phoenix 6 C++ 25.1.0
Loading...
Searching...
No Matches
CANrangeSimState.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
11#include <units/length.h>
12#include <units/voltage.h>
13
14namespace ctre {
15namespace phoenix6 {
16
17namespace hardware {
18namespace core {
19 /* forward proto */
20 class CoreCANrange;
21}
22}
23
24namespace sim {
25
26 /**
27 * \brief Class to control the state of a simulated hardware#CANrange.
28 */
30 {
31 private:
32 int _id;
33
34 public:
35 /**
36 * \brief Creates an object to control the state of the given hardware#CANrange.
37 *
38 * \details Note the recommended method of accessing simulation features is to
39 * use hardware#CANrange#GetSimState.
40 *
41 * \param device Device to which this simulation state is attached
42 */
44 /* disallow copy, allow move */
49
50 /**
51 * \brief Sets the simulated supply voltage of the CANrange.
52 *
53 * \details The minimum allowed supply voltage is 4 V - values below this
54 * will be promoted to 4 V.
55 *
56 * \param volts The supply voltage in Volts
57 * \returns Status code
58 */
59 ctre::phoenix::StatusCode SetSupplyVoltage(units::voltage::volt_t volts);
60 /**
61 * \brief Sets the simulated distance of the CANrange.
62 *
63 * \param meters The distance in meters
64 * \returns Status code
65 */
66 ctre::phoenix::StatusCode SetDistance(units::length::meter_t meters);
67 };
68}
69
70}
71}
Class for CANrange, a CAN based Time of Flight (ToF) sensor that measures the distance to the front o...
Definition CoreCANrange.hpp:728
Class to control the state of a simulated hardware::CANrange.
Definition CANrangeSimState.hpp:30
CANrangeSimState & operator=(CANrangeSimState &&)=default
CANrangeSimState(CANrangeSimState const &)=delete
CANrangeSimState(CANrangeSimState &&)=default
ctre::phoenix::StatusCode SetSupplyVoltage(units::voltage::volt_t volts)
Sets the simulated supply voltage of the CANrange.
ctre::phoenix::StatusCode SetDistance(units::length::meter_t meters)
Sets the simulated distance of the CANrange.
CANrangeSimState(hardware::core::CoreCANrange const &device)
Creates an object to control the state of the given hardware::CANrange.
CANrangeSimState & operator=(CANrangeSimState const &)=delete
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:27
Definition MotionMagicExpoTorqueCurrentFOC.hpp:18