mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[wpilib][sim] Add Onboard IMU Sim (#8855)
This provides the ability to simulate parts of the Onboard IMU at the HAL level. This allows team to use and simulate the IMU in code, and a follow up PR could be made to the halsim_gui to add a new widget to view and modify the data graphically. Since the C++ IMU uses radians for angles that is what I did for the simulator. Partially deals with #8845
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "wpi/units/acceleration.hpp"
|
||||
#include "wpi/units/angle.hpp"
|
||||
#include "wpi/units/angular_velocity.hpp"
|
||||
|
||||
namespace wpi::sim {
|
||||
|
||||
class OnboardIMUSim {
|
||||
public:
|
||||
void SetAngleX(wpi::units::radian_t angle);
|
||||
void SetAngleY(wpi::units::radian_t angle);
|
||||
void SetAngleZ(wpi::units::radian_t angle);
|
||||
|
||||
void SetGyroRateX(wpi::units::radians_per_second_t rate);
|
||||
void SetGyroRateY(wpi::units::radians_per_second_t rate);
|
||||
void SetGyroRateZ(wpi::units::radians_per_second_t rate);
|
||||
|
||||
void SetAccelX(wpi::units::meters_per_second_squared_t accel);
|
||||
void SetAccelY(wpi::units::meters_per_second_squared_t accel);
|
||||
void SetAccelZ(wpi::units::meters_per_second_squared_t accel);
|
||||
|
||||
void SetYaw(wpi::units::radian_t angle);
|
||||
};
|
||||
|
||||
} // namespace wpi::sim
|
||||
Reference in New Issue
Block a user