GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
com_selector.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_COM_SELECTOR_H_
9#define DESIGNLAB_COM_SELECTOR_H_
10
11#include <memory>
12#include <utility>
13#include <vector>
14
15#include "com_type.h"
17#include "math_polygon2.h"
18#include "math_vector3.h"
19#include "robot_state_node.h"
20
21namespace designlab {
22
35class ComSelector final {
36 public:
37 explicit ComSelector(
38 const std::shared_ptr<const IHexapodPostureValidator>& checker_ptr)
39 : checker_ptr_(checker_ptr){};
40
47 bool GetComFromPolygon(const Polygon2& polygon,
48 const RobotStateNode& current_node,
49 Vector3* output_com) const;
50
51 private:
52 static constexpr int kDiscretizationNum = 10;
53
55 const float kStabilityMargin = 10.0f;
56
58 bool MakeComCandidatePoint(
59 const Polygon2& polygon,
60 std::pair<bool, Vector2>
61 output_coms[kDiscretizationNum * kDiscretizationNum]) const;
62
64 bool IsInMargin(const Polygon2& polygon, const std::vector<Vector2>& edge_vec,
65 const Vector2& candidate_point) const;
66
67 const std::shared_ptr<const IHexapodPostureValidator> checker_ptr_;
68};
69
70} // namespace designlab
71
72#endif // DESIGNLAB_COM_SELECTOR_H_
重心の候補領域から重心位置を選択するクラス.
ComSelector(const std::shared_ptr< const IHexapodPostureValidator > &checker_ptr)
bool GetComFromPolygon(const Polygon2 &polygon, const RobotStateNode &current_node, Vector3 *output_com) const
重心を求める.
2次元の多角形を表す構造体.
グラフ構造のためのノード(頂点).
2次元の位置ベクトルを表す構造体.
3次元の位置ベクトルを表す構造体.