WPILibC++ 2025.0.0-alpha-1-9-ga2beb75
ADIS16448_IMUSim.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <hal/SimDevice.h>
9#include <units/angle.h>
11
12namespace frc {
13
14class ADIS16448_IMU;
15
16namespace sim {
17
18/**
19 * Class to control a simulated ADIS16448 IMU.
20 */
22 public:
23 /**
24 * Constructs from a ADIS16448_IMU object.
25 *
26 * @param imu ADIS16448_IMU to simulate
27 */
28 explicit ADIS16448_IMUSim(const ADIS16448_IMU& imu);
29
30 /**
31 * Sets the X axis angle (CCW positive).
32 *
33 * @param angle The angle.
34 */
35 void SetGyroAngleX(units::degree_t angle);
36
37 /**
38 * Sets the Y axis angle (CCW positive).
39 *
40 * @param angle The angle.
41 */
42 void SetGyroAngleY(units::degree_t angle);
43
44 /**
45 * Sets the Z axis angle (CCW positive).
46 *
47 * @param angle The angle.
48 */
49 void SetGyroAngleZ(units::degree_t angle);
50
51 /**
52 * Sets the X axis angular rate (CCW positive).
53 *
54 * @param angularRate The angular rate.
55 */
56 void SetGyroRateX(units::degrees_per_second_t angularRate);
57
58 /**
59 * Sets the Y axis angular rate (CCW positive).
60 *
61 * @param angularRate The angular rate.
62 */
63 void SetGyroRateY(units::degrees_per_second_t angularRate);
64
65 /**
66 * Sets the Z axis angular rate (CCW positive).
67 *
68 * @param angularRate The angular rate.
69 */
70 void SetGyroRateZ(units::degrees_per_second_t angularRate);
71
72 /**
73 * Sets the X axis acceleration.
74 *
75 * @param accel The acceleration.
76 */
77 void SetAccelX(units::meters_per_second_squared_t accel);
78
79 /**
80 * Sets the Y axis acceleration.
81 *
82 * @param accel The acceleration.
83 */
84 void SetAccelY(units::meters_per_second_squared_t accel);
85
86 /**
87 * Sets the Z axis acceleration.
88 *
89 * @param accel The acceleration.
90 */
91 void SetAccelZ(units::meters_per_second_squared_t accel);
92
93 private:
94 hal::SimDouble m_simGyroAngleX;
95 hal::SimDouble m_simGyroAngleY;
96 hal::SimDouble m_simGyroAngleZ;
97 hal::SimDouble m_simGyroRateX;
98 hal::SimDouble m_simGyroRateY;
99 hal::SimDouble m_simGyroRateZ;
100 hal::SimDouble m_simAccelX;
101 hal::SimDouble m_simAccelY;
102 hal::SimDouble m_simAccelZ;
103};
104
105} // namespace sim
106} // namespace frc
Use DMA SPI to read rate, acceleration, and magnetometer data from the ADIS16448 IMU and return the r...
Definition: ADIS16448_IMU.h:55
Class to control a simulated ADIS16448 IMU.
Definition: ADIS16448_IMUSim.h:21
void SetGyroAngleZ(units::degree_t angle)
Sets the Z axis angle (CCW positive).
void SetGyroRateX(units::degrees_per_second_t angularRate)
Sets the X axis angular rate (CCW positive).
void SetGyroRateY(units::degrees_per_second_t angularRate)
Sets the Y axis angular rate (CCW positive).
void SetGyroAngleY(units::degree_t angle)
Sets the Y axis angle (CCW positive).
void SetAccelX(units::meters_per_second_squared_t accel)
Sets the X axis acceleration.
void SetAccelZ(units::meters_per_second_squared_t accel)
Sets the Z axis acceleration.
ADIS16448_IMUSim(const ADIS16448_IMU &imu)
Constructs from a ADIS16448_IMU object.
void SetGyroRateZ(units::degrees_per_second_t angularRate)
Sets the Z axis angular rate (CCW positive).
void SetGyroAngleX(units::degree_t angle)
Sets the X axis angle (CCW positive).
void SetAccelY(units::meters_per_second_squared_t accel)
Sets the Y axis acceleration.
C++ wrapper around a HAL simulator double value handle.
Definition: SimDevice.h:536
Definition: AprilTagDetector_cv.h:11