Project

General

Profile

Statistics
| Revision:

root / branches / simulator / projects / simulator / common / robot_shared.h @ 987

History | View | Annotate | Download (975 Bytes)

1
/* shared structs for simulator */
2

    
3
#ifndef __ROBOT_SHARED_H
4
#define __ROBOT_SHARED_H
5

    
6
typedef struct PositionType
7
{
8
  int x,y; /* position of robot in environment */
9
  int theta; /* orientation of robot in environment */
10
} Position;
11

    
12

    
13
/* rangefinders are 1-5, so write convert function for this */
14
typedef struct RangeFinderType
15
{
16
  short d[5];
17
} RangeFinder;
18

    
19
/* this is what is in the robot shared memory */
20
typedef struct RobotSharedType
21
{
22
        short motor1; /* motor1 value */
23
        short motor2; /* motor2 value */
24
  RangeFinder ranges; /* rangefinders */
25
  /* add other sensors, etc here */
26
} RobotShared;
27

    
28

    
29
typedef struct SimulatorRobotType
30
{
31
  int robotSharedMemoryID; /* id for shared memory object */
32
  RobotShared* robotState;/*Pointer to shared state*/
33

    
34
  Position pos; /* position in environment */
35
        short motor1; /* motor1 value */
36
        short motor2; /* motor2 value */
37
  RangeFinder ranges; /* rangefinders */
38
  /* add other sensors, etc here */
39
} SimulatorRobot;
40

    
41
#endif