blob: d828f30730124d9ac3fcc6b611a9903aa914b8e7 [file] [log] [blame]
Austin Schuh1e69f942020-11-14 15:06:14 -08001/*----------------------------------------------------------------------------*/
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
10namespace frc {
11
12template <>
13bool 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
18template <>
19bool 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
24Eigen::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