rflex-info.h
1 /* Player - One Hell of a Robot Server
2  * Copyright (C) 2000
3  * Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard
4  *
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  */
21 
22 #ifndef RFLEX_INFO_H
23 #define RFLEX_INFO_H
24 
25 #ifndef TRUE
26 #define TRUE 1
27 #endif
28 
29 #ifndef FALSE
30 #define FALSE 0
31 #endif
32 
33 #define MAX_NAME_LENGTH 256
34 #define MAX_COMMAND_LENGTH 256
35 #define MAX_ACMD_SIZE 48
36 #define MAX_NUM_LOOPS 30
37 #define MAX_BUFFER_LENGTH 4096
38 
39 #define EPSILON 0.0001
40 
41 #define TIMEOUT -1
42 #define WRONG 0
43 #define OK 1
44 
45 #define B_STX 0x02
46 #define B_ETX 0x03
47 #define B_ESC 0x1b
48 
49 #define STD_TRANS_TORQUE 30000
50 #define STD_ROT_ACC 100000
51 #define STD_ROT_TORQUE 35000
52 
53 #define SYS_PORT 1
54 #define MOT_PORT 2
55 #define JSTK_PORT 3
56 #define SONAR_PORT 4
57 #define DIO_PORT 5
58 #define IR_PORT 6
59 
60 #define SYS_LCD_DUMP 0
61 #define SYS_STATUS 1
62 
63 #define MOT_AXIS_GET_SYSTEM 0
64 #define MOT_AXIS_GET_MODEL 1
65 #define MOT_AXIS_GET_TARGET 2
66 #define MOT_AXIS_SET_LIMITS 3
67 #define MOT_AXIS_GET_LIMITS 4
68 #define MOT_AXIS_SET_POS_LIMITS 5
69 #define MOT_AXIS_GET_POS_LIMITS 6
70 #define MOT_AXIS_SET_DIR 7
71 #define MOT_AXIS_SET_POS 8
72 #define MOT_AXIS_GET_MODE 9
73 #define MOT_SET_DEFAULTS 10
74 #define MOT_BRAKE_SET 11
75 #define MOT_BRAKE_RELEASE 12
76 #define MOT_SYSTEM_REPORT 33
77 #define MOT_SYSTEM_REPORT_REQ 34
78 #define MOT_GET_NAXES 65
79 #define MOT_SET_GEARING 66
80 #define MOT_GET_GEARING 67
81 #define MOT_MOTOR_SET_MODE 68
82 #define MOT_MOTOR_GET_MODE 69
83 #define MOT_MOTOR_SET_PARMS 70
84 #define MOT_MOTOR_GET_PARMS 71
85 #define MOT_MOTOR_SET_LIMITS 72
86 #define MOT_MOTOR_GET_LIMITS 73
87 #define MOT_MOTOR_GET_DATA 74
88 #define MOT_AXIS_SET_PARMS 75
89 #define MOT_AXIS_GET_PARMS 76
90 #define MOT_AXIS_SET_PWM_LIMIT 77
91 #define MOT_AXIS_GET_PWM_LIMIT 78
92 #define MOT_AXIS_SET_PWM 79
93 #define MOT_AXIS_GET_PWM 80
94 
95 #define SONAR_RUN 0
96 #define SONAR_GET_UPDATE 1
97 #define SONAR_REPORT 2
98 
99 #define DIO_REPORTS_REQ 0
100 #define DIO_REPORT 1
101 #define DIO_GET_UPDATE 2
102 #define DIO_UPDATE 3
103 #define DIO_SET 4
104 
105 #define IR_RUN 0
106 #define IR_REPORT 1
107 
108 #define JSTK_GET_STATE 0
109 
110 enum PARITY_TYPE { N, E, O };
111 
112 typedef struct {
113  char ttyport[MAX_NAME_LENGTH];
114  int baud;
115  enum PARITY_TYPE parity;
116  int fd;
117  int databits;
118  int stopbits;
119  int hwf;
120  int swf;
121 } RFLEX_Device;
122 
123 #endif
Definition: rflex-info.h:112