Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame^] | 1 | /*----------------------------------------------------------------------------*/ |
| 2 | /* Copyright (c) 2020 FIRST. All Rights Reserved. */ |
| 3 | /* Open Source Software - may be modified and shared by FRC teams. The code */ |
| 4 | /* must be accompanied by the FIRST BSD license file in the root directory of */ |
| 5 | /* the project. */ |
| 6 | /*----------------------------------------------------------------------------*/ |
| 7 | |
| 8 | #include "frc/StateSpaceUtil.h" |
| 9 | |
| 10 | namespace frc { |
| 11 | |
| 12 | template <> |
| 13 | bool IsStabilizable<1, 1>(const Eigen::Matrix<double, 1, 1>& A, |
| 14 | const Eigen::Matrix<double, 1, 1>& B) { |
| 15 | return detail::IsStabilizableImpl<1, 1>(A, B); |
| 16 | } |
| 17 | |
| 18 | template <> |
| 19 | bool IsStabilizable<2, 1>(const Eigen::Matrix<double, 2, 2>& A, |
| 20 | const Eigen::Matrix<double, 2, 1>& B) { |
| 21 | return detail::IsStabilizableImpl<2, 1>(A, B); |
| 22 | } |
| 23 | |
| 24 | Eigen::Matrix<double, 3, 1> PoseToVector(const Pose2d& pose) { |
| 25 | return frc::MakeMatrix<3, 1>(pose.X().to<double>(), pose.Y().to<double>(), |
| 26 | pose.Rotation().Radians().to<double>()); |
| 27 | } |
| 28 | |
| 29 | } // namespace frc |