GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
robot_operator_factory.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 "cassert_define.h"
11#include "robot_operation.h"
16#include "toml_file_importer.h"
17
18namespace designlab {
19
20std::unique_ptr<IRobotOperator> RobotOperatorFactory::Create(
21 const SimulationSettingRecord& setting) {
22 using enum enums::RobotOperateMode;
23
24 if (setting.operate_mode == kForGloabalPathGenerate) {
25 return std::make_unique<RobotOperatorForGpg>();
26 } else if (setting.operate_mode == kFixed) {
28
29 const auto operation =
32
33 return std::make_unique<RobotOperatorFixed>(operation);
34 } else if (setting.operate_mode == kForPath) {
35 return std::make_unique<RobotOperatorForPath>(setting.path_points);
36 } else {
37 assert(false);
38
39 return nullptr;
40 }
41}
42
43} // namespace designlab
static std::unique_ptr< IRobotOperator > Create(const SimulationSettingRecord &setting)
設定ファイルからTargetUpdaterを生成する.
static const char kTomlFileDirPath[]
TOMLファイルを入れるディレクトリのパス.
tomlファイルを読み込んで構造体に変換するテンプレートクラス.
T ImportOrUseDefault(const std::string &file_path) const
指定したファイルパスのファイルを読み込み,構造体に変換する. 読込に失敗した場合は,デフォルトの構造体を返す. また,読込に失敗した場合には, デフォルトの構造体をファイルに出力するかどうかをユーザに問...