WPILibC++ 2027.0.0-alpha-3
Loading...
Searching...
No Matches
RotationVectorToMatrix.h
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
9#include "frc/ct_matrix.h"
10
11namespace frc::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 frc::detail
Compile-time wrapper for Eigen::Matrix.
Definition ct_matrix.h:26
Definition ListenerExecutor.h:12
constexpr ct_matrix3d RotationVectorToMatrix(const ct_vector3d &rotation)
Definition RotationVectorToMatrix.h:13