s2types.h
1 /* ====================================================================
2  * Copyright (c) 1999-2004 Carnegie Mellon University. All rights
3  * reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  *
17  *
18  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
19  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
22  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  * ====================================================================
31  *
32  */
33 
34 /*
35  * prim_type.h -- Primitive types; more machine-independent.
36  *
37  * **********************************************
38  * CMU ARPA Speech Project
39  *
40  * Copyright (c) 1999 Carnegie Mellon University.
41  * ALL RIGHTS RESERVED.
42  * **********************************************
43  *
44  * HISTORY
45  *
46  * $Log$
47  * Revision 1.2 2008/03/03 21:46:04 gerkey
48  * inserted new s2types.h, following user experience
49  *
50  * Revision 1.1 2006/04/20 01:05:29 gerkey
51  * changed sphinx2 configure check, added s2types.h
52  *
53  * Revision 1.7 2005/10/04 23:56:30 dhdfu
54  * Explicitly define int8 as signed, otherwise it will be unsigned on ARM
55  * and PowerPC, and Sphinx3 model definition files won't work.
56  *
57  * Revision 1.6 2004/12/10 16:48:56 rkm
58  * Added continuous density acoustic model handling
59  *
60  *
61  * 12-Mar-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon
62  * Added some useful constant definitions.
63  *
64  * Revision 1.5 2004/07/16 00:57:10 egouvea
65  * Added Ravi's implementation of FSG support.
66  *
67  * Revision 1.2 2004/05/27 14:22:57 rkm
68  * FSG cross-word triphones completed (but for single-phone words)
69  *
70  * Revision 1.1.1.1 2004/03/01 14:30:20 rkm
71  *
72  *
73  * Revision 1.3 2004/02/09 21:19:35 rkm
74  * Added bool
75  *
76  * Revision 1.2 2004/01/23 19:20:03 rkm
77  * *** empty log message ***
78  *
79  *
80  * 02-Aug-1999 Kevin A. Lenzo (lenzo@cs.cmu.edu) at Carnegie Mellon
81  * Copied from s3 and cut out everything but the typedefs.
82  *
83  * 12-Mar-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon
84  * Added arraysize_t, point_t, fpoint_t.
85  *
86  * 01-Feb-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon
87  * Added anytype_t.
88  *
89  * 08-31-95 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon
90  * Created.
91  */
92 
93 
94 #ifndef __S2TYPES_H__
95 #define __S2TYPES_H__
96 
97 
98 typedef int int32;
99 typedef short int16;
100 typedef signed char int8;
101 typedef unsigned int uint32;
102 typedef unsigned short uint16;
103 typedef unsigned char uint8;
104 typedef float float32;
105 typedef double float64;
106 typedef unsigned char boolean;
107 
108 #ifndef TRUE
109 #define TRUE 1
110 #endif
111 #ifndef FALSE
112 #define FALSE 0
113 #endif
114 
115 #ifndef NULL
116 #define NULL (void *)0
117 #endif
118 
119 
120 /* Useful constants */
121 #define MAX_INT32 ((int32) 0x7fffffff)
122 #define MAX_INT16 ((int16) 0x00007fff)
123 #define MAX_INT8 ((int8) 0x0000007f)
124 
125 #define MAX_NEG_INT32 ((int32) 0x80000000)
126 #define MAX_NEG_INT16 ((int16) 0xffff8000)
127 #define MAX_NEG_INT8 ((int8) 0xffffff80)
128 
129 #define MAX_UINT64 ((uint64) 0xffffffffffffffff)
130 #define MAX_UINT32 ((uint32) 0xffffffff)
131 #define MAX_UINT16 ((uint16) 0x0000ffff)
132 #define MAX_UINT8 ((uint8) 0x000000ff)
133 
134 /* The following are approximate; IEEE floating point standards might quibble! */
135 #define MAX_POS_FLOAT32 3.4e+38f
136 #define MIN_POS_FLOAT32 1.2e-38f /* But not 0 */
137 #define MAX_POS_FLOAT64 1.8e+307
138 #define MIN_POS_FLOAT64 2.2e-308
139 
140 /* Will the following really work?? */
141 #define MAX_NEG_FLOAT32 ((float32) (-MAX_POS_FLOAT32))
142 #define MIN_NEG_FLOAT32 ((float32) (-MIN_POS_FLOAT32))
143 #define MAX_NEG_FLOAT64 ((float64) (-MAX_POS_FLOAT64))
144 #define MIN_NEG_FLOAT64 ((float64) (-MIN_POS_FLOAT64))
145 
146 /*
147 typedef union anytype_s {
148  boolean boolean;
149  int8 int8;
150  uint8 uint8;
151  int16 int16;
152  uint16 uint16;
153  int32 int32;
154  uint32 uint32;
155  float32 float32;
156  float64 float64;
157  void *ptr;
158 } anytype_t;
159 */
160 
161 #endif
#define PLAYER_WARN1(msg, a)
Error message macros.
Definition: error.h:89
Request/reply: Get/set scan properties.
Definition: player_interfaces.h:961
#define PLAYER_MSG1(level, msg, a)
Error message macros.
Definition: error.h:105
#define PLAYER_GPS_DATA_STATE
Data: state (PLAYER_GPS_DATA_STATE)
Definition: player_interfaces.h:1834
#define PLAYER_LASER_DATA_SCAN
Data subtype: scan.
Definition: player_interfaces.h:845
static bool MatchMessage(player_msghdr_t *hdr, int type, int subtype, player_devaddr_t addr)
Helper for message processing.
Definition: message.h:158
#define PLAYER_LASER_REQ_SET_CONFIG
Request/reply subtype: set configuration.
Definition: player_interfaces.h:857
Claser implements functions to read data from a laser scanner ROTOSCAN RS4-4 (Leuze corp....
Definition: RS4Leuze_laser.h:52
double ReadTupleLength(int section, const char *name, int index, double value)
Read a length from a tuple (includes units conversion)
Generic message header.
Definition: player.h:160
virtual int MainSetup(void)
Sets up the resources needed by the driver thread.
Definition: driver.h:657
virtual void MainQuit(void)
Cleanup method for driver thread (called when main exits)
Definition: driver.h:663
const char * ReadString(int section, const char *name, const char *value)
Read a string value.
uint8_t subtype
Message subtype; interface specific.
Definition: player.h:167
virtual void Main(void)=0
Main method for driver thread.
double ReadAngle(int section, const char *name, double value)
Read an angle (includes unit conversion).
int ReadInt(int section, const char *name, int value)
Read an integer value.
#define PLAYER_MSGTYPE_DATA
A data message.
Definition: player.h:94
#define PLAYER_MSGTYPE_RESP_ACK
A positive response message.
Definition: player.h:111
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
#define PLAYER_MSGTYPE_REQ
A request message.
Definition: player.h:105
#define PLAYER_LASER_REQ_GET_GEOM
Request/reply subtype: get geometry.
Definition: player_interfaces.h:854
Definition: RS4Leuze_laser.h:44
Request/reply: Get geometry.
Definition: player_interfaces.h:945
#define PLAYER_LASER_REQ_GET_CONFIG
Request/reply subtype: get configuration.
Definition: player_interfaces.h:860
double ReadTupleAngle(int section, const char *name, int index, double value)
Read an angle form a tuple (includes units conversion)
int ReadDeviceAddr(player_devaddr_t *addr, int section, const char *name, int code, int index, const char *key)
Read a device id.
Class for loading configuration file information.
Definition: configfile.h:195
#define PLAYER_CAPABILITIES_REQ
Capability request message type.
Definition: player.h:396
A device address.
Definition: player.h:144
An autopointer for the message queue.
Definition: message.h:72
Data: state (PLAYER_GPS_DATA_STATE)
Definition: player_interfaces.h:1841
#define PLAYER_ERROR(msg)
Error message macros.
Definition: error.h:80
Base class for drivers which oeprate with a thread.
Definition: driver.h:551
Claser(int scan_points)
Opens serial port.
Definition: RS4Leuze_laser.cc:37
Base class for all drivers.
Definition: driver.h:107
#define PLAYER_MSG0(level, msg)
General messages.
Definition: error.h:104
Data: scan (PLAYER_LASER_DATA_SCAN)
Definition: player_interfaces.h:883
#define PLAYER_MSGQUEUE_DEFAULT_MAXLEN
Default maximum length for a message queue.
Definition: player.h:75