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 <boost/bimap.hpp>
13#include <boost/dynamic_bitset.hpp>
14#include <unordered_map>
15#include <vector>
16
17#include "discrete_com_pos.h"
18#include "hexapod_const.h"
19#include "leg_state.h"
20
21namespace std {
22
23// boost bimapのために比較演算子を定義している.
24template <size_t N>
25bool operator<(const std::bitset<N>& lhs, const std::bitset<N>& rhs) {
26 return lhs.to_ulong() < rhs.to_ulong();
27}
28
29} // namespace std
30
48namespace designlab::com_func {
49
56using LegGroundedMap = boost::bimaps::bimap<leg_func::LegGroundedBit, int>;
57
59using LegGroundedMapValue = LegGroundedMap::value_type;
60
64
70 int leg_ground_pattern_index);
71
79 boost::dynamic_bitset<>* output);
80
89 int not_groundable_leg_index, boost::dynamic_bitset<>* output);
90
98void RemoveLegGroundPatternFromNotFreeLeg(int not_lift_leg_index,
99 boost::dynamic_bitset<>* output);
100
101} // namespace designlab::com_func
102
103#endif // DESIGNLAB_COM_TYPE_H_
重心タイプに関する名前空間.Center of Mass Function の略.
Definition com_type.cpp:202
void RemoveLegGroundPatternFromCom(enums::DiscreteComPos discrete_com_pos, boost::dynamic_bitset<> *output)
離散化された重心位置から,その重心位置では取り得ない脚接地パターンを falseにする.
Definition com_type.cpp:216
LegGroundedMap::value_type LegGroundedMapValue
脚の接地パターンを表すマップの値の型.
Definition com_type.h:59
int GetLegGroundPatternNum()
脚の接地パターンの総数を返す.
Definition com_type.cpp:204
leg_func::LegGroundedBit GetLegGroundedBitFromLegGroundPatternIndex(const int leg_ground_pattern_index)
脚の接地パターンの番号から,その番号に該当する接地パターンを返す.
Definition com_type.cpp:206
void RemoveLegGroundPatternFromNotGroundableLeg(int not_groundable_leg_index, boost::dynamic_bitset<> *output)
接地できない脚番号から, その脚が接地できない場合に取り得ない接地パターンを falseにする.
Definition com_type.cpp:229
boost::bimaps::bimap< leg_func::LegGroundedBit, int > LegGroundedMap
脚の接地パターンを表す型.leftがビットのデータ,rightが int型の番号. bimaps::bimap は,左右の型の両方からアクセスできる map. key→value,...
Definition com_type.h:56
void RemoveLegGroundPatternFromNotFreeLeg(int not_lift_leg_index, boost::dynamic_bitset<> *output)
遊脚できない脚番号から, その脚が遊脚できない場合に取り得ない接地パターンを falseにする.
Definition com_type.cpp:243
std::bitset< HexapodConst::kLegNum > LegGroundedBit
脚の遊脚・接地を表す型.6bitのビット型.接地が 1 遊脚が 0.
Definition leg_state.h:58
Definition com_type.h:21
bool operator<(const std::bitset< N > &lhs, const std::bitset< N > &rhs)
Definition com_type.h:25