CTRE Phoenix 6 C++ 26.0.0-beta-1
Loading...
Searching...
No Matches
FovParamsConfigs.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
10#include <units/angle.h>
11
12namespace ctre {
13namespace phoenix6 {
14
15
16namespace configs {
17
18/**
19 * \brief Configs that affect the ToF Field of View
20 *
21 * \details Includes range and center configs
22 */
24public:
25 constexpr FovParamsConfigs() = default;
26
27 /**
28 * \brief Specifies the target center of the Field of View in the X
29 * direction.
30 *
31 * \details The exact value may be different for different CANrange
32 * devices due to imperfections in the sensing silicon.
33 *
34 * - Minimum Value: -11.8
35 * - Maximum Value: 11.8
36 * - Default Value: 0
37 * - Units: deg
38 */
39 units::angle::degree_t FOVCenterX = 0_deg;
40 /**
41 * \brief Specifies the target center of the Field of View in the Y
42 * direction.
43 *
44 * \details The exact value may be different for different CANrange
45 * devices due to imperfections in the sensing silicon.
46 *
47 * - Minimum Value: -11.8
48 * - Maximum Value: 11.8
49 * - Default Value: 0
50 * - Units: deg
51 */
52 units::angle::degree_t FOVCenterY = 0_deg;
53 /**
54 * \brief Specifies the target range of the Field of View in the X
55 * direction. This is the full range of the FOV.
56 *
57 * The magnitude of this is capped to abs(27 - 2*FOVCenterX).
58 *
59 * \details The exact value may be different for different CANrange
60 * devices due to imperfections in the sensing silicon.
61 *
62 * - Minimum Value: 6.75
63 * - Maximum Value: 27
64 * - Default Value: 27
65 * - Units: deg
66 */
67 units::angle::degree_t FOVRangeX = 27_deg;
68 /**
69 * \brief Specifies the target range of the Field of View in the Y
70 * direction. This is the full range of the FOV.
71 *
72 * The magnitude of this is capped to abs(27 - 2*FOVCenterY).
73 *
74 * \details The exact value may be different for different CANrange
75 * devices due to imperfections in the sensing silicon.
76 *
77 * - Minimum Value: 6.75
78 * - Maximum Value: 27
79 * - Default Value: 27
80 * - Units: deg
81 */
82 units::angle::degree_t FOVRangeY = 27_deg;
83
84 /**
85 * \brief Modifies this configuration's FOVCenterX parameter and returns itself for
86 * method-chaining and easier to use config API.
87 *
88 * Specifies the target center of the Field of View in the X
89 * direction.
90 *
91 * \details The exact value may be different for different CANrange
92 * devices due to imperfections in the sensing silicon.
93 *
94 * - Minimum Value: -11.8
95 * - Maximum Value: 11.8
96 * - Default Value: 0
97 * - Units: deg
98 *
99 * \param newFOVCenterX Parameter to modify
100 * \returns Itself
101 */
102 constexpr FovParamsConfigs &WithFOVCenterX(units::angle::degree_t newFOVCenterX)
103 {
104 FOVCenterX = std::move(newFOVCenterX);
105 return *this;
106 }
107
108 /**
109 * \brief Modifies this configuration's FOVCenterY parameter and returns itself for
110 * method-chaining and easier to use config API.
111 *
112 * Specifies the target center of the Field of View in the Y
113 * direction.
114 *
115 * \details The exact value may be different for different CANrange
116 * devices due to imperfections in the sensing silicon.
117 *
118 * - Minimum Value: -11.8
119 * - Maximum Value: 11.8
120 * - Default Value: 0
121 * - Units: deg
122 *
123 * \param newFOVCenterY Parameter to modify
124 * \returns Itself
125 */
126 constexpr FovParamsConfigs &WithFOVCenterY(units::angle::degree_t newFOVCenterY)
127 {
128 FOVCenterY = std::move(newFOVCenterY);
129 return *this;
130 }
131
132 /**
133 * \brief Modifies this configuration's FOVRangeX parameter and returns itself for
134 * method-chaining and easier to use config API.
135 *
136 * Specifies the target range of the Field of View in the X direction.
137 * This is the full range of the FOV.
138 *
139 * The magnitude of this is capped to abs(27 - 2*FOVCenterX).
140 *
141 * \details The exact value may be different for different CANrange
142 * devices due to imperfections in the sensing silicon.
143 *
144 * - Minimum Value: 6.75
145 * - Maximum Value: 27
146 * - Default Value: 27
147 * - Units: deg
148 *
149 * \param newFOVRangeX Parameter to modify
150 * \returns Itself
151 */
152 constexpr FovParamsConfigs &WithFOVRangeX(units::angle::degree_t newFOVRangeX)
153 {
154 FOVRangeX = std::move(newFOVRangeX);
155 return *this;
156 }
157
158 /**
159 * \brief Modifies this configuration's FOVRangeY parameter and returns itself for
160 * method-chaining and easier to use config API.
161 *
162 * Specifies the target range of the Field of View in the Y direction.
163 * This is the full range of the FOV.
164 *
165 * The magnitude of this is capped to abs(27 - 2*FOVCenterY).
166 *
167 * \details The exact value may be different for different CANrange
168 * devices due to imperfections in the sensing silicon.
169 *
170 * - Minimum Value: 6.75
171 * - Maximum Value: 27
172 * - Default Value: 27
173 * - Units: deg
174 *
175 * \param newFOVRangeY Parameter to modify
176 * \returns Itself
177 */
178 constexpr FovParamsConfigs &WithFOVRangeY(units::angle::degree_t newFOVRangeY)
179 {
180 FOVRangeY = std::move(newFOVRangeY);
181 return *this;
182 }
183
184
185
186 std::string ToString() const override;
187
188 std::string Serialize() const final;
189 ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final;
190};
191
192}
193}
194}
Configs that affect the ToF Field of View.
Definition FovParamsConfigs.hpp:23
constexpr FovParamsConfigs & WithFOVRangeX(units::angle::degree_t newFOVRangeX)
Modifies this configuration's FOVRangeX parameter and returns itself for method-chaining and easier t...
Definition FovParamsConfigs.hpp:152
std::string Serialize() const final
std::string ToString() const override
units::angle::degree_t FOVCenterY
Specifies the target center of the Field of View in the Y direction.
Definition FovParamsConfigs.hpp:52
constexpr FovParamsConfigs & WithFOVRangeY(units::angle::degree_t newFOVRangeY)
Modifies this configuration's FOVRangeY parameter and returns itself for method-chaining and easier t...
Definition FovParamsConfigs.hpp:178
units::angle::degree_t FOVRangeX
Specifies the target range of the Field of View in the X direction.
Definition FovParamsConfigs.hpp:67
constexpr FovParamsConfigs & WithFOVCenterX(units::angle::degree_t newFOVCenterX)
Modifies this configuration's FOVCenterX parameter and returns itself for method-chaining and easier ...
Definition FovParamsConfigs.hpp:102
ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final
units::angle::degree_t FOVCenterX
Specifies the target center of the Field of View in the X direction.
Definition FovParamsConfigs.hpp:39
constexpr FovParamsConfigs & WithFOVCenterY(units::angle::degree_t newFOVCenterY)
Modifies this configuration's FOVCenterY parameter and returns itself for method-chaining and easier ...
Definition FovParamsConfigs.hpp:126
units::angle::degree_t FOVRangeY
Specifies the target range of the Field of View in the Y direction.
Definition FovParamsConfigs.hpp:82
Definition Configuration.hpp:17
Definition motor_constants.h:14