GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
gait_pattern_generator_switch_move.cpp
[詳解]
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
9
10#include <string>
11#include <utility>
12
13#include <magic_enum.hpp>
14
15#include "cassert_define.h"
16
17
18namespace designlab
19{
20
22 std::unique_ptr<IGaitPatternGenerator>&& gpg_for_straight_ptr,
23 std::unique_ptr<IGaitPatternGenerator>&& gpg_for_turn_spot_ptr) :
24 gpg_for_straight_ptr_(std::move(gpg_for_straight_ptr)),
25 gpg_for_turn_spot_ptr_(std::move(gpg_for_turn_spot_ptr))
26{
27 assert(gpg_for_straight_ptr_);
28 assert(gpg_for_turn_spot_ptr_);
29}
30
32 const RobotStateNode& current_node,
33 const MapState& map,
34 const RobotOperation& operation,
35 RobotStateNode* output_node)
36{
37 using enum RobotOperationType;
38
39 if (operation.operation_type == kStraightMoveVector ||
41 {
42 return gpg_for_straight_ptr_->GetNextNodeByGraphSearch(
43 current_node, map, operation, output_node);
44 }
45 else if (operation.operation_type == kSpotTurnRotAxis ||
47 {
48 return gpg_for_turn_spot_ptr_->GetNextNodeByGraphSearch(
49 current_node, map, operation, output_node);
50 }
51 else
52 {
53 assert(false);
54
56 "A non-existent behavior was specified." };
57 }
58}
59
60} // namespace designlab
GaitPatternGeneratorSwitchMove(std::unique_ptr< IGaitPatternGenerator > &&gait_pattern_generator_for_straight, std::unique_ptr< IGaitPatternGenerator > &&gait_pattern_generator_for_turn_spot)
GraphSearchResult GetNextNodeByGraphSearch(const RobotStateNode &current_node, const MapState &map, const RobotOperation &operation, RobotStateNode *output_node) override
グラフ探索を行い,次の動作として最適なノードを返す.
マップを表すクラス.
Definition map_state.h:32
RobotOperationType
Robotをどのように動かすかを表す列挙体.
@ kSpotTurnRotAxis
その場で旋回させる(回転軸を示し,その軸周りの右ねじの回転)
@ kStraightMoveVector
直線移動をさせる(移動したい方向をベクトルで示す)
@ kStraightMovePosition
直線移動をさせる(移動したい座標を示す)
@ kSpotTurnLastPosture
その場で旋回させる(最終的な姿勢 Posture を示す)
Definition com_type.h:24
グラフ探索の結果を表す構造体.
探索において目標となる座標や角度,評価する値についてまとめた構造体.
RobotOperationType operation_type
グラフ構造のためのノード(頂点).旧名 LNODE