CTRE Phoenix C++ 5.33.1
BasePigeonSimCollection.h
Go to the documentation of this file.
1/* Copyright (C) Cross The Road Electronics 2024 */
2#pragma once
3
6
7/* forward proto's */
8namespace ctre {
9 namespace phoenix {
10 namespace sensors {
11 class BasePigeon;
12 }
13 }
14}
15
16namespace ctre {
17 namespace phoenix {
18 namespace sensors {
19 /**
20 * Collection of simulation functions available to a Pigeon IMU.
21 * Use the getSimCollection() function in your BasePigeon object to create the respective sim collection.
22 */
24 public:
25 /**
26 * @param pigeon Pigeon IMU to connect so sim collection
27 */
29
30 /**
31 * Sets the simulated input heading position of the Pigeon IMU.
32 *
33 * The Pigeon IMU integrates the delta between each new raw heading value and uses
34 * this to calculate the true reported yaw and fused heading.
35 *
36 * When using the WPI Sim GUI, you will notice a readonly 'yaw' and
37 * settable 'RawHeading'. The readonly signal is the emulated yaw
38 * which will match self-test in Tuner and the hardware API. Changes to
39 * 'RawHeading' will be integrated into the emulated yaw. This way
40 * a simulator can modify the heading without overriding your
41 * hardware API calls for home-ing your sensor.
42 *
43 * Inputs to this function over time should be continuous,
44 * as user calls of setYaw() or setFusedHeading()
45 * will be accounted for in the calculation.
46 *
47 * @param newHeading the new input heading in degrees
48 *
49 * @return error code
50 */
51 ErrorCode SetRawHeading(double newHeading);
52
53 /**
54 * Adds to the simulated heading of the Pigeon IMU
55 *
56 * @param dHeading the change in heading in degrees
57 *
58 * @return error code
59 */
60 ErrorCode AddHeading(double dHeading);
61
62 private:
63 int _id;
64 ctre::phoenix::platform::DeviceType _type;
65 };
66 }
67 }
68}
Pigeon IMU Class.
Definition: BasePigeon.h:101
Collection of simulation functions available to a Pigeon IMU.
Definition: BasePigeonSimCollection.h:23
ErrorCode AddHeading(double dHeading)
Adds to the simulated heading of the Pigeon IMU.
BasePigeonSimCollection(ctre::phoenix::sensors::BasePigeon &pigeon, bool isRibbonCable)
ErrorCode SetRawHeading(double newHeading)
Sets the simulated input heading position of the Pigeon IMU.
ErrorCode
Definition: ErrorCode.h:13
namespace ctre
Definition: paramEnum.h:5