WPILibC++ 2024.3.2
ADXRS450_GyroSim.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>
8#include <units/angle.h>
10
12
13namespace frc {
14
15class ADXRS450_Gyro;
16
17namespace sim {
18
19/**
20 * Class to control a simulated ADXRS450 gyroscope.
21 */
23 public:
24 /**
25 * Constructs from a ADXRS450_Gyro object.
26 *
27 * @param gyro ADXRS450_Gyro to simulate
28 */
29 explicit ADXRS450_GyroSim(const ADXRS450_Gyro& gyro);
30
31 /**
32 * Sets the angle.
33 *
34 * @param angle The angle (clockwise positive).
35 */
36 void SetAngle(units::degree_t angle);
37
38 /**
39 * Sets the angular rate (clockwise positive).
40 *
41 * @param rate The angular rate.
42 */
43 void SetRate(units::degrees_per_second_t rate);
44
45 private:
46 hal::SimDouble m_simAngle;
47 hal::SimDouble m_simRate;
48};
49
50} // namespace sim
51} // namespace frc
Use a rate gyro to return the robots heading relative to a starting position.
Definition: ADXRS450_Gyro.h:32
Class to control a simulated ADXRS450 gyroscope.
Definition: ADXRS450_GyroSim.h:22
void SetAngle(units::degree_t angle)
Sets the angle.
ADXRS450_GyroSim(const ADXRS450_Gyro &gyro)
Constructs from a ADXRS450_Gyro object.
void SetRate(units::degrees_per_second_t rate)
Sets the angular rate (clockwise positive).
C++ wrapper around a HAL simulator double value handle.
Definition: SimDevice.h:533
Definition: AprilTagPoseEstimator.h:15