REVLib - C++
DetachedEncoderLowLevel.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025-2026 REV Robotics
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 3. Neither the name of REV Robotics nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#pragma once
30
31namespace rev::detached {
32
34public:
39
46 int GetDeviceId() const;
47
48 enum class EncoderModel {
49 kUnknown = 0,
51 };
52
60
62 int year;
63 int minor;
64 int fix;
68 };
69
76
79 };
80
88
100 };
101
109
111 float rawAngle;
112 float angle;
113 };
114
122
124 float position;
125 };
126
134
136 float velocity;
137 };
138
146
151
152protected:
153 explicit DetachedEncoderLowLevel(int deviceID, EncoderModel model);
154
155 // Opaque pointer to underlying driver.
157
158private:
159 int m_deviceID;
160};
161
162} // namespace rev::detached
Definition: DetachedEncoderLowLevel.h:33
PeriodicStatus3 GetPeriodicStatus3() const
Definition: DetachedEncoderLowLevel.cpp:153
void * m_detachedEncoderHandle
Definition: DetachedEncoderLowLevel.h:156
EncoderModel GetEncoderModel() const
Definition: DetachedEncoderLowLevel.cpp:80
PeriodicStatus2 GetPeriodicStatus2() const
Definition: DetachedEncoderLowLevel.cpp:140
DetachedEncoderLowLevel(int deviceID, EncoderModel model)
Definition: DetachedEncoderLowLevel.cpp:37
PeriodicStatus1 GetPeriodicStatus1() const
Definition: DetachedEncoderLowLevel.cpp:118
PeriodicStatus0 GetPeriodicStatus0() const
Definition: DetachedEncoderLowLevel.cpp:106
PeriodicStatus4 GetPeriodicStatus4() const
Definition: DetachedEncoderLowLevel.cpp:165
EncoderModel
Definition: DetachedEncoderLowLevel.h:48
void CreateSimFaultManager()
Definition: DetachedEncoderLowLevel.cpp:176
FirmwareVersion GetFirmwareVersion() const
Definition: DetachedEncoderLowLevel.cpp:89
int GetDeviceId() const
Definition: DetachedEncoderLowLevel.cpp:78
virtual ~DetachedEncoderLowLevel()
Definition: DetachedEncoderLowLevel.cpp:73
Definition: ClosedLoopConfig.h:38
Definition: DetachedEncoderLowLevel.h:61
int hardwareMinor
Definition: DetachedEncoderLowLevel.h:67
int year
Definition: DetachedEncoderLowLevel.h:62
int fix
Definition: DetachedEncoderLowLevel.h:64
int hardwareMajor
Definition: DetachedEncoderLowLevel.h:66
int minor
Definition: DetachedEncoderLowLevel.h:63
int prerelease
Definition: DetachedEncoderLowLevel.h:65
Definition: DetachedEncoderLowLevel.h:77
EncoderModel model
Definition: DetachedEncoderLowLevel.h:78
Definition: DetachedEncoderLowLevel.h:89
bool canTxFault
Definition: DetachedEncoderLowLevel.h:92
bool stickyHasResetFault
Definition: DetachedEncoderLowLevel.h:96
bool stickyUnexpectedFault
Definition: DetachedEncoderLowLevel.h:95
bool hasResetFault
Definition: DetachedEncoderLowLevel.h:91
bool stickyCanRxFault
Definition: DetachedEncoderLowLevel.h:98
bool unexpectedFault
Definition: DetachedEncoderLowLevel.h:90
bool canRxFault
Definition: DetachedEncoderLowLevel.h:93
bool stickyEepromFault
Definition: DetachedEncoderLowLevel.h:99
bool eepromFault
Definition: DetachedEncoderLowLevel.h:94
bool stickyCanTxFault
Definition: DetachedEncoderLowLevel.h:97
Definition: DetachedEncoderLowLevel.h:110
float rawAngle
Definition: DetachedEncoderLowLevel.h:111
float angle
Definition: DetachedEncoderLowLevel.h:112
Definition: DetachedEncoderLowLevel.h:123
float position
Definition: DetachedEncoderLowLevel.h:124
Definition: DetachedEncoderLowLevel.h:135
float velocity
Definition: DetachedEncoderLowLevel.h:136