2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1
4
5#pragma once
6
7#include <frc/geometry/Translation2d.h>
8#include <units/angle.h>
9#include <units/angular_velocity.h>
10#include <units/length.h>
11#include <units/time.h>
12
13#include <vector>
14
15#include "utils/custom_units.h"
16
17namespace path_planning {
18
19 struct ArmPathPoint {
20 constexpr ArmPathPoint() = default;
21 constexpr ArmPathPoint(units::inch_t x, units::inch_t z) : x(x), z(z) {}
22 constexpr explicit ArmPathPoint(const frc::Translation2d& other) : x(other.X()), z(other.Y()) {}
23 units::inch_t x;
24 units::inch_t z;
25 };
26
31
35 units::inch_t path1Distance;
36 };
37
39 units::velocity::inches_per_second_t v;
40 units::velocity::inches_per_second_t v_x;
41 units::velocity::inches_per_second_t v_z;
42 };
43
45 units::velocity::inches_per_second_t v_radial;
46 units::degrees_per_second_t v_tangential;
47 };
48
49 template <typename PositionType, typename VelocityType>
51 units::millisecond_t time;
52 PositionType position;
53 VelocityType velocity;
54 };
55
59
60 using ShoulderPoint = units::degree_t;
61 using ExtensionPoint = units::inch_t;
62 using BashGuardPoint = units::inch_t;
63
64 using Polygon = std::vector<ArmPathPoint>;
65 using ArmPath = std::vector<ArmPathPoint>;
66 using ShoulderPath = std::vector<ShoulderPoint>;
67 using ExtensionPath = std::vector<ExtensionPoint>;
68 using BashGuardPath = std::vector<BashGuardPoint>;
69
73
74 using ArmMPPath = std::vector<ArmMPPathPoint>;
75 using ShoulderMPPath = std::vector<ShoulderMPPathPoint>;
76 using ExtensionMPPath = std::vector<ExtensionMPPathPoint>;
77 using BashGuardMPPath = std::vector<BashGuardMPPathPoint>;
78
85
87 units::velocity::inches_per_second_t maxVelocity;
88 units::acceleration::inches_per_second_squared_t maxAcceleration;
89 };
90
95
96} // namespace path_planning
Definition convert_path.h:16
std::vector< ArmPathPoint > Polygon
Definition types.h:64
units::inch_t ExtensionPoint
Definition types.h:61
std::vector< ShoulderPoint > ShoulderPath
Definition types.h:66
GenericMPPathPoint< units::degree_t, units::degrees_per_second_t > AngularMPPathPoint
Definition types.h:57
std::vector< BashGuardPoint > BashGuardPath
Definition types.h:68
std::vector< ExtensionMPPathPoint > ExtensionMPPath
Definition types.h:76
std::vector< BashGuardMPPathPoint > BashGuardMPPath
Definition types.h:77
std::vector< ExtensionPoint > ExtensionPath
Definition types.h:67
units::inch_t BashGuardPoint
Definition types.h:62
std::vector< ArmPathPoint > ArmPath
Definition types.h:65
units::degree_t ShoulderPoint
Definition types.h:60
std::vector< ShoulderMPPathPoint > ShoulderMPPath
Definition types.h:75
std::vector< ArmMPPathPoint > ArmMPPath
Definition types.h:74
GenericMPPathPoint< units::inch_t, units::velocity::inches_per_second_t > LinearMPPathPoint
Definition types.h:58
PathDynamicsConstraints bashGuardConstraints
Definition types.h:93
PathDynamicsConstraints armConstraints
Definition types.h:92
Definition types.h:19
units::inch_t x
Definition types.h:23
constexpr ArmPathPoint(const frc::Translation2d &other)
Definition types.h:22
units::inch_t z
Definition types.h:24
constexpr ArmPathPoint()=default
constexpr ArmPathPoint(units::inch_t x, units::inch_t z)
Definition types.h:21
Definition types.h:38
units::velocity::inches_per_second_t v_x
Definition types.h:40
units::velocity::inches_per_second_t v_z
Definition types.h:41
units::velocity::inches_per_second_t v
Definition types.h:39
Definition types.h:79
BashGuardMPPath bashGuardPath
Definition types.h:83
ShoulderMPPath shoulderPath
Definition types.h:81
std::chrono::time_point< std::chrono::steady_clock > startTime
Definition types.h:80
ExtensionMPPath extensionPath
Definition types.h:82
PositionType position
Definition types.h:52
VelocityType velocity
Definition types.h:53
units::millisecond_t time
Definition types.h:51
Definition types.h:27
ArmPathPoint end
Definition types.h:29
ArmPathPoint start
Definition types.h:28
units::velocity::inches_per_second_t maxVelocity
Definition types.h:87
units::acceleration::inches_per_second_squared_t maxAcceleration
Definition types.h:88
Definition types.h:32
size_t path1SegmentIndex
Definition types.h:33
size_t path2SegmentIndex
Definition types.h:34
units::inch_t path1Distance
Definition types.h:35
units::degrees_per_second_t v_tangential
Definition types.h:46
units::velocity::inches_per_second_t v_radial
Definition types.h:45