CTRE Phoenix Pro C++ 23.0.12
Pigeon2SimState.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
11#include <units/angle.h>
12#include <units/voltage.h>
13
14namespace ctre {
15namespace phoenixpro {
16
17namespace hardware {
18namespace core {
19 /* forward proto */
20 class CorePigeon2;
21}
22}
23
24namespace sim {
25
26 /**
27 * \brief Class to control the state of a simulated hardware#Pigeon2.
28 */
30 {
31 private:
32 int _id;
33
34 public:
35 /**
36 * \brief Creates an object to control the state of the given hardware#Pigeon2.
37 *
38 * \param device
39 * Device to which this simulation state is attached
40 */
42 /* disallow copy, allow move */
47
48 /**
49 * \brief Sets the simulated supply voltage of the Pigeon2.
50 *
51 * \details The minimum allowed supply voltage is 4 V - values below this
52 * will be promoted to 4 V.
53 *
54 * \param volts
55 * The supply voltage in Volts
56 * \returns Status code
57 */
58 ctre::phoenix::StatusCode SetSupplyVoltage(units::voltage::volt_t volts);
59 /**
60 * \brief Sets the simulated raw yaw of the Pigeon2.
61 *
62 * Inputs to this function over time should be continuous, as user calls of hardware#Pigeon2#SetYaw will be accounted for in the callee.
63 *
64 * \details The Pigeon2 integrates this to calculate the true reported yaw.
65 *
66 * When using the WPI Sim GUI, you will notice a readonly `yaw` and settable `rawYawInput`.
67 * The readonly signal is the emulated yaw which will match self-test in Tuner and the hardware API.
68 * Changes to `rawYawInput` will be integrated into the emulated yaw.
69 * This way a simulator can modify the yaw without overriding hardware API calls for home-ing the sensor.
70 *
71 * \param deg
72 * The yaw in degrees
73 * \returns Status code
74 */
75 ctre::phoenix::StatusCode SetRawYaw(units::angle::degree_t deg);
76 /**
77 * \brief Sets the simulated pitch of the Pigeon2.
78 *
79 * \param deg
80 * The pitch in degrees
81 * \returns Status code
82 */
83 ctre::phoenix::StatusCode SetPitch(units::angle::degree_t deg);
84 /**
85 * \brief Sets the simulated roll of the Pigeon2.
86 *
87 * \param deg
88 * The roll in degrees
89 * \returns Status code
90 */
91 ctre::phoenix::StatusCode SetRoll(units::angle::degree_t deg);
92 };
93
94}
95
96}
97}
Class description for the Pigeon 2 IMU sensor that measures orientation.
Definition: CorePigeon2.hpp:477
Class to control the state of a simulated hardware::Pigeon2.
Definition: Pigeon2SimState.hpp:30
ctre::phoenix::StatusCode SetRawYaw(units::angle::degree_t deg)
Sets the simulated raw yaw of the Pigeon2.
Pigeon2SimState & operator=(Pigeon2SimState const &)=delete
ctre::phoenix::StatusCode SetPitch(units::angle::degree_t deg)
Sets the simulated pitch of the Pigeon2.
Pigeon2SimState(hardware::core::CorePigeon2 const &device)
Creates an object to control the state of the given hardware::Pigeon2.
ctre::phoenix::StatusCode SetRoll(units::angle::degree_t deg)
Sets the simulated roll of the Pigeon2.
Pigeon2SimState & operator=(Pigeon2SimState &&)=default
ctre::phoenix::StatusCode SetSupplyVoltage(units::voltage::volt_t volts)
Sets the simulated supply voltage of the Pigeon2.
Pigeon2SimState(Pigeon2SimState &&)=default
Pigeon2SimState(Pigeon2SimState const &)=delete
Definition: string_util.hpp:14