29#define _AST_DEF_ACCELERATIONROTATION_PROPERTIES\
30 _AST_DEF_KINEMATICROTATION_PROPERTIES\
31 const Vector3d& rotationRateDot() const { return angvelDot_; }\
32 Vector3d& rotationRateDot() { return angvelDot_; }\
33 const Vector3d& getRotationRateDot() const { return rotationRateDot(); }\
34 Vector3d& getRotationRateDot() { return rotationRateDot(); }\
35 void setRotationRateDot(const Vector3d& angvelDot) { angvelDot_ = angvelDot; }\
36 const AccelerationRotation& accelerationRotation() const { return reinterpret_cast<const AccelerationRotation&>(rotation_); }\
37 AccelerationRotation& accelerationRotation() { return reinterpret_cast<AccelerationRotation&>(rotation_); }\
38 const AccelerationRotation& getAccelerationRotation() const { return accelerationRotation(); }\
39 AccelerationRotation& getAccelerationRotation() { return accelerationRotation(); }\
40 void setAccelerationRotation(const AccelerationRotation& rot) { accelerationRotation() = rot; }\
78 _AST_DEF_ACCELERATIONROTATION_PROPERTIES
122 void transformVecVelAcc(
123 const Vector3d& position,
124 const Vector3d& velocity,
125 const Vector3d& acceleration,
126 Vector3d& positionOut,
127 Vector3d& velocityOut,
128 Vector3d& accelerationOut)
const;
138 void transformVecVelAccInv(
139 const Vector3d& position,
140 const Vector3d& velocity,
141 const Vector3d& acceleration,
142 Vector3d& positionOut,
143 Vector3d& velocityOut,
144 Vector3d& accelerationOut)
const;
148 Vector3d angvelDot_{};
156A_ALWAYS_INLINE AccelerationRotation::AccelerationRotation(
const Matrix3d &mat,
const Vector3d &angvel,
const Vector3d &angvelDot)
159 , angvelDot_(angvelDot)
166 , angvelDot_(angvelDot)
171 : rotation_(rot.rotation())
172 , angvel_(rot.rotationRate())
173 , angvelDot_(angvelDot)
186 Vector3d angvel1 = this->
angvel_;
187 Vector3d angvel2InSource = next.
angvel_ * mat1;
188 Vector3d angvel = angvel1 + angvel2InSource;
189 Vector3d angvelDot = this->
angvelDot_ + angvel1.cross(angvel2InSource) + next.
angvelDot_ * mat1;
213 Vector3d angvel = this->
angvel_;
215 inversed.matrix() = mat.transpose();
216 inversed.
angvel_ = -(mat * angvel);
228 const Vector3d &position,
const Vector3d &velocity,
const Vector3d &acceleration,
229 Vector3d &positionOut, Vector3d &velocityOut, Vector3d &accelerationOut)
const
233 accelerationOut = this->matrix() * (acceleration
234 - this->
angvel_.cross(velocity) * 2.0
236 + this->angvel_.cross(this->angvel_.cross(position)));
237 velocityOut = this->matrix() * (velocity - this->
angvel_.cross(position));
238 positionOut = this->matrix() * position;
242 const Vector3d &position,
const Vector3d &velocity,
const Vector3d &acceleration,
243 Vector3d &positionOut, Vector3d &velocityOut, Vector3d &accelerationOut)
const
246 positionOut = position * this->matrix();
247 velocityOut = velocity * this->matrix() + this->
angvel_.cross(positionOut);
248 accelerationOut = acceleration * this->matrix()
250 + this->
angvel_.cross(velocityOut) * 2.0
加速度(二阶运动学)坐标系旋转
定义 AccelerationRotation.hpp:51
AccelerationRotation & operator*=(const AccelerationRotation &next)
组合下一个坐标系旋转
定义 AccelerationRotation.hpp:204
void transformVecVelAcc(const Vector3d &position, const Vector3d &velocity, const Vector3d &acceleration, Vector3d &positionOut, Vector3d &velocityOut, Vector3d &accelerationOut) const
变换位置、速度和加速度
定义 AccelerationRotation.hpp:227
AccelerationRotation operator*(const AccelerationRotation &next) const
组合下一个坐标系旋转
定义 AccelerationRotation.hpp:199
Vector3d angvel_
角速度
定义 AccelerationRotation.hpp:147
void getInverse(AccelerationRotation &inversed) const
获取逆旋转
定义 AccelerationRotation.hpp:209
AccelerationRotation composed(const AccelerationRotation &next) const
组合下一个坐标系旋转
定义 AccelerationRotation.hpp:177
void transformVecVelAccInv(const Vector3d &position, const Vector3d &velocity, const Vector3d &acceleration, Vector3d &positionOut, Vector3d &velocityOut, Vector3d &accelerationOut) const
变换位置、速度和加速度(逆变换)
定义 AccelerationRotation.hpp:241
AccelerationRotation()=default
加速度旋转默认构造函数
Vector3d angvelDot_
角加速度
定义 AccelerationRotation.hpp:148
_AST_DEF_ACCELERATIONROTATION_PROPERTIES AccelerationRotation & compose(const AccelerationRotation &next)
组合下一个坐标系旋转
定义 AccelerationRotation.hpp:193
AccelerationRotation inverse() const
获取逆旋转
定义 AccelerationRotation.hpp:220
运动学坐标系旋转
定义 KinematicRotation.hpp:50