WPILibC++ 2024.3.2
SensorUtil.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7namespace frc {
8
9/**
10 * Stores most recent status information as well as containing utility functions
11 * for checking channels and error processing.
12 */
13class SensorUtil final {
14 public:
15 SensorUtil() = delete;
16
17 /**
18 * Get the number of the default solenoid module.
19 *
20 * @return The number of the default solenoid module.
21 */
23
24 /**
25 * Get the number of the default solenoid module.
26 *
27 * @return The number of the default solenoid module.
28 */
30
31 /**
32 * Check that the digital channel number is valid.
33 *
34 * Verify that the channel number is one of the legal channel numbers. Channel
35 * numbers are 0-based.
36 *
37 * @return Digital channel is valid
38 */
39 static bool CheckDigitalChannel(int channel);
40
41 /**
42 * Check that the relay channel number is valid.
43 *
44 * Verify that the channel number is one of the legal channel numbers. Channel
45 * numbers are 0-based.
46 *
47 * @return Relay channel is valid
48 */
49 static bool CheckRelayChannel(int channel);
50
51 /**
52 * Check that the digital channel number is valid.
53 *
54 * Verify that the channel number is one of the legal channel numbers. Channel
55 * numbers are 0-based.
56 *
57 * @return PWM channel is valid
58 */
59 static bool CheckPWMChannel(int channel);
60
61 /**
62 * Check that the analog input number is value.
63 *
64 * Verify that the analog input number is one of the legal channel numbers.
65 * Channel numbers are 0-based.
66 *
67 * @return Analog channel is valid
68 */
69 static bool CheckAnalogInputChannel(int channel);
70
71 /**
72 * Check that the analog output number is valid.
73 *
74 * Verify that the analog output number is one of the legal channel numbers.
75 * Channel numbers are 0-based.
76 *
77 * @return Analog channel is valid
78 */
79 static bool CheckAnalogOutputChannel(int channel);
80
81 static const int kDigitalChannels;
82 static const int kAnalogInputs;
83 static const int kAnalogOutputs;
84 static const int kPwmChannels;
85 static const int kRelayChannels;
86};
87
88} // namespace frc
Stores most recent status information as well as containing utility functions for checking channels a...
Definition: SensorUtil.h:13
static bool CheckRelayChannel(int channel)
Check that the relay channel number is valid.
static bool CheckPWMChannel(int channel)
Check that the digital channel number is valid.
SensorUtil()=delete
static const int kAnalogOutputs
Definition: SensorUtil.h:83
static bool CheckAnalogInputChannel(int channel)
Check that the analog input number is value.
static const int kPwmChannels
Definition: SensorUtil.h:84
static const int kAnalogInputs
Definition: SensorUtil.h:82
static const int kDigitalChannels
Definition: SensorUtil.h:81
static bool CheckDigitalChannel(int channel)
Check that the digital channel number is valid.
static int GetDefaultREVPHModule()
Get the number of the default solenoid module.
static const int kRelayChannels
Definition: SensorUtil.h:85
static int GetDefaultCTREPCMModule()
Get the number of the default solenoid module.
static bool CheckAnalogOutputChannel(int channel)
Check that the analog output number is valid.
Definition: AprilTagPoseEstimator.h:15