2022-12-10 14:29:04 +00:00
|
|
|
#ifndef TRAJECTOIRE_H
|
|
|
|
#define TRAJECTOIRE_H
|
|
|
|
|
|
|
|
enum trajectoire_type_t{
|
|
|
|
TRAJECTOIRE_DROITE,
|
|
|
|
TRAJECTOIRE_CIRCULAIRE,
|
2023-03-03 15:37:36 +00:00
|
|
|
TRAJECTOIRE_BEZIER,
|
|
|
|
TRAJECTOIRE_ROTATION,
|
2022-12-10 14:29:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct point_xy_t{
|
2023-05-06 21:46:00 +00:00
|
|
|
double x, y;
|
2022-12-10 14:29:04 +00:00
|
|
|
};
|
|
|
|
|
2023-02-19 16:56:45 +00:00
|
|
|
struct point_xyo_t{
|
|
|
|
struct point_xy_t point_xy;
|
2023-04-28 21:51:43 +00:00
|
|
|
float orientation;
|
2023-02-19 16:56:45 +00:00
|
|
|
};
|
|
|
|
|
2022-12-10 14:29:04 +00:00
|
|
|
struct trajectoire_t {
|
|
|
|
enum trajectoire_type_t type;
|
|
|
|
struct point_xy_t p1, p2, p3, p4;
|
2023-04-28 21:51:43 +00:00
|
|
|
float orientation_debut_rad, orientation_fin_rad;
|
|
|
|
float rayon, angle_debut_degre, angle_fin_degre;
|
|
|
|
float longueur;
|
2022-12-10 14:29:04 +00:00
|
|
|
};
|
|
|
|
|
2023-04-28 21:51:43 +00:00
|
|
|
float Trajectoire_get_longueur_mm(struct trajectoire_t * trajectoire);
|
2023-05-06 21:46:00 +00:00
|
|
|
struct point_xyo_t Trajectoire_get_point(struct trajectoire_t * trajectoire, double abscisse);
|
2023-04-28 21:51:43 +00:00
|
|
|
float Trajectoire_get_orientation_rad(struct trajectoire_t * trajectoire, float abscisse);
|
2023-05-06 21:46:00 +00:00
|
|
|
float Trajectoire_avance(struct trajectoire_t * trajectoire, double abscisse, double distance_mm);
|
|
|
|
double distance_points(struct point_xy_t point, struct point_xy_t point_old);
|
2023-04-28 21:51:43 +00:00
|
|
|
void Trajectoire_circulaire(struct trajectoire_t * trajectoire, float centre_x, float centre_y, float angle_debut_degre, float angle_fin_degre,
|
|
|
|
float rayon, float orientation_debut_rad, float orientation_fin_rad);
|
|
|
|
void Trajectoire_droite(struct trajectoire_t * trajectoire, float p1_x, float p1_y, float p2_x, float p2_y, float orientation_debut_rad, float orientation_fin_rad);
|
|
|
|
void Trajectoire_bezier(struct trajectoire_t * trajectoire, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y,
|
|
|
|
float orientation_debut_rad, float orientation_fin_rad);
|
|
|
|
void Trajectoire_rotation(struct trajectoire_t * trajectoire, float p1_x, float p1_y, float orientation_debut_rad, float orientation_fin_rad);
|
2023-02-19 16:56:45 +00:00
|
|
|
void Trajectoire_inverse(struct trajectoire_t * trajectoire);
|
2022-12-10 14:29:04 +00:00
|
|
|
|
|
|
|
#endif
|