74 auto v_end = v_target;
77 j_max, a_max, v_start,
v_end);
78 if (std::abs(dist) < std::abs(dist_min)) {
79 ctrl_logd <<
"vs -> ve != vt" << std::endl;
85 auto v_sat = dist > 0 ? std::max({v_start, v_max,
v_end})
86 : std::min({v_start, -v_max,
v_end});
88 ac.
reset(j_max, a_max, v_start, v_sat);
92 if (std::abs(dist) < std::abs(d_sum)) {
93 ctrl_logd <<
"vs -> vr -> ve" << std::endl;
96 j_max, a_max, v_start,
v_end, dist);
98 v_sat = dist > 0 ? std::max({v_start, v_rm,
v_end})
99 : std::min({v_start, v_rm,
v_end});
100 ac.
reset(j_max, a_max, v_start, v_sat);
104 if (std::abs(v_sat) < std::numeric_limits<float>::epsilon()) v_sat = 1;
115 const auto e = 0.01f;
116 bool show_info =
false;
123 if (std::abs(v_start -
v_end) > e + std::abs(v_start - v_target)) {
124 std::cerr <<
"Error: Velocity Target!" << std::endl;
128 if (std::abs(v_sat) >
129 e + std::max({v_max, std::abs(v_start), std::abs(
v_end)})) {
130 std::cerr <<
"Error: Velocity Saturation!" << std::endl;
135 ctrl_loge <<
"Error: Time Point Relationship!" << std::endl;
141 <<
"\tj_max: " << j_max <<
"\ta_max: " << a_max
142 <<
"\tv_max: " << v_max <<
"\tv_start: " << v_start
143 <<
"\tv_target: " << v_target <<
"\tdist: " << dist
145 ctrl_loge <<
"ad.reset(" << j_max <<
", " << a_max <<
", " << v_max
146 <<
", " << v_start <<
", " << v_target <<
", " << dist <<
");"
150 <<
"\tt0: " <<
t0 <<
"\tt1: " <<
t1 <<
"\tt2: " <<
t2
151 <<
"\tt3: " <<
t3 << std::endl;
154 <<
"\tx2: " <<
x0 + (dist -
dc.
x_end()) <<
"\tx3: " <<
x3
157 <<
"\tv0: " << v_start <<
"\tv1: " <<
v(
t1) <<
"\tv2: " <<
v(
t2)
158 <<
"\tv3: " <<
v_end << std::endl;
#define ctrl_logd
Definition: accel_curve.h:48
#define ctrl_loge
Definition: accel_curve.h:28
static float calcReachableVelocityMax(const float j_max, const float a_max, const float vs, const float ve, const float d)
走行距離の拘束から達しうる最大速度を算出する関数
Definition: accel_curve.h:316
float x_end() const
終点位置 [m]
Definition: accel_curve.h:206
void reset(const float j_max, const float a_max, const float v_start, const float v_end)
引数の拘束条件から曲線を生成する関数
Definition: accel_curve.h:92
float t_end() const
終点時刻 [s]
Definition: accel_curve.h:198
static float calcReachableVelocityEnd(const float j_max, const float a_max, const float vs, const float vt, const float d)
走行距離の拘束から達しうる終点速度を算出する関数
Definition: accel_curve.h:263
static float calcDistanceFromVelocityStartToEnd(const float j_max, const float a_max, const float v_start, const float v_end)
速度差の拘束から達しうる変位を算出する関数
Definition: accel_curve.h:345
float v_end() const
終点速度 [m/s]
Definition: accel_designer.h:213