29 std::stringstream stream;
69 std::stringstream stream;
72 stream <<
"Leg State Bit,";
73 stream <<
"Is Grounded, , , , , , ";
74 stream <<
"Discretized Leg Pos, , , , , , ";
75 stream <<
"Discretized Com Pos,";
76 stream <<
"Center of Mass[mm], , ,";
77 stream <<
"Quaternion, , , ,";
78 stream <<
"Leg Pos 0[mm], , ,Leg Pos 1[mm], , ,Leg Pos 2[mm], , ,";
79 stream <<
"Leg Pos 3[mm], , ,Leg Pos 4[mm], , ,Leg Pos 5[mm], , , ";
80 stream <<
"Reference Pos 0[mm],,,Reference Pos 1[mm],,,Reference Pos 2[mm],,,";
81 stream <<
"Reference Pos 3[mm],,,Reference Pos 4[mm],,,Reference Pos 5[mm],,,";
82 stream <<
"Next Move,";
83 stream <<
"Time[milli sec],";
84 stream <<
"Graph Search Result" << std::endl;
88 stream <<
"leg0,leg1,leg2,leg3,leg4,leg5,";
89 stream <<
"leg0,leg1,leg2,leg3,leg4,leg5,";
92 stream <<
"w,v-x,v-y,v-z,";
93 stream <<
"x,y,z,x,y,z,x,y,z,x,y,z,x,y,z,x,y,z,";
94 stream <<
"x,y,z,x,y,z,x,y,z,x,y,z,x,y,z,x,y,z,";
static constexpr int kLegNum
bool IsGrounded(const LegStateBit &leg_state, const int leg_index)
脚番号 leg_index 0 ~ 5 に応じて,その脚が接地しているかを調べる. 脚は右前脚を0番として,時計回りに0,1,2,3,4,5となる.左前足が5番.
enums::DiscreteComPos GetDiscreteComPos(const LegStateBit &leg_state)
現在の脚状態から重心パターンを取得する.
enums::DiscreteLegPos GetDiscreteLegPos(const LegStateBit &leg_state, const int leg_index)
脚状態を取得する.
std::string FloatingPointNumToString(const T num, const int digit=kDigit, const int width=kWidth)
小数を文字列に変換する関数. C++ では C のフォーマットのように %3.3f とかで小数を文字列に変換できないため自作する.
std::string EnumToStringRemoveTopK(const T &enum_value)
enumを文字列に変換する関数. Google C++ coding style だと enumの要素は 先頭にkをつけてキャメルケースで書くことが推奨されている. 例えば,
std::string message
成功時・失敗時のメッセージ.
enums::Result result
成功か失敗か.
std::string ToString() const
static std::string GetCsvHeader()
CSV形式のヘッダを返す.
GraphSearchResult graph_search_result
グラフ探索の結果,成功か失敗か.
double computation_time
グラフ探索にかかった計算時間 [milli sec]
std::string ToCsvString() const
構造体の内容をCSV形式の文字列にして返す. , (カンマ) で区切られる.
RobotStateNode result_node
グラフ探索によって選択されたノード.
std::array< Vector3, HexapodConst::kLegNum > leg_pos
[4 * 3 * 6 = 72 byte] 脚先の座標.(coxa(脚の付け根)を原点とする)
leg_func::LegStateBit leg_state
[4 byte] 脚状態,重心パターンを bitで表す.旧名 leg_con.
Vector3 center_of_mass_global_coord
[4 * 3 = 12byte] グローバル座標系における重心の位置.旧名 GCOM
Quaternion posture
[4 * 4 = 16byte] 姿勢を表すクォータニオン.
std::array< Vector3, HexapodConst::kLegNum > leg_reference_pos