CTRE Phoenix 6 C++ 26.0.0-beta-1
Loading...
Searching...
No Matches
MountPoseConfigs.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 for Pigeon 2's Mount Pose configuration.
20 *
21 * \details These configs allow the Pigeon2 to be mounted in whatever
22 * orientation that's desired and ensure the reported
23 * Yaw/Pitch/Roll is from the robot's reference.
24 */
26public:
27 constexpr MountPoseConfigs() = default;
28
29 /**
30 * \brief The mounting calibration yaw-component.
31 *
32 * - Minimum Value: -360
33 * - Maximum Value: 360
34 * - Default Value: 0
35 * - Units: deg
36 */
37 units::angle::degree_t MountPoseYaw = 0_deg;
38 /**
39 * \brief The mounting calibration pitch-component.
40 *
41 * - Minimum Value: -360
42 * - Maximum Value: 360
43 * - Default Value: 0
44 * - Units: deg
45 */
46 units::angle::degree_t MountPosePitch = 0_deg;
47 /**
48 * \brief The mounting calibration roll-component.
49 *
50 * - Minimum Value: -360
51 * - Maximum Value: 360
52 * - Default Value: 0
53 * - Units: deg
54 */
55 units::angle::degree_t MountPoseRoll = 0_deg;
56
57 /**
58 * \brief Modifies this configuration's MountPoseYaw parameter and returns itself for
59 * method-chaining and easier to use config API.
60 *
61 * The mounting calibration yaw-component.
62 *
63 * - Minimum Value: -360
64 * - Maximum Value: 360
65 * - Default Value: 0
66 * - Units: deg
67 *
68 * \param newMountPoseYaw Parameter to modify
69 * \returns Itself
70 */
71 constexpr MountPoseConfigs &WithMountPoseYaw(units::angle::degree_t newMountPoseYaw)
72 {
73 MountPoseYaw = std::move(newMountPoseYaw);
74 return *this;
75 }
76
77 /**
78 * \brief Modifies this configuration's MountPosePitch parameter and returns itself for
79 * method-chaining and easier to use config API.
80 *
81 * The mounting calibration pitch-component.
82 *
83 * - Minimum Value: -360
84 * - Maximum Value: 360
85 * - Default Value: 0
86 * - Units: deg
87 *
88 * \param newMountPosePitch Parameter to modify
89 * \returns Itself
90 */
91 constexpr MountPoseConfigs &WithMountPosePitch(units::angle::degree_t newMountPosePitch)
92 {
93 MountPosePitch = std::move(newMountPosePitch);
94 return *this;
95 }
96
97 /**
98 * \brief Modifies this configuration's MountPoseRoll parameter and returns itself for
99 * method-chaining and easier to use config API.
100 *
101 * The mounting calibration roll-component.
102 *
103 * - Minimum Value: -360
104 * - Maximum Value: 360
105 * - Default Value: 0
106 * - Units: deg
107 *
108 * \param newMountPoseRoll Parameter to modify
109 * \returns Itself
110 */
111 constexpr MountPoseConfigs &WithMountPoseRoll(units::angle::degree_t newMountPoseRoll)
112 {
113 MountPoseRoll = std::move(newMountPoseRoll);
114 return *this;
115 }
116
117
118
119 std::string ToString() const override;
120
121 std::string Serialize() const final;
122 ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final;
123};
124
125}
126}
127}
Configs for Pigeon 2's Mount Pose configuration.
Definition MountPoseConfigs.hpp:25
constexpr MountPoseConfigs & WithMountPoseRoll(units::angle::degree_t newMountPoseRoll)
Modifies this configuration's MountPoseRoll parameter and returns itself for method-chaining and easi...
Definition MountPoseConfigs.hpp:111
constexpr MountPoseConfigs & WithMountPoseYaw(units::angle::degree_t newMountPoseYaw)
Modifies this configuration's MountPoseYaw parameter and returns itself for method-chaining and easie...
Definition MountPoseConfigs.hpp:71
units::angle::degree_t MountPoseRoll
The mounting calibration roll-component.
Definition MountPoseConfigs.hpp:55
units::angle::degree_t MountPosePitch
The mounting calibration pitch-component.
Definition MountPoseConfigs.hpp:46
std::string Serialize() const final
std::string ToString() const override
constexpr MountPoseConfigs & WithMountPosePitch(units::angle::degree_t newMountPosePitch)
Modifies this configuration's MountPosePitch parameter and returns itself for method-chaining and eas...
Definition MountPoseConfigs.hpp:91
ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final
units::angle::degree_t MountPoseYaw
The mounting calibration yaw-component.
Definition MountPoseConfigs.hpp:37
Definition Configuration.hpp:17
Definition motor_constants.h:14