80 const float Ts = 1.5e-3f;
86 for (
int i = 0; i < 3; ++i) {
93 v *= y_curve_end / s.
q.
y;
97 const float sin_th = std::sin(
total.
th);
98 const float cos_th = std::cos(
total.
th);
100 if (std::abs(sin_th) < 1e-3f) {
145 const float t,
const float Ts,
const float k_slip = 0) {
147 const std::array<float, 3> th{{ad.
x(t), ad.
x(t + Ts / 2), ad.
x(t + Ts)}};
148 const std::array<float, 3> w{{ad.
v(t), ad.
v(t + Ts / 2), ad.
v(t + Ts)}};
149 std::array<float, 3> cos_th;
150 std::array<float, 3> sin_th;
151 for (
int i = 0; i < 3; ++i) {
152 const auto th_slip = std::atan(-k_slip * v * w[i]);
153 cos_th[i] = std::cos(th[i] + th_slip);
154 sin_th[i] = std::sin(th[i] + th_slip);
157 s.
q.
x += v * Ts * (cos_th[0] + 4 * cos_th[1] + cos_th[2]) / 6;
158 s.
q.
y += v * Ts * (sin_th[0] + 4 * sin_th[1] + sin_th[2]) / 6;
160 s.
dq.
x = v * cos_th[2];
161 s.
dq.
y = v * sin_th[2];
162 s.
q.
th = ad.
x(t + Ts);
163 s.
dq.
th = ad.
v(t + Ts);
175 os <<
"Slalom Shape" << std::endl;
176 os <<
"\ttotal:\t" << obj.
total << std::endl;
177 os <<
"\tcurve:\t" << obj.
curve << std::endl;
178 os <<
"\tv_ref:\t" << obj.
v_ref << std::endl;
179 os <<
"\tstraight_prev:\t" << obj.
straight_prev << std::endl;
180 os <<
"\tstraight_post:\t" << obj.
straight_post << std::endl;
183 os <<
"\tintegral error:\t" << obj.
total - end << std::endl;
距離の拘束を満たす加減速走行軌道を生成するクラスを保持するファイル
拘束条件を満たす曲線加減速の軌道を生成するクラス
Definition: accel_designer.h:33
float j(const float t) const
任意の時刻 t [s] における躍度 j [m/s/s/s] を返す関数
Definition: accel_designer.h:167
float a(const float t) const
任意の時刻 t [s] における加速度 a [m/s/s] を返す関数
Definition: accel_designer.h:178
float t_end() const
終点時刻 [s]
Definition: accel_designer.h:209
float x(const float t) const
任意の時刻 t [s] における位置 x [m] を返す関数
Definition: accel_designer.h:200
float v(const float t) const
任意の時刻 t [s] における速度 v [m/s] を返す関数
Definition: accel_designer.h:189
void reset(const float j_max, const float a_max, const float v_max, const float v_start, const float v_target, const float dist, const float x_start=0, const float t_start=0)
引数の拘束条件から曲線を生成する関数
Definition: accel_designer.h:70
static constexpr float dth_max_default
最大角速度のデフォルト値 [rad/s]
Definition: slalom.h:39
static constexpr float dddth_max_default
最大角躍度のデフォルト値 [rad/s/s/s]
Definition: slalom.h:31
static constexpr float ddth_max_default
最大角加速度のデフォルト値 [rad/s/s]
Definition: slalom.h:35
制御関係の名前空間
Definition: accel_curve.h:54
位置姿勢の座標
Definition: pose.h:18
float y
y 成分 [m]
Definition: pose.h:20
Pose rotate(const float angle) const
Definition: pose.h:28
float x
x 成分 [m]
Definition: pose.h:19
float th
theta 成分 [rad]
Definition: pose.h:21
軌道制御の状態変数
Definition: state.h:20
Pose dq
Definition: state.h:22
Pose q
Definition: state.h:21
Pose dddq
Definition: state.h:24
Pose ddq
Definition: state.h:23
slalom::Shape スラロームの形状を表す構造体
Definition: slalom.h:48
float v_ref
カーブ部分の基準速度 [m/s]
Definition: slalom.h:53
Pose total
前後の直線を含めた移動位置姿勢
Definition: slalom.h:49
Pose curve
カーブ部分の移動位置姿勢
Definition: slalom.h:50
static void integrate(const AccelDesigner &ad, State &s, const float v, const float t, const float Ts, const float k_slip=0)
軌道の積分を行う関数。ルンゲクッタ法を使用して数値積分を行う。
Definition: slalom.h:144
float dddth_max
最大角躍度の大きさ [rad/s/s/s]
Definition: slalom.h:54
friend std::ostream & operator<<(std::ostream &os, const Shape &obj)
情報の表示
Definition: slalom.h:174
float ddth_max
最大角加速度の大きさ [rad/s/s]
Definition: slalom.h:55
float straight_prev
カーブ前の直線の距離 [m]
Definition: slalom.h:51
float straight_post
カーブ後の直線の距離 [m]
Definition: slalom.h:52
Shape(const Pose &total, const float y_curve_end, const float x_adv=0, const float dddth_max=dddth_max_default, const float ddth_max=ddth_max_default, const float dth_max=dth_max_default)
拘束条件からスラローム形状を生成するコンストラクタ
Definition: slalom.h:71
float dth_max
最大角速度の大きさ [rad/s]
Definition: slalom.h:56
Shape(const Pose &total, const Pose &curve, float straight_prev, const float straight_post, const float v_ref, const float dddth_max, const float ddth_max, const float dth_max)
生成済みスラローム形状を単に代入するコンストラクタ
Definition: slalom.h:123