8#ifndef DESIGNLAB_PHANTOMX_MK2_H_
9#define DESIGNLAB_PHANTOMX_MK2_H_
34 const int leg_index,
const Vector3& leg_pos)
const noexcept override;
37 const int leg_index,
const Vector3& leg_pos,
42 const Vector3& converted_position,
int leg_index,
44 const bool consider_rot)
const override;
47 const Vector3& converted_position,
int leg_index,
49 const bool consider_rot)
const override;
52 const Vector3& converted_position,
54 const bool consider_rot)
const override;
57 const Vector3& converted_position,
int leg_index)
const;
60 const Vector3& converted_position,
int leg_index)
const;
75 const std::array<Vector3, HexapodConst::kLegNum>& leg_pos)
const override;
78 const std::array<Vector3, HexapodConst::kLegNum>& leg_pos)
const override;
81 const std::array<Vector3, HexapodConst::kLegNum>& leg_pos)
const override;
88 static constexpr int kMaxLegRSize{ 200 };
91 std::array<float, kMaxLegRSize> InitMaxLegR()
const;
92 std::array<Vector2, HexapodConst::kLegNum> InitMinLegPosXY()
const;
93 std::array<Vector2, HexapodConst::kLegNum> InitMaxLegPosXY()
const;
96 const float kBodyLiftingHeightMin;
99 const float kBodyLiftingHeightMax;
101 const float kMovableCoxaAngleMin;
102 const float kMovableCoxaAngleMax;
104 const float kMinLegR;
105 const float kMaxLegR;
107 const float kFreeLegHeight;
108 const float kStableMargin;
110 const float kMinLegDistance;
114 std::array<float, kMaxLegRSize> kMaxLegRArray;
117 std::array<Vector2, HexapodConst::kLegNum> kMinLegPosXY;
120 std::array<Vector2, HexapodConst::kLegNum> kMaxLegPosXY;
124 const std::array<Vector3, HexapodConst::kLegNum> leg_base_pos_robot_coordinate_;
127 const std::array<Vector3, HexapodConst::kLegNum> free_leg_pos_leg_coordinate_;
ロボットは重心位置・アクチュエータなど様々な点を基準とする座標系を持つ. これらを相互に変換する処理のインターフェース.
間接角度や角速度を計算する処理のインターフェース.
6脚ロボットが有効な姿勢をとっているかを チェックする処理のインターフェース.
PhantomX mk-2 の状態を計算するクラス.
Vector3 ConvertLegToGlobalCoordinate(const Vector3 &converted_position, int leg_index, const Vector3 ¢er_of_mass_global, const Quaternion &robot_quat, const bool consider_rot) const override
脚座標系で表現されている座標を,グローバル座標系に変換する.
Vector3 ConvertGlobalToLegCoordinate(const Vector3 &converted_position, int leg_index, const Vector3 ¢er_of_mass_global, const Quaternion &robot_quat, const bool consider_rot) const override
グローバル座標系で表現されている座標を,脚座標系に変換する.
Vector3 ConvertRobotToLegCoordinate(const Vector3 &converted_position, int leg_index) const
ロボット座標系で表現されている座標を,脚座標系に変換する.
Vector3 ConvertLegToRobotCoordinate(const Vector3 &converted_position, int leg_index) const
脚座標系で表現されている座標を,ロボット座標系に変換する.
bool IsBodyInterferingWithGround(const RobotStateNode &node, const DividedMapState &devide_map) const override
胴体が地面と干渉しているかどうかを判定する.
float GetGroundHeightMarginMax() const noexcept override
地面の最大高さと重心位置を最大どれだけ離すかを返す.
float GetGroundHeightMarginMin() const noexcept override
地面の最大高さと重心位置を最小どれだけ離すかを返す.
float CalculateStabilityMargin(const leg_func::LegStateBit &leg_state, const std::array< Vector3, HexapodConst::kLegNum > &leg_pos) const override
安定余裕(Stability Margin)を計算する. 詳しくは「不整地における歩行機械の静的安定性評価基準」 という論文を読んで欲しい. 接地脚を繋いで作られる多角形の辺と重心の距離の最小値を計...
bool IsLegInRange(int leg_index, const Vector3 &leg_pos) const override
脚が可動範囲内にあるかどうかを判定する.
HexapodJointState CalculateJointState(const int leg_index, const Vector3 &leg_pos) const noexcept override
指定した脚の関節のグローバル座標と,角度を計算する. 重たいのでグラフ探索や,描画処理中にループで使用することは推奨しない. 間接の可動範囲外まで動いてしまう場合でも,答えを返す. 目標座標...
Vector3 GetFreeLegPosLegCoordinate(int leg_index) const noexcept override
遊脚する位置を返す,脚座標系.
bool IsValidJointState(const int leg_index, const Vector3 &leg_pos, const HexapodJointState &joint_state) const noexcept override
指定した脚のHexapodJointStateが正しく計算できているかを調べる. 目標座標に届かない場合や,間接の可動範囲外まで動いてしまう場合, 戻り値は false になる.
Vector3 ConvertRobotToGlobalCoordinate(const Vector3 &converted_position, const Vector3 ¢er_of_mass_global, const Quaternion &robot_quat, const bool consider_rot) const override
ロボット座標系で表現されている座標を,グローバル座標系に変換する.
bool IsStable(const leg_func::LegStateBit &leg_state, const std::array< Vector3, HexapodConst::kLegNum > &leg_pos) const override
安定余裕を用いて,静的に安定しているかどうかを判定する.
bool IsLegInterfering(const std::array< Vector3, HexapodConst::kLegNum > &leg_pos) const override
脚が他の脚と干渉しているかどうかを判定する.
Vector3 GetLegBasePosRobotCoordinate(int leg_index) const noexcept override
脚の付け根の座標(leg base position )を取得する.ロボット座標系.
std::bitset< kLegStateBitNum > LegStateBit
脚状態を保存する型.28bitのビット型.
グラフ構造のためのノード(頂点).旧名 LNODE