20 std::unique_ptr<GraphTreeCreator>&& graph_tree_creator,
21 std::unique_ptr<IGraphSearcher>&& graph_searcher,
const int max_depth,
22 const int max_node_num)
23 : graph_tree_creator_ptr_(
std::move(graph_tree_creator)),
24 graph_searcher_ptr_(
std::move(graph_searcher)),
25 graph_tree_{max_node_num},
26 max_depth_(max_depth) {
27 assert(graph_tree_creator_ptr_ !=
nullptr);
28 assert(graph_searcher_ptr_ !=
nullptr);
29 assert(0 < max_depth_);
30 assert(0 < max_node_num);
37 assert(output_node !=
nullptr);
38 assert(graph_tree_creator_ptr_ !=
nullptr);
39 assert(graph_searcher_ptr_ !=
nullptr);
45 graph_tree_creator_ptr_->Init(divided_map);
49 graph_tree_.
AddNode(current_node);
52 graph_tree_creator_ptr_->CreateGraphTree(0, max_depth_, &graph_tree_);
59 const auto [search_result, _, next_node] =
60 graph_searcher_ptr_->SearchGraphTree(graph_tree_, operation, divided_map,
67 (*output_node) = next_node;
void Init(const MapState &map_state, const Vector3 global_robot_com)
マップのデータを初期化する. ロボットの重心座標を中心にマップのデータを格子状に分割し, その中に存在する脚設置可能点を集める.
GaitPatternGeneratorBasic(std::unique_ptr< GraphTreeCreator > &&graph_tree_creator_ptr, std::unique_ptr< IGraphSearcher > &&graph_searcher_ptr, int max_depth, int max_node_num)
GraphSearchResult GetNextNodeByGraphSearch(const RobotStateNode ¤t_node, const MapState &map_ref, const RobotOperation &operation, RobotStateNode *output_node) override
グラフ探索を行い,次の動作として最適なノードを返す.
constexpr void Reset()
グラフをリセットする.
void AddNode(const RobotStateNode &node)
ノードを追加する. 追加するノードは親ノードのインデックスと,depthの指定が適切にされている必要がある. これらが適切にされていない場合,アサーションに引っかかる....
enums::Result result
成功か失敗か.
探索において目標となる座標や角度,評価する値についてまとめた構造体.
constexpr bool IsLootNode() const
自身が根ノードであるか判定する.
Vector3 center_of_mass_global_coord
[4 * 3 = 12byte] グローバル座標系における重心の位置.旧名 GCOM