GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
result_file_exporter.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_RESULT_FILE_EXPORTER_H_
9#define DESIGNLAB_RESULT_FILE_EXPORTER_H_
10
11#include <fstream>
12#include <memory>
13#include <string>
14#include <vector>
15
17#include "robot_state_node.h"
19
20
21namespace designlab
22{
23
24class ResultFileConst final
25{
26public:
28 static const std::string kDirectoryPath;
29
31 static const std::string kLegDirectoryName;
32
34 static const std::string kSuccessfulCount;
35
37 static const std::string kDetailFileName;
38
40 static const std::string kNodeListName;
41
43 static const std::string kMapStateName;
44};
45
46
51{
52public:
54 const std::shared_ptr<const IHexapodJointCalculator>& calculator_ptr);
55
58
61 void PushSimulationResult(const SimulationResultRecord& simulation_result);
62
64 void Export() const;
65
66private:
69 std::string MakeOutputDirectory() const;
70
73 void ExportEachNodeList(const std::string& path) const;
74
77 void ExportEachMapState(const std::string& path) const;
78
81 void ExportEachSimulationDetail(const std::string& path) const;
82
88 void ExportSuccessfulCount(const std::string& path) const;
89
92 void ExportEachLegPos(const std::string& path) const;
93
95 void ExportAllLegPos(const std::string& path) const;
96
99 void ExportEachLegPosAllSuccessfulSimulation(const std::string& path) const;
100
101 void ExportAllLegPosAllSuccessfulSimulation(const std::string& path) const;
102
103 std::string GetHeader() const;
104
105 std::string GetLegChangeStatus(
106 const std::optional<Vector3>& past, const Vector3& current) const;
107
109 std::vector<SimulationResultRecord> result_list_;
110
112 const std::shared_ptr<const IHexapodJointCalculator> calculator_ptr_;
113};
114
115} // namespace designlab
116
117
118#endif // DESIGNLAB_RESULT_FILE_EXPORTER_H_
static const std::string kLegDirectoryName
出力先ディレクトリ(フォルダ)名.
static const std::string kNodeListName
ノードリストのファイル名 (プログラムの読み込み用)
static const std::string kDetailFileName
ファイル名 ( 人間が見る用 )
static const std::string kSuccessfulCount
シミュレーションの成功回数をまとめたファイルの名前.
static const std::string kDirectoryPath
出力先ディレクトリ(フォルダ)名.
static const std::string kMapStateName
マップ状態のファイル名 (プログラムの読み込み用)
結果をファイルに出力するクラス. シミュレーション結果をファイルに出力する処理を全てこのクラスにまとめた.
void PushSimulationResult(const SimulationResultRecord &simulation_result)
シミュレーション結果を追加する.
void Export() const
結果をファイルに出力する.
void CreateRootDirectory()
resultフォルダがなければ作成する.また,フォルダ名を指定する.
シミュレーションの結果を格納する構造体.
3次元の位置ベクトルを表す構造体.