mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
[hal, wpilib] PWM Rewrite (#7845)
The HAL will only contain the output period and the raw microseconds. Higher level things such as SimDevice can handle everything else.
This commit is contained in:
31
wpilibc/src/main/native/include/frc/simulation/ServoSim.h
Normal file
31
wpilibc/src/main/native/include/frc/simulation/ServoSim.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// 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 <hal/SimDevice.h>
|
||||
#include <units/length.h>
|
||||
|
||||
#include "frc/Servo.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class Servo;
|
||||
|
||||
namespace sim {
|
||||
class ServoSim {
|
||||
public:
|
||||
explicit ServoSim(const Servo& servo);
|
||||
|
||||
explicit ServoSim(int channel);
|
||||
|
||||
double GetPosition() const;
|
||||
|
||||
double GetAngle() const;
|
||||
|
||||
private:
|
||||
hal::SimDouble m_simPosition;
|
||||
};
|
||||
} // namespace sim
|
||||
} // namespace frc
|
||||
Reference in New Issue
Block a user