GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
robot_operation.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_ROBOT_OPERATION_H_
9#define DESIGNLAB_ROBOT_OPERATION_H_
10
11#include <format>
12
13#include "math_quaternion.h"
14#include "string_util.h"
15#include "math_vector3.h"
17
18
19namespace designlab
20{
21
45
46
78
79
81{
82 DESIGNLAB_TOML11_FILE_ADD_DESCRIPTION("Note that this file is not referenced by some settings.");
83
85
86 DESIGNLAB_TOML11_VARIABLE_ADD_DESCRIPTION(straight_move_vector, "Param", "The value that is referenced when the setting is to go straight in the specified direction.");
87 DESIGNLAB_TOML11_VARIABLE_ADD_DESCRIPTION(straight_move_position, "Param", "The value that is referred to when the setting is to go straight to the specified coordinates.");
88 DESIGNLAB_TOML11_VARIABLE_ADD_DESCRIPTION(spot_turn_last_posture, "Param", "The value that is referenced when setting the camera to turn on the spot until it reaches the specified posture.");
89 DESIGNLAB_TOML11_VARIABLE_ADD_DESCRIPTION(spot_turn_rot_axis, "Param", "The value referred to when setting up in-situ turning around the specified axis (in the direction of right-hand threads).");
90 DESIGNLAB_TOML11_VARIABLE_ADD_DESCRIPTION(turn_center, "Param", "The value referred to when setting the rotation around the specified center.");
91 DESIGNLAB_TOML11_VARIABLE_ADD_DESCRIPTION(turn_radius, "Param", "The value referenced in the case of a setup that turns at a specified radius.");
92 DESIGNLAB_TOML11_VARIABLE_ADD_DESCRIPTION(turn_clockwise, "Param", "The value that is referenced when the setting is to turn in the specified direction.");
93
95 std::format("This is the setting of the robot's operation method. ({})", string_util::EnumValuesToString<RobotOperationType>(" / ")));
96};
97
98} // namespace designlab
99
100
103 straight_move_vector, straight_move_position, spot_turn_last_posture,
104 spot_turn_rot_axis, operation_type,
105 turn_center, turn_radius, turn_clockwise);
106
107
108#endif // DESIGNLAB_ROBOT_OPERATION_H_
std::string EnumValuesToString(const std::string separator)
enum型を渡すと,その要素を列挙した文字列を返す関数.
Definition string_util.h:75
RobotOperationType
Robotをどのように動かすかを表す列挙体.
@ kSpotTurnRotAxis
その場で旋回させる(回転軸を示し,その軸周りの右ねじの回転)
@ kStraightMoveVector
直線移動をさせる(移動したい方向をベクトルで示す)
@ kStraightMovePosition
直線移動をさせる(移動したい座標を示す)
@ kTurn
旋回中心と,旋回半径と,旋回方向を与えて旋回させる.
@ kSpotTurnLastPosture
その場で旋回させる(最終的な姿勢 Posture を示す)
@ kNone
何も動作をしない.
クォータニオンを表す構造体.
static Quaternion MakeByAngleAxis(float rad_angle, const Vector3 &axis)
回転軸と回転角からクォータニオンを作成する. q = cos(θ/2) * w + sin(θ/2) * { v.x + v.y + v.z } となる. ノルムは必ず1になる.
探索において目標となる座標や角度,評価する値についてまとめた構造体.
Vector2 turn_center
旋回中心.
Vector3 straight_move_vector
< 目標方向.正規化されたベクトル.
float turn_radius
旋回半径.
RobotOperationType operation_type
bool turn_clockwise
旋回方向.
Vector3 straight_move_position
目標姿勢 ( posture )
Quaternion spot_turn_last_posture
旋回時の回転軸.右ねじの回転.
2次元の位置ベクトルを表す構造体.
3次元の位置ベクトルを表す構造体.
static constexpr Vector3 GetUpVec() noexcept
上に進む単位ベクトルを返す. 静的な関数なので,Vector3::GetUpVec() と呼び出せる.
#define DESIGNLAB_TOML11_SERIALIZE(NAME,...)
tomlファイルのシリアライズ/デシリアライズを行うためのマクロ. TOML11_DEFINE_CONVERSION_NON_INTRUSIVEをラッパしたもの. もともとのほうでは enum型...
#define DESIGNLAB_TOML11_NO_TABLE
tomlファイルに追加する変数をテーブルに追加しないことを示すためのマクロ.
#define DESIGNLAB_TOML11_DESCRIPTION_CLASS(CLASS)
tomlファイルに説明を追加するためのクラスの宣言を行うためのマクロ.
#define DESIGNLAB_TOML11_TABLE_NO_DESCRIPTION()
tomlファイルに追加するテーブルにコメントを追加しないことを示すマクロ. DESIGNLAB_TOML11_DESCRIPTION_CLASS内に必ず記述する必要がある.
#define DESIGNLAB_TOML11_VARIABLE_ADD_DESCRIPTION(VARIABLE, TABLE, DESCRIPTION)
tomlファイルに変数とファイルの説明を追加するためのマクロ.
#define DESIGNLAB_TOML11_FILE_ADD_DESCRIPTION(DESCRIPTION)
tomlファイルにファイルの説明を追加するためのマクロ. DESIGNLAB_TOML11_DESCRIPTION_CLASS内に必ず記述する必要がある.