HPM SDK
HPMicro Software Development Kit
hpm_mcl_path_plan.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 #ifndef HPM_MCL_PATH_PLAN_H
8 #define HPM_MCL_PATH_PLAN_H
9 
10 #include "hpm_mcl_common.h"
11 
16 typedef struct {
17  float acc;
18  float dec;
19  float speed;
20  float time;
21  float acc_time;
22  float dec_time;
24 
29 typedef struct {
31  float loop_ts;
33 
38 typedef struct {
40  int32_t *pole_num;
41  struct {
44  bool next_empty;
46  uint32_t ts;
47  uint32_t t0;
48  uint32_t t1;
49  uint32_t t2;
50  float a0;
51  float a1;
52  float a2;
53  } t_cure;
54  struct {
55  float next;
56  float last;
57  float current;
58  } theta;
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
74 
83 
91 
99 
107 
115 
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif
uint32_t hpm_mcl_stat_t
Definition: hpm_mcl_common.h:15
float hpm_mcl_path_get_next_theta(mcl_path_plan_t *path)
Get the next angle value after path planning.
Definition: hpm_mcl_path_plan.c:47
float hpm_mcl_path_get_current_theta(mcl_path_plan_t *path)
Get the angle value after path planning.
Definition: hpm_mcl_path_plan.c:42
hpm_mcl_stat_t hpm_mcl_path_update_t_cure(mcl_path_plan_t *path, path_plan_t_cure_cfg_t *cfg)
Updating data for trapezoidal curves.
Definition: hpm_mcl_path_plan.c:25
hpm_mcl_stat_t hpm_mcl_path_t_cure_generate(mcl_path_plan_t *path)
Generate trapezoidal curves, which need to be called periodically, at the same time as the loop_ts co...
Definition: hpm_mcl_path_plan.c:67
float hpm_mcl_path_get_last_theta(mcl_path_plan_t *path)
Get the last angle value after path planning.
Definition: hpm_mcl_path_plan.c:52
bool hpm_mcl_path_t_cure_complete(mcl_path_plan_t *path)
Get whether the curve is complete or not.
Definition: hpm_mcl_path_plan.c:57
hpm_mcl_stat_t hpm_mcl_path_init(mcl_path_plan_t *path, mcl_path_plan_cfg_t *cfg, mcl_cfg_t *mcl)
Initialising the data structure for path planning.
Definition: hpm_mcl_path_plan.c:10
Definition: hpm_mcl_common.h:238
Configuration of path planning.
Definition: hpm_mcl_path_plan.h:29
float loop_ts
Definition: hpm_mcl_path_plan.h:31
path_plan_t_cure_cfg_t t_cure
Definition: hpm_mcl_path_plan.h:30
Running data for path planning.
Definition: hpm_mcl_path_plan.h:38
uint32_t t0
Definition: hpm_mcl_path_plan.h:47
mcl_path_plan_cfg_t * cfg
Definition: hpm_mcl_path_plan.h:39
path_plan_t_cure_cfg_t next
Definition: hpm_mcl_path_plan.h:42
float current
Definition: hpm_mcl_path_plan.h:57
path_plan_t_cure_cfg_t current
Definition: hpm_mcl_path_plan.h:43
int32_t * pole_num
Definition: hpm_mcl_path_plan.h:40
bool next_empty
Definition: hpm_mcl_path_plan.h:44
float a2
Definition: hpm_mcl_path_plan.h:52
float next
Definition: hpm_mcl_path_plan.h:55
float a1
Definition: hpm_mcl_path_plan.h:51
float a0
Definition: hpm_mcl_path_plan.h:50
uint32_t t2
Definition: hpm_mcl_path_plan.h:49
bool current_empty
Definition: hpm_mcl_path_plan.h:45
float last
Definition: hpm_mcl_path_plan.h:56
uint32_t t1
Definition: hpm_mcl_path_plan.h:48
uint32_t ts
Definition: hpm_mcl_path_plan.h:46
Trapezoidal Curve Configuration.
Definition: hpm_mcl_path_plan.h:16
float acc
Definition: hpm_mcl_path_plan.h:17
float time
Definition: hpm_mcl_path_plan.h:20
float speed
Definition: hpm_mcl_path_plan.h:19
float acc_time
Definition: hpm_mcl_path_plan.h:21
float dec
Definition: hpm_mcl_path_plan.h:18
float dec_time
Definition: hpm_mcl_path_plan.h:22