🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
Axes.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstCore/Object.hpp"
25#include "AstUtil/ObjectNamed.hpp"
26
27AST_NAMESPACE_BEGIN
28
34class Rotation;
35class KinematicRotation;
36class Axes;
37using PAxes = Axes*;
39
46AST_CORE_API errc_t aAxesTransform(Axes* source, Axes* target, const TimePoint& tp, Rotation& rotation);
47
48
55AST_CORE_API errc_t aAxesTransform(Axes* source, Axes* target, const TimePoint& tp, Matrix3d& matrix);
56
57
64AST_CORE_API errc_t aAxesTransform(Axes* source, Axes* target, const TimePoint& tp, KinematicRotation& rotation);
65
66
71class AST_CORE_API Axes : public ObjectNamed
72{
73public:
74 AST_OBJECT(Axes)
75 ~Axes() override = default;
76
79 virtual Axes* getParent() const = 0;
80
85 virtual errc_t getTransform(const TimePoint& tp, Rotation& rotation) const = 0;
86
91 virtual errc_t getTransform(const TimePoint& tp, KinematicRotation& rotation) const = 0;
92public:
96 int getDepth() const;
97
101 Axes* getAncestor(int depth) const;
102
103public:
109 A_ALWAYS_INLINE
110 errc_t getTransformTo(Axes* target, const TimePoint& tp, Rotation& rotation) const
111 {
112 return aAxesTransform(const_cast<Axes*>(this), target, tp, rotation);
113 }
119 A_ALWAYS_INLINE
120 errc_t getTransformTo(Axes* target, const TimePoint& tp, KinematicRotation& rotation) const
121 {
122 return aAxesTransform(const_cast<Axes*>(this), target, tp, rotation);
123 }
129 A_ALWAYS_INLINE
130 errc_t getTransformFrom(Axes* source, const TimePoint& tp, Rotation& rotation) const
131 {
132 return aAxesTransform(source, const_cast<Axes*>(this), tp, rotation);
133 }
139 A_ALWAYS_INLINE
140 errc_t getTransformFrom(Axes* source, const TimePoint& tp, KinematicRotation& rotation) const
141 {
142 return aAxesTransform(source, const_cast<Axes*>(this), tp, rotation);
143 }
148 A_ALWAYS_INLINE
149 errc_t getTransformFromParent(const TimePoint& tp, Rotation& rotation) const
150 {
151 return getTransform(tp, rotation);
152 }
157 A_ALWAYS_INLINE
158 errc_t getTransformFromParent(const TimePoint& tp, KinematicRotation& rotation) const
159 {
160 return getTransform(tp, rotation);
161 }
162};
163
164using PAxes = Axes*;
165using HAxes = SharedPtr<Axes>;
166
169AST_NAMESPACE_END
轴系抽象基类
定义 Axes.hpp:72
A_ALWAYS_INLINE errc_t getTransformFromParent(const TimePoint &tp, KinematicRotation &rotation) const
获取当前轴系相对于父轴系的运动学旋转变换
定义 Axes.hpp:158
virtual errc_t getTransform(const TimePoint &tp, KinematicRotation &rotation) const =0
获取当前轴系相对于父轴系的运动学旋转变换
virtual Axes * getParent() const =0
获取当前轴系的父轴系
A_ALWAYS_INLINE errc_t getTransformFrom(Axes *source, const TimePoint &tp, Rotation &rotation) const
获取源轴系到当前轴系的旋转变换
定义 Axes.hpp:130
A_ALWAYS_INLINE errc_t getTransformFrom(Axes *source, const TimePoint &tp, KinematicRotation &rotation) const
获取源轴系到当前轴系的运动学旋转变换
定义 Axes.hpp:140
A_ALWAYS_INLINE errc_t getTransformFromParent(const TimePoint &tp, Rotation &rotation) const
获取当前轴系相对于父轴系的旋转变换
定义 Axes.hpp:149
A_ALWAYS_INLINE errc_t getTransformTo(Axes *target, const TimePoint &tp, KinematicRotation &rotation) const
获取当前轴系到目标轴系的运动学旋转变换
定义 Axes.hpp:120
virtual errc_t getTransform(const TimePoint &tp, Rotation &rotation) const =0
获取当前轴系相对于父轴系的旋转变换
A_ALWAYS_INLINE errc_t getTransformTo(Axes *target, const TimePoint &tp, Rotation &rotation) const
获取当前轴系到目标轴系的旋转变换
定义 Axes.hpp:110
运动学坐标系旋转
定义 KinematicRotation.hpp:32
命名对象
定义 ObjectNamed.hpp:36
坐标系旋转类
定义 Rotation.hpp:39
绝对时间点
定义 TimePoint.hpp:108
errc_t aAxesTransform(Axes *source, Axes *target, const TimePoint &tp, Rotation &rotation)
计算轴系之间的旋转变换。
定义 Axes.cpp:185