GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
phantomx_mk2.h
[詳解]
1
3
4// Copyright(c) 2023-2025 Design Engineering Laboratory, Saitama University
5// Released under the MIT license
6// https://opensource.org/licenses/mit-license.php
7
8#ifndef DESIGNLAB_PHANTOMX_MK2_H_
9#define DESIGNLAB_PHANTOMX_MK2_H_
10
16
17
18namespace designlab
19{
20
28{
29public:
30 explicit PhantomXMkII(const PhantomXMkIIParameterRecord& parameter_record);
31
32
34 const int leg_index, const Vector3& leg_pos) const noexcept override;
35
37 const int leg_index, const Vector3& leg_pos,
38 const HexapodJointState& joint_state) const noexcept override;
39
40
42 const Vector3& converted_position, int leg_index,
43 const Vector3& center_of_mass_global, const Quaternion& robot_quat,
44 const bool consider_rot) const override;
45
47 const Vector3& converted_position, int leg_index,
48 const Vector3& center_of_mass_global, const Quaternion& robot_quat,
49 const bool consider_rot) const override;
50
52 const Vector3& converted_position,
53 const Vector3& center_of_mass_global, const Quaternion& robot_quat,
54 const bool consider_rot) const override;
55
57 const Vector3& converted_position, int leg_index) const;
58
60 const Vector3& converted_position, int leg_index) const;
61
62
63 Vector3 GetFreeLegPosLegCoordinate(int leg_index) const noexcept override;
64
65 Vector3 GetLegBasePosRobotCoordinate(int leg_index) const noexcept override;
66
67 float GetGroundHeightMarginMin() const noexcept override;
68
69 float GetGroundHeightMarginMax() const noexcept override;
70
71
72 bool IsLegInRange(int leg_index, const Vector3& leg_pos) const override;
73
75 const std::array<Vector3, HexapodConst::kLegNum>& leg_pos) const override;
76
78 const std::array<Vector3, HexapodConst::kLegNum>& leg_pos) const override;
79
80 bool IsStable(const leg_func::LegStateBit& leg_state,
81 const std::array<Vector3, HexapodConst::kLegNum>& leg_pos) const override;
82
84 const RobotStateNode& node,
85 const DividedMapState& devide_map) const override;
86
87private:
88 static constexpr int kMaxLegRSize{ 200 };
89
90
91 std::array<float, kMaxLegRSize> InitMaxLegR() const;
92 std::array<Vector2, HexapodConst::kLegNum> InitMinLegPosXY() const;
93 std::array<Vector2, HexapodConst::kLegNum> InitMaxLegPosXY() const;
94
96 const float kBodyLiftingHeightMin;
97
99 const float kBodyLiftingHeightMax;
100
101 const float kMovableCoxaAngleMin;
102 const float kMovableCoxaAngleMax;
103
104 const float kMinLegR;
105 const float kMaxLegR;
106
107 const float kFreeLegHeight;
108 const float kStableMargin;
109
110 const float kMinLegDistance;
111
114 std::array<float, kMaxLegRSize> kMaxLegRArray;
115
117 std::array<Vector2, HexapodConst::kLegNum> kMinLegPosXY;
118
120 std::array<Vector2, HexapodConst::kLegNum> kMaxLegPosXY;
121
122
124 const std::array<Vector3, HexapodConst::kLegNum> leg_base_pos_robot_coordinate_;
125
127 const std::array<Vector3, HexapodConst::kLegNum> free_leg_pos_leg_coordinate_;
128};
129
130} // namespace designlab
131
132
133#endif // DESIGNLAB_PHANTOMX_MK2_H_
マップを格子状に分割して管理するクラス.
ロボットは重心位置・アクチュエータなど様々な点を基準とする座標系を持つ. これらを相互に変換する処理のインターフェース.
間接角度や角速度を計算する処理のインターフェース.
6脚ロボットが有効な姿勢をとっているかを チェックする処理のインターフェース.
6脚ロボットの状態を表示するクラス.
PhantomX mk-2 の状態を計算するクラス.
Vector3 ConvertLegToGlobalCoordinate(const Vector3 &converted_position, int leg_index, const Vector3 &center_of_mass_global, const Quaternion &robot_quat, const bool consider_rot) const override
脚座標系で表現されている座標を,グローバル座標系に変換する.
Vector3 ConvertGlobalToLegCoordinate(const Vector3 &converted_position, int leg_index, const Vector3 &center_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 &center_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のビット型.
Definition leg_state.h:56
ロボットの関節の状態を表す構造体.
クォータニオンを表す構造体.
グラフ構造のためのノード(頂点).旧名 LNODE
3次元の位置ベクトルを表す構造体.