[wpilib] Add set functions to differential drive simulation (#2746)

All the other simulation objects already have functions like this
through LinearSystemSim.
This commit is contained in:
Tyler Veness
2020-09-27 13:26:47 -07:00
committed by GitHub
parent c55fb583b8
commit 62731bea20
3 changed files with 45 additions and 0 deletions

View File

@@ -122,6 +122,20 @@ class DifferentialDrivetrainSim {
*/
units::ampere_t GetCurrentDraw() const;
/**
* Sets the system state.
*
* @param state The state.
*/
void SetState(const Eigen::Matrix<double, 7, 1>& state);
/**
* Sets the system pose.
*
* @param pose The pose.
*/
void SetPose(const frc::Pose2d& pose);
Eigen::Matrix<double, 7, 1> Dynamics(const Eigen::Matrix<double, 7, 1>& x,
const Eigen::Matrix<double, 2, 1>& u);