2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
auto.h
Go to the documentation of this file.
1
4
5#pragma once
6
7#include <frc/trajectory/TrapezoidProfile.h>
8#include <units/acceleration.h>
9#include <units/angle.h>
10#include <units/angular_acceleration.h>
11#include <units/angular_velocity.h>
12#include <units/length.h>
13#include <units/time.h>
14#include <units/velocity.h>
15
18
19namespace thresholds {
21 constexpr units::degree_t robotClimbPitch = 12_deg;
22 constexpr units::degree_t robotHitChargingStationPitch = 3_deg;
23 constexpr units::degree_t robotLeftChargingStationPitch = -2_deg;
24 constexpr units::degrees_per_second_t robotTippingPitchRate = -15_deg_per_s;
25} // namespace thresholds
26
27namespace timeouts {
29 constexpr units::second_t robotClimbStation = 5_s;
31 constexpr units::millisecond_t robotSlamCone = units::millisecond_t{1500};
32 namespace slam_grab {
33 constexpr auto afterDriveOver = units::millisecond_t{300};
34 namespace calbeProtector {
36 constexpr auto toGamePiece = units::millisecond_t{1500};
37 constexpr auto backToCharge = units::millisecond_t{1200};
38 } // namespace calbeProtector
39 } // namespace slam_grab
40} // namespace timeouts
41
42namespace place_positions {
74} // namespace place_positions
75
77 namespace blue_alliance {
93
111
122 } // namespace blue_alliance
136} // namespace starting_positions
137
139 namespace blue_alliance {
140
141 namespace fudges {
142 constexpr auto stationStageFudge = 10_in;
143 } // namespace fudges
144
153
158
163
172
173 // Center of robot when staging for dock, outside of the community
179
180 // * Interim waypoints for slam grab command(s)
181 namespace slam_grab {
182 namespace cableProtector {
184 constexpr auto angleToPickup = -35_deg;
191 } // namespace cableProtector
192 } // namespace slam_grab
193 } // namespace blue_alliance
194 namespace red_alliance {
203 static const auto approachSecondCube =
205 static const auto chargingStationStage =
209 namespace slam_grab {
219 } // namespace slam_grab
220 } // namespace red_alliance
221} // namespace interim_waypoints
222
224 namespace blue_alliance {
240 constexpr auto gamePiece3 = frc::Pose2d{{game_piece_pickup::blue_alliance::gamePiece3_3d.X() + 6_in,
242 1_deg};
249 } // namespace blue_alliance
256} // namespace game_piece_pickup
257
259 namespace translation {
260 static const auto loadingStationBackOut = frc::TrapezoidProfile<units::inches>::Constraints{4_fps, 8_fps_sq};
261 static const auto loadingStationReverseBackOut = frc::TrapezoidProfile<units::inches>::Constraints{8_fps, 8_fps_sq};
262 static const auto stageChargeStationPullIn = frc::TrapezoidProfile<units::inches>::Constraints{4_fps, 8_fps_sq};
263 static const auto loadingStationGridToGp0 = frc::TrapezoidProfile<units::inches>::Constraints{3_fps, 8_fps_sq};
264 static const auto gp0ToScore = frc::TrapezoidProfile<units::inches>::Constraints{6_fps, 10_fps_sq};
265 static const auto loadingStationPullIn = frc::TrapezoidProfile<units::inches>::Constraints{6.5_fps, 10_fps_sq};
266
267 static const auto cableProtectorBackOut = frc::TrapezoidProfile<units::inches>::Constraints{7_fps, 7_fps_sq};
268 static const auto cableProtectorBackOut2Gp = frc::TrapezoidProfile<units::inches>::Constraints{4.5_fps, 5_fps_sq};
269 static const auto cableProtectorSplineOut = frc::TrapezoidProfile<units::inches>::Constraints{7_fps, 6.5_fps_sq};
270 static const auto cableProtectorGridToGp3 = frc::TrapezoidProfile<units::inches>::Constraints{5_fps, 6_fps_sq};
271 static const auto gp3ToScore = frc::TrapezoidProfile<units::inches>::Constraints{4.5_fps, 5_fps_sq};
272 static const auto gp2ToScore = frc::TrapezoidProfile<units::inches>::Constraints{6_fps, 5_fps_sq};
273 static const auto cableProtectorPullIn = frc::TrapezoidProfile<units::inches>::Constraints{5_fps, 5_fps_sq};
274
275 static const auto loadingStationBackOut_3gp = frc::TrapezoidProfile<units::inches>::Constraints{7_fps, 8_fps_sq};
276 static const auto stageChargeStationPullIn_3gp = frc::TrapezoidProfile<units::inches>::Constraints{7_fps, 8_fps_sq};
277 static const auto loadingStationGridToGp0_3gp = frc::TrapezoidProfile<units::inches>::Constraints{7_fps, 8_fps_sq};
278 static const auto gp0ToScore_3gp = frc::TrapezoidProfile<units::inches>::Constraints{7_fps, 8_fps_sq};
279 static const auto loadingStationPullIn_3gp = frc::TrapezoidProfile<units::inches>::Constraints{7_fps, 8_fps_sq};
280 } // namespace translation
281 namespace rotation {
282 static const auto loadingStationBackOut =
283 frc::TrapezoidProfile<units::degrees>::Constraints{360_deg_per_s, 360_deg_per_s_sq};
285 frc::TrapezoidProfile<units::degrees>::Constraints{360_deg_per_s, 360_deg_per_s_sq};
286 static const auto stageChargeStationPullIn =
287 frc::TrapezoidProfile<units::degrees>::Constraints{360_deg_per_s, 360_deg_per_s_sq};
288 static const auto loadingStationGridToGp0 =
289 frc::TrapezoidProfile<units::degrees>::Constraints{360_deg_per_s, 360_deg_per_s_sq};
290 static const auto gp0ToScore = frc::TrapezoidProfile<units::degrees>::Constraints{360_deg_per_s, 360_deg_per_s_sq};
291 static const auto loadingStationPullIn =
292 frc::TrapezoidProfile<units::degrees>::Constraints{360_deg_per_s, 360_deg_per_s_sq};
293
294 static const auto cableProtectorBackOut =
295 frc::TrapezoidProfile<units::degrees>::Constraints{300_deg_per_s, 300_deg_per_s_sq};
296 static const auto cableProtectorSplineOut =
297 frc::TrapezoidProfile<units::degrees>::Constraints{300_deg_per_s, 300_deg_per_s_sq};
298 static const auto cableProtectorGridToGp3 =
299 frc::TrapezoidProfile<units::degrees>::Constraints{300_deg_per_s, 300_deg_per_s_sq};
300 static const auto cableProtectorPullIn =
301 frc::TrapezoidProfile<units::degrees>::Constraints{300_deg_per_s, 300_deg_per_s_sq};
302 static const auto gp3ToScore = frc::TrapezoidProfile<units::degrees>::Constraints{300_deg_per_s, 300_deg_per_s_sq};
303 static const auto gp2ToScore = frc::TrapezoidProfile<units::degrees>::Constraints{300_deg_per_s, 300_deg_per_s_sq};
304
305 static const auto loadingStationBackOut_3gp =
306 frc::TrapezoidProfile<units::degrees>::Constraints{360_deg_per_s, 360_deg_per_s_sq};
308 frc::TrapezoidProfile<units::degrees>::Constraints{360_deg_per_s, 360_deg_per_s_sq};
309 static const auto loadingStationGridToGp0_3gp =
310 frc::TrapezoidProfile<units::degrees>::Constraints{360_deg_per_s, 360_deg_per_s_sq};
311 static const auto gp0ToScore_3gp =
312 frc::TrapezoidProfile<units::degrees>::Constraints{360_deg_per_s, 360_deg_per_s_sq};
313 static const auto loadingStationPullIn_3gp =
314 frc::TrapezoidProfile<units::degrees>::Constraints{360_deg_per_s, 360_deg_per_s_sq};
315 } // namespace rotation
316} // namespace path_constraints
constexpr frc::Translation3d chargeStationCenter
Definition field_points.h:154
constexpr Node middleRowRight
Definition field_points.h:227
constexpr Node middleRowLeft
Definition field_points.h:219
constexpr auto gp_1
Definition field_points.h:148
constexpr auto gp_3
Definition field_points.h:150
constexpr auto gp_0
Definition field_points.h:147
constexpr auto gp_2
Definition field_points.h:149
constexpr Node middleRowMiddle
Definition field_points.h:188
constexpr Node middleRowLeft
Definition field_points.h:184
constexpr Node middleRowRight
Definition field_points.h:263
constexpr Node topRowMiddle
Definition field_points.h:246
constexpr Node topRowRight
Definition field_points.h:250
constexpr units::inch_t outerEdgeX
Side closest to the game pieces.
Definition field_points.h:140
constexpr auto gridDepth
Distance from alliance station wall to end of grid dividers.
Definition field_points.h:112
constexpr auto gamePiece0
Definition auto.h:231
constexpr auto gamePiece3
Definition auto.h:240
constexpr auto gamePiece3_3d
Definition auto.h:228
constexpr auto gamePiece1_3gp_3d
Definition auto.h:234
constexpr auto gamePiece0_3d
Definition auto.h:225
constexpr auto gamePiece2
Definition auto.h:246
constexpr auto gamePiece1_3gp
Definition auto.h:237
constexpr auto gamePiece2_3d
Definition auto.h:243
static const auto gamePiece2
Definition auto.h:253
static const auto gamePiece3
Definition auto.h:254
static const auto gamePiece1_3gp
Definition auto.h:252
static const auto gamePiece0
Definition auto.h:251
Definition auto.h:223
constexpr auto stationStageFudge
Definition auto.h:142
constexpr auto afterDriveOverCharge
Expected position after driving over charge station. Assume robot yaw is 0° and oui oui is on robot l...
Definition auto.h:186
constexpr auto angleToPickup
Angle from after charge station to picking up game piece.
Definition auto.h:184
constexpr auto backAwayFromCableProtectorCone
Definition auto.h:149
constexpr auto chargingStationStage
Definition auto.h:174
constexpr auto backAwayFromLoadingStationCone
Definition auto.h:145
constexpr auto backAwayFromLoadingStationCube
Definition auto.h:159
constexpr auto backAwayFromCableProtectorConeReverse
Definition auto.h:164
constexpr auto approachSecondCube
Definition auto.h:168
constexpr auto backAwayFromLoadingStationConeReverse
Definition auto.h:154
static const auto angleToPickup
Angle from after charge station to picking up game piece.
Definition auto.h:212
static const auto afterDriveOverCharge
Expected position after driving over charge station. Assume robot yaw is 0° and oui oui is on robot l...
Definition auto.h:215
static const auto backAwayFromLoadingStationConeReverse
Definition auto.h:201
static const auto backAwayFromCableProtectorCone
Definition auto.h:197
static const auto backAwayFromLoadingStationCone
Definition auto.h:195
static const auto backAwayFromCableProtectorConeReverse
Definition auto.h:207
static const auto backAwayFromLoadingStationCube
Definition auto.h:199
static const auto chargingStationStage
Definition auto.h:205
static const auto approachSecondCube
Definition auto.h:203
Definition auto.h:138
constexpr units::inch_t length
Definition measure_up.h:20
constexpr auto lateralOffset
Definition measure_up.h:78
constexpr auto bumperExtension
Distance from frame to outer edge of bumpers.
Definition measure_up.h:17
static const auto gp3ToScore
Definition auto.h:302
static const auto cableProtectorGridToGp3
Definition auto.h:298
static const auto gp0ToScore
Definition auto.h:290
static const auto loadingStationGridToGp0_3gp
Definition auto.h:309
static const auto cableProtectorSplineOut
Definition auto.h:296
static const auto gp2ToScore
Definition auto.h:303
static const auto stageChargeStationPullIn
Definition auto.h:286
static const auto loadingStationBackOut_3gp
Definition auto.h:305
static const auto loadingStationPullIn
Definition auto.h:291
static const auto loadingStationBackOut
Definition auto.h:282
static const auto loadingStationReverseBackOut
Definition auto.h:284
static const auto loadingStationGridToGp0
Definition auto.h:288
static const auto cableProtectorPullIn
Definition auto.h:300
static const auto gp0ToScore_3gp
Definition auto.h:311
static const auto stageChargeStationPullIn_3gp
Definition auto.h:307
static const auto loadingStationPullIn_3gp
Definition auto.h:313
static const auto cableProtectorBackOut
Definition auto.h:294
static const auto loadingStationBackOut_3gp
Definition auto.h:275
static const auto cableProtectorBackOut2Gp
Definition auto.h:268
static const auto gp0ToScore_3gp
Definition auto.h:278
static const auto cableProtectorPullIn
Definition auto.h:273
static const auto loadingStationReverseBackOut
Definition auto.h:261
static const auto loadingStationPullIn
Definition auto.h:265
static const auto stageChargeStationPullIn
Definition auto.h:262
static const auto gp3ToScore
Definition auto.h:271
static const auto cableProtectorGridToGp3
Definition auto.h:270
static const auto loadingStationPullIn_3gp
Definition auto.h:279
static const auto gp2ToScore
Definition auto.h:272
static const auto loadingStationGridToGp0_3gp
Definition auto.h:277
static const auto loadingStationBackOut
Definition auto.h:260
static const auto gp0ToScore
Definition auto.h:264
static const auto cableProtectorSplineOut
Definition auto.h:269
static const auto loadingStationGridToGp0
Definition auto.h:263
static const auto cableProtectorBackOut
Definition auto.h:267
static const auto stageChargeStationPullIn_3gp
Definition auto.h:276
Definition auto.h:258
constexpr auto cableProtectorShoot3d
Definition auto.h:59
constexpr auto loadingStationCube3d
Definition auto.h:44
constexpr auto cableProtectorCube3d
Definition auto.h:51
constexpr auto cableProtectorShoot
Definition auto.h:63
constexpr auto loadingStationCube
Definition auto.h:48
constexpr auto cableProtectorCube
Definition auto.h:55
static const auto cableProtectorCube
Definition auto.h:70
static const auto loadingStationCube
Definition auto.h:69
static const auto cableProtectorShoot
Definition auto.h:71
Definition auto.h:42
constexpr auto cableProtectorCone3d
Definition auto.h:94
constexpr auto loadingStationConeReverse3d
Definition auto.h:101
constexpr auto cableProtectorSlamGrab3d
Definition auto.h:78
constexpr auto loadingStationCone3d
Definition auto.h:82
constexpr auto cableProtectorCone
Definition auto.h:98
constexpr auto cableProtectorConeReverse3d
Definition auto.h:112
constexpr auto loadingStationCone
Definition auto.h:86
constexpr auto cableProtectorSlamGrab
Definition auto.h:89
constexpr auto cableProtectorConeReverse
Definition auto.h:118
constexpr auto loadingStationConeReverse
Definition auto.h:107
static const auto loadingStationCone
Definition auto.h:127
static const auto cableProtectorCone
Definition auto.h:129
static const auto cableProtectorConeReverse
Definition auto.h:133
static const auto cableProtectorSlamGrab
Definition auto.h:124
static const auto loadingStationConeReverse
Definition auto.h:131
Definition auto.h:76
Definition auto.h:19
constexpr units::degree_t robotLeftChargingStationPitch
Definition auto.h:23
constexpr units::degree_t robotHitChargingStationPitch
Definition auto.h:22
constexpr units::degrees_per_second_t robotTippingPitchRate
Definition auto.h:24
constexpr units::degree_t robotClimbPitch
Target pitch to reach when climbing up the charge station.
Definition auto.h:21
constexpr auto backToCharge
Definition auto.h:37
constexpr auto toGamePiece
Time to travel from charge station to game piece on left slam grab.
Definition auto.h:36
constexpr auto afterDriveOver
Definition auto.h:33
Definition auto.h:27
constexpr units::second_t robotClimbStation
The amount of time to wait before robot should abort trying to achieve target pitch on charge station...
Definition auto.h:29
constexpr units::millisecond_t robotSlamCone
The max ammount of time the robot is allowed to talk while slamming a cone using the oui oui placer.
Definition auto.h:31
constexpr units::angle::degree_t ReflectAngle(const units::angle::degree_t sourceAngle)
Definition field_points.h:71
constexpr frc::Translation3d ReflectFieldPoint(const frc::Translation3d source)
Reflects the point source over the middle of the field to get equivelent points accross the field.
Definition field_points.h:63
frc::Translation3d m_position
Definition field_points.h:48