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"
16#include "math_polygon2.h"
17#include "math_vector3.h"
19#include "robot_state_node.h"
20
21
22namespace designlab
23{
24
36class ComSelector final
37{
38public:
39 explicit ComSelector(const std::shared_ptr<const IHexapodPostureValidator>& checker_ptr) :
40 checker_ptr_(checker_ptr)
41 {
42 };
43
50 bool GetComFromPolygon(const Polygon2& polygon,
51 const RobotStateNode& current_node, Vector3* output_com) const;
52
53private:
54 static constexpr int kDiscretizationNum = 10;
55
57 const float kStabilityMargin = 10.0f;
58
60 bool MakeComCandidatePoint(
61 const Polygon2& polygon,
62 std::pair<bool, Vector2> output_coms[kDiscretizationNum * kDiscretizationNum]) const;
63
65 bool IsInMargin(const Polygon2& polygon,
66 const std::vector<Vector2>& edge_vec, const Vector2& candidate_point) const;
67
68 const std::shared_ptr<const IHexapodPostureValidator> checker_ptr_;
69};
70
71} // namespace designlab
72
73
74#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次元の多角形を表す構造体.
グラフ構造のためのノード(頂点).旧名 LNODE
2次元の位置ベクトルを表す構造体.
3次元の位置ベクトルを表す構造体.