mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 17:13:33 +08:00
Initial commit.
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* @file Dcm.hpp
|
||||
*
|
||||
* A direction cosine matrix class.
|
||||
*
|
||||
* @author James Goppert <james.goppert@gmail.com>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Matrix.hpp>
|
||||
#include <Quaternion.hpp>
|
||||
#include <Euler.hpp>
|
||||
|
||||
namespace matrix
|
||||
{
|
||||
|
||||
template<typename Type>
|
||||
class Quaternion;
|
||||
|
||||
template<typename Type>
|
||||
class Dcm : public Matrix<Type, 3, 3>
|
||||
{
|
||||
public:
|
||||
virtual ~Dcm() {};
|
||||
|
||||
typedef Matrix<Type, 3, 1> Vector3;
|
||||
|
||||
Dcm() : Matrix<Type, 3, 3>()
|
||||
{
|
||||
}
|
||||
|
||||
Dcm(const Quaternion<Type> & q) {
|
||||
// TODO
|
||||
Dcm &c = *this;
|
||||
c(0, 0) = 0;
|
||||
c(0, 1) = 0;
|
||||
c(0, 2) = 0;
|
||||
c(1, 0) = 0;
|
||||
c(1, 1) = 0;
|
||||
c(1, 2) = 0;
|
||||
c(2, 0) = 0;
|
||||
c(2, 1) = 0;
|
||||
c(2, 2) = 0;
|
||||
}
|
||||
|
||||
Dcm(const Euler<Type> & e) {
|
||||
// TODO
|
||||
Dcm &c = *this;
|
||||
c(0, 0) = 0;
|
||||
c(0, 1) = 0;
|
||||
c(0, 2) = 0;
|
||||
c(1, 0) = 0;
|
||||
c(1, 1) = 0;
|
||||
c(1, 2) = 0;
|
||||
c(2, 0) = 0;
|
||||
c(2, 1) = 0;
|
||||
c(2, 2) = 0;
|
||||
}
|
||||
};
|
||||
|
||||
typedef Dcm<float> Dcmf;
|
||||
|
||||
}; // namespace matrix
|
||||
Reference in New Issue
Block a user