WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
RotationVectorToMatrix.hpp
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <Eigen/Core>
8
10
11namespace wpi::math::detail {
12
14 return ct_matrix3d{{0.0, -rotation(2), rotation(1)},
15 {rotation(2), 0.0, -rotation(0)},
16 {-rotation(1), rotation(0), 0.0}};
17}
18
19constexpr Eigen::Matrix3d RotationVectorToMatrix(
20 const Eigen::Vector3d& rotation) {
21 return Eigen::Matrix3d{{0.0, -rotation(2), rotation(1)},
22 {rotation(2), 0.0, -rotation(0)},
23 {-rotation(1), rotation(0), 0.0}};
24}
25
26} // namespace wpi::math::detail
Definition ProfiledPIDController.hpp:20
constexpr ct_matrix3d RotationVectorToMatrix(const ct_vector3d &rotation)
Definition RotationVectorToMatrix.hpp:13
ct_vector< double, 3 > ct_vector3d
Definition ct_matrix.hpp:387
ct_matrix< double, 3, 3 > ct_matrix3d
Definition ct_matrix.hpp:385