aboutsummaryrefslogtreecommitdiff
path: root/src/rate.h
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-11 22:28:13 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-11 22:47:34 +0000
commitcb070b2d3f2b6e241e3be1b7e0eeb90fc755255f (patch)
treec7d90c0abe9533c87d51b5196871846855efa1ba /src/rate.h
downloadthesis-master.tar.gz
publishHEADmaster
Diffstat (limited to 'src/rate.h')
-rw-r--r--src/rate.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/rate.h b/src/rate.h
new file mode 100644
index 0000000..b75b064
--- /dev/null
+++ b/src/rate.h
@@ -0,0 +1,40 @@
1#ifndef INCLUDED_RATE_H
2#define INCLUDED_RATE_H
3
4#include "motion_planner.h"
5
6struct work_motion_stats {
7 double dt;
8
9 double active_time; /* s */
10 double active_length; /* mm */
11 uint32_t active_segment_count;
12 uint32_t sample_count;
13
14 /*
15 * Отклонение скорости на рабочих участках.
16 *
17 * Ошибка считается как:
18 * e(t) = sample.v - segment.v_nominal
19 */
20 double speed_error_max_abs; /* mm/s */
21 double speed_error_mean_abs; /* mm/s */
22 double speed_error_rms; /* mm/s */
23
24 double speed_error_abs_integral; /* mm, т.к. integral |e| dt */
25 double speed_error_sq_integral; /* mm^2/s, т.к. integral e^2 dt */
26
27 /*
28 * Общий рывок на рабочих участках.
29 *
30 * Используется sample.j_abs, то есть модуль полного векторного рывка,
31 * а не только тангенциальный j_t.
32 */
33 double jerk_abs_integral; /* mm/s^2, т.к. integral |j| dt */
34 double jerk_abs_mean; /* mm/s^3 */
35 double jerk_abs_max; /* mm/s^3 */
36};
37
38struct work_motion_stats measure_work_motion_stats (const struct path *, const struct motion_plan *, double dt);
39
40#endif // INCLUDED_RATE_H