GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
com_type.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_TYPE_H_
9#define DESIGNLAB_COM_TYPE_H_
10
11#include <bitset>
12#include <unordered_map>
13#include <vector>
14
15#include <boost/bimap.hpp>
16#include <boost/dynamic_bitset.hpp>
17
18#include "discrete_com_pos.h"
19#include "hexapod_const.h"
20#include "leg_state.h"
21
22
23namespace std
24{
25
26// boost bimapのために比較演算子を定義している.
27template <size_t N>
28bool operator<(const std::bitset<N>& lhs, const std::bitset<N>& rhs)
29{
30 return lhs.to_ulong() < rhs.to_ulong();
31}
32
33} // namespace std
34
35
52namespace designlab::com_func
53{
54
61using LegGroundedMap = boost::bimaps::bimap<leg_func::LegGroundedBit, int>;
62
64using LegGroundedMapValue = LegGroundedMap::value_type;
65
66
70
76 int leg_ground_pattern_index);
77
78
85 boost::dynamic_bitset<>* output);
86
93void RemoveLegGroundPatternFromNotGroundableLeg(int not_groundable_leg_index,
94 boost::dynamic_bitset<>* output);
95
102void RemoveLegGroundPatternFromNotFreeLeg(int not_lift_leg_index, boost::dynamic_bitset<>* output);
103
104} // namespace designlab::com_func
105
106
107#endif // DESIGNLAB_COM_TYPE_H_
重心タイプに関する名前空間.Center of Mass Function の略.
Definition com_type.cpp:227
void RemoveLegGroundPatternFromCom(enums::DiscreteComPos discrete_com_pos, boost::dynamic_bitset<> *output)
離散化された重心位置から,その重心位置では取り得ない脚接地パターンを falseにする.
Definition com_type.cpp:246
LegGroundedMap::value_type LegGroundedMapValue
脚の接地パターンを表すマップの値の型.
Definition com_type.h:64
int GetLegGroundPatternNum()
脚の接地パターンの総数を返す.
Definition com_type.cpp:229
leg_func::LegGroundedBit GetLegGroundedBitFromLegGroundPatternIndex(const int leg_ground_pattern_index)
脚の接地パターンの番号から,その番号に該当する接地パターンを返す.
Definition com_type.cpp:234
void RemoveLegGroundPatternFromNotGroundableLeg(int not_groundable_leg_index, boost::dynamic_bitset<> *output)
接地できない脚番号から, その脚が接地できない場合に取り得ない接地パターンを falseにする.
Definition com_type.cpp:261
boost::bimaps::bimap< leg_func::LegGroundedBit, int > LegGroundedMap
脚の接地パターンを表す型.leftがビットのデータ,rightが int型の番号. bimaps::bimap は,左右の型の両方からアクセスできる map. key→value,value→key...
Definition com_type.h:61
void RemoveLegGroundPatternFromNotFreeLeg(int not_lift_leg_index, boost::dynamic_bitset<> *output)
遊脚できない脚番号から, その脚が遊脚できない場合に取り得ない接地パターンを falseにする.
Definition com_type.cpp:277
std::bitset< HexapodConst::kLegNum > LegGroundedBit
脚の遊脚・接地を表す型.6bitのビット型.接地が 1 遊脚が 0.
Definition leg_state.h:59
Definition com_type.h:24
bool operator<(const std::bitset< N > &lhs, const std::bitset< N > &rhs)
Definition com_type.h:28