Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
angular_velocity.hpp
Go to the documentation of this file.
1/*****************************************************************************/
2/********** !!! WARNING: CODE GENERATED BY TAPROOT. DO NOT EDIT !!! **********/
3/*****************************************************************************/
4
5/*
6 * Copyright (c) 2025-2025 Advanced Robotics at the University of Washington <robomstr@uw.edu>
7 *
8 * This file is part of Taproot.
9 *
10 * Taproot is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * Taproot is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Taproot. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef TAPROOT_ANGULAR_VELOCITY_HPP_
25#define TAPROOT_ANGULAR_VELOCITY_HPP_
26
28
30{
32{
33public:
34 inline AngularVelocity(const float rollVel, const float pitchVel, const float yawVel)
35 : matrix_(skewMatFromAngVel(rollVel, pitchVel, yawVel))
36 {
37 }
38
39 /* rvalue reference */
40 inline AngularVelocity(AngularVelocity&& other) : matrix_(std::move(other.matrix_)) {}
41
42 /* Costly; use rvalue reference whenever possible */
43 inline AngularVelocity(AngularVelocity& other) : matrix_(CMSISMat(other.matrix_)) {}
44
45 /* Costly; use rvalue reference whenever possible */
46 inline AngularVelocity(const CMSISMat<3, 3>& matrix) : matrix_(matrix) {}
47
48 inline AngularVelocity(CMSISMat<3, 3>&& matrix) : matrix_(std::move(matrix)) {}
49
53 inline float getRollVelocity() const { return matrix_.data[0 * 3 + 2]; }
54
58 inline float getPitchVelocity() const { return -matrix_.data[1 * 3 + 2]; }
59
63 inline float getYawVelocity() const { return -matrix_.data[0 * 3 + 1]; }
64
65 const inline CMSISMat<3, 3>& matrix() const { return matrix_; }
66
70 inline static CMSISMat<3, 3> skewMatFromAngVel(const float wx, const float wy, const float wz)
71 {
72 return tap::algorithms::CMSISMat<3, 3>({0, -wz, wy, wz, 0, -wx, -wy, wx, 0});
73 }
74
75 friend class Transform;
76 friend class DynamicOrientation;
77
78private:
79 CMSISMat<3, 3> matrix_;
80}; // class AngularVelocity
81} // namespace tap::algorithms::transforms
82
83#endif // TAPROOT_ANGULAR_VELOCITY_HPP_
Definition angular_velocity.hpp:32
float getPitchVelocity() const
Get the pitch velocity.
Definition angular_velocity.hpp:58
AngularVelocity(const float rollVel, const float pitchVel, const float yawVel)
Definition angular_velocity.hpp:34
float getRollVelocity() const
Get the roll velocity.
Definition angular_velocity.hpp:53
AngularVelocity(CMSISMat< 3, 3 > &&matrix)
Definition angular_velocity.hpp:48
AngularVelocity(const CMSISMat< 3, 3 > &matrix)
Definition angular_velocity.hpp:46
AngularVelocity(AngularVelocity &other)
Definition angular_velocity.hpp:43
static CMSISMat< 3, 3 > skewMatFromAngVel(const float wx, const float wy, const float wz)
Definition angular_velocity.hpp:70
AngularVelocity(AngularVelocity &&other)
Definition angular_velocity.hpp:40
float getYawVelocity() const
Get the yaw velocity.
Definition angular_velocity.hpp:63
const CMSISMat< 3, 3 > & matrix() const
Definition angular_velocity.hpp:65
Definition dynamic_orientation.hpp:34
Definition transform.hpp:60
Definition angular_velocity.hpp:30
Definition cmsis_mat.hpp:45
std::array< float, ROWS *COLS > data
Definition cmsis_mat.hpp:46