GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
node_creator_leg_hierarchy_test.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_NODE_CREATOR_LEG_HIERARCHY_TEST_H_
9#define DESIGNLAB_NODE_CREATOR_LEG_HIERARCHY_TEST_H_
10
11#include <array>
12#include <vector>
13
14#include "doctest.h"
15
17
18
19TEST_SUITE("NodeCreatorLegHierarchyTest")
20{
28
29 TEST_CASE("CreateTest_WhenOneLegIsSwinging")
30 {
31 using enum DiscreteLegPos;
32
33 // Arrange
34 const HexapodMove move = HexapodMove::kComMove;
35 const std::vector<DiscreteLegPos> discrete_leg_pos = {
36 kBack, kCenter, kFront, };
37
38 NodeCreatorLegHierarchy node_creator_leg_hierarchy{
39 move, discrete_leg_pos };
40
41 // 1脚のみ遊脚させる.
42 std::array<bool, HexapodConst::kLegNum> ground_leg = {
43 false, true, true, true, true, true };
44
45 RobotStateNode robot_state_node;
46
47 robot_state_node.leg_state = MakeLegStateBit(
48 DiscreteComPos::kCenterFront,
49 ground_leg,
50 { kCenter, kCenter, kCenter, kCenter, kCenter, kCenter });
51
52 // Act
53 std::vector<RobotStateNode> actual;
54
55 node_creator_leg_hierarchy.Create(robot_state_node, 0, &actual);
56
57 // Assert
58 CHECK(actual.size() == 3);
59
60
61 }
62}
63
64#endif // DESIGNLAB_NODE_CREATOR_LEG_HIERARCHY_TEST_H_
Hexapodの定数をまとめたクラス.
脚の階層構造を作るためのクラス.
DiscreteLegPos
離散化された脚位置を表す列挙体. 先行研究では 1~7の int型の数値で表現されているが, 可読性を上げるために列挙体にした. 離散化された脚位置は 3bit (0 ~ 7)の範囲で表現される...
LegStateBit MakeLegStateBit(const enums::DiscreteComPos discrete_com_pos, const std::array< bool, HexapodConst::kLegNum > &is_ground, const std::array< enums::DiscreteLegPos, HexapodConst::kLegNum > &discretized_leg_pos)
脚状態を作成して返す関数.脚状態は重心パターン, 脚の接地・遊脚,離散化した脚位置のデータが含まれる.
Definition leg_state.cpp:15
HexapodMove
ロボットが次にどの動作をするのかを表す列挙体.
TEST_SUITE("NodeCreatorLegHierarchyTest")
グラフ構造のためのノード(頂点).旧名 LNODE