forked from cvra/nastya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobstacle_avoidance_protocol.h
46 lines (32 loc) · 1.19 KB
/
obstacle_avoidance_protocol.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef OBSTACLE_AVOIDANCE_H_
#define OBSTACLE_AVOIDANCE_H_
#include <lwip/ip.h>
typedef struct {
int x,y; /* mm */
int vx, vy; /* mm / s */
int r; /* mm */
} obstacle_avoidance_obstacle_t;
typedef struct {
int vx, vy;
int x, y;
int timestamp;
} obstacle_avoidance_point_t;
typedef struct {
obstacle_avoidance_point_t *points;
int len;
} obstacle_avoidance_path_t;
typedef struct {
int desired_datapoints;
int desired_samplerate; /* ms */
obstacle_avoidance_point_t start;
obstacle_avoidance_point_t end;
obstacle_avoidance_obstacle_t *obstacles;
int obstacle_count;
} obstacle_avoidance_request_t;
void obstacle_avoidance_request_create(obstacle_avoidance_request_t *r, int obstacle_count);
void obstacle_avoidance_request_delete(obstacle_avoidance_request_t *r);
char *obstacle_avoidance_request_encode(obstacle_avoidance_request_t *r);
int obstacle_avoidance_decode_path(obstacle_avoidance_path_t *path,const char *json);
void obstacle_avoidance_delete_path(obstacle_avoidance_path_t *path);
int obstacle_avoidance_send_request(obstacle_avoidance_request_t *request, struct ip_addr remote_ip, int port, obstacle_avoidance_path_t *path);
#endif