Statistics
| Revision:

root / branches / simulator / projects / simulator / simulator / core / robot.h @ 1089

History | View | Annotate | Download (997 Bytes)

1
/**
2
 * @file robot.h
3
 * @author Colony Project
4
 *
5
 * @brief Manages simulated robots.
6
 *
7
 * Contains structures and function prototypes used
8
 * for managing robots in the simulator.
9
 **/
10

    
11
#ifndef __ROBOT_H__
12
#define __ROBOT_H__
13

    
14
#include "robot_shared.h"
15

    
16
typedef struct PoseType
17
{
18
        float x,y; /* position of robot in environment */
19
        float theta; /* orientation of robot in environment */
20
} Pose;
21

    
22
typedef struct RobotType
23
{
24
        // the id is 0 if the robot hasn't been created
25
        int id;
26
        int pid;
27
        int sharedMemID; /* id for shared memory object */
28
        Pose pose; /* position in environment */
29

    
30
        RobotShared* shared;
31
        /* add other sensors, etc here */
32
} Robot;
33

    
34
int robots_initialize(void);
35
int robots_cleanup(void);
36
int robot_create(char *execname);
37
int robot_destroy(int id);
38

    
39
void robot_iterator_reset(void);
40
Robot* robot_iterator_next(void);
41
Robot* robot_get(int id);
42

    
43
void* robot_event_loop(void* arg);
44
void* logger_step_loop(void* arg);
45

    
46
void robots_pause(void);
47
void robots_resume(void);
48

    
49
#endif
50