TData.h
1 /***************************************************/
2 /* Last Revised:
3 $Id$
4 */
5 /***************************************************/
6 /*
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  */
22 #ifndef TData
23 #define TData
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /*
30  Este fichero contiene los tipos de datos utilizados por todos
31 */
32 
33 #ifndef M_PI
34 #define M_PI 3.14159265358979323846
35 #endif
36 
37 #define MAXLASERPOINTS 361
38 
39 #define RADIO 0.4F /* Radio del robot */
40 
41 typedef struct {
42  float x;
43  float y;
44 }Tpf;
45 
46 
47 typedef struct {
48  float r;
49  float t;
50 }Tpfp;
51 
52 typedef struct {
53  int x;
54  int y;
55 }Tpi;
56 
57 typedef struct {
58  float x;
59  float y;
60  float tita;
61 }Tsc;
62 
63 typedef struct {
64  int numPuntos;
65  Tpf laserC[MAXLASERPOINTS]; // Cartesian coordinates
66  Tpfp laserP[MAXLASERPOINTS]; // Polar coordinates
67 }Tscan;
68 
69 
70 
71 
72 // Associations information
73 typedef struct{
74  float rx,ry,nx,ny,dist; // Point (nx,ny), static corr (rx,ry), dist
75  int numDyn; // Number of dynamic associations
76  float unknown; // Unknown weight
77  int index; // Index within the original scan
78  int L,R;
79 }TAsoc;
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif
Request to get an integer property.
Definition: player.h:457
uint32_t data_count
Size of data as stored in buffer (bytes)
Definition: player_interfaces.h:3452
String Property Class.
Definition: property.h:169
#define PLAYER_MSG1(level, msg, a)
Error message macros.
Definition: error.h:105
double py
Y [m].
Definition: player.h:198
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_POINTCLOUD3D_DATA_STATE
Data subtype: state.
Definition: player_interfaces.h:4854
uint8_t blue
Blue color channel.
Definition: player_interfaces.h:5297
double ReadFloat(int section, const char *name, double value)
Read a floating point (double) value.
int AddInterface(player_devaddr_t addr)
Add an interface.
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
float py
Y [m].
Definition: player_interfaces.h:5289
uint8_t type
Message type; must be one of PLAYER_MSGTYPE_*.
Definition: player.h:165
Encapsulates a device (i.e., a driver bound to an interface)
Definition: device.h:73
const char * ReadString(int section, const char *name, const char *value)
Read a string value.
Data: Get cloud (PLAYER_POINTCLOUD3D_DATA_STATE) The basic 3dcloudpoint data packet.
Definition: player_interfaces.h:4879
uint8_t subtype
Message subtype; interface specific.
Definition: player.h:167
virtual void Main(void)=0
Main method for driver thread.
uint8_t blue
Blue color channel.
Definition: player.h:328
uint8_t red
Red color channel.
Definition: player_interfaces.h:5293
int ReadInt(int section, const char *name, int value)
Read an integer value.
#define PLAYER_OPAQUE_DATA_STATE
Data subtype: generic state.
Definition: player_interfaces.h:3434
float px
X [m].
Definition: player_interfaces.h:5287
#define PLAYER_MSGTYPE_DATA
A data message.
Definition: player.h:94
Definition: TData.h:73
uint8_t red
Red color channel.
Definition: player.h:324
#define PLAYER_ERROR2(msg, a, b)
Error message macros.
Definition: error.h:82
#define PLAYER_CAMERA_FORMAT_MONO16
Image format : 16-bit monochrome (network byte order).
Definition: player_interfaces.h:2938
int32_t value
The property value.
Definition: player.h:464
#define PLAYER_MSGTYPE_RESP_ACK
A positive response message.
Definition: player.h:111
double px
X [m].
Definition: player.h:196
#define PLAYER_CAMERA_DATA_STATE
Data subtype: state.
Definition: player_interfaces.h:2922
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
static bool MatchDeviceAddress(player_devaddr_t addr1, player_devaddr_t addr2)
Compare two addresses.
Definition: device.h:200
#define PLAYER_MSGTYPE_REQ
A request message.
Definition: player.h:105
Data: state (PLAYER_STEREO_DATA_STATE)
Definition: player_interfaces.h:5301
#define PLAYER_MSGTYPE_RESP_NACK
A negative response message.
Definition: player.h:124
Integer property class.
Definition: property.h:113
#define PLAYER_GET_INTPROP_REQ
Integer property get request subtype.
Definition: player.h:429
int ReadDeviceAddr(player_devaddr_t *addr, int section, const char *name, int code, int index, const char *key)
Read a device id.
Data: state (PLAYER_CAMERA_DATA_STATE)
Definition: player_interfaces.h:2950
Class for loading configuration file information.
Definition: configfile.h:195
Definition: TData.h:52
virtual int Setup()
Initialize the driver.
Definition: driver.h:385
double pz
Z [m].
Definition: player.h:200
float pz
Z [m].
Definition: player_interfaces.h:5291
A device address.
Definition: player.h:144
An autopointer for the message queue.
Definition: message.h:72
void SetError(int code)
Set/reset error code.
Definition: driver.h:144
Definition: TData.h:41
#define PLAYER_STEREO_DATA_STATE
Data: state (PLAYER_STEREO_DATA_STATE)
Definition: player_interfaces.h:5281
virtual bool RegisterProperty(const char *key, Property *property, ConfigFile *cf, int section)
Property registration.
#define PLAYER_CAMERA_COMPRESS_RAW
Compression method: raw.
Definition: player_interfaces.h:2945
#define PLAYER_ERROR(msg)
Error message macros.
Definition: error.h:80
Base class for drivers which oeprate with a thread.
Definition: driver.h:551
double timestamp
Time associated with message contents (seconds since epoch)
Definition: player.h:169
uint32_t size
Size in bytes of the payload to follow.
Definition: player.h:173
char * key
The property key.
Definition: player.h:462
Definition: TData.h:63
#define PLAYER_WARN(msg)
Warning message macros.
Definition: error.h:88
3D Pointcloud element structure An element as stored in a 3D pointcloud, containing a 3D position plu...
Definition: player_interfaces.h:4861
#define PLAYER_MSGTYPE_CMD
A command message.
Definition: player.h:98
#define PLAYER_OPAQUE_CMD_DATA
Cmd subtype: generic command.
Definition: player_interfaces.h:3437
virtual int Shutdown()
Finalize the driver.
Definition: driver.h:392
data
Definition: player_interfaces.h:3449
uint8_t alpha
Alpha (transparency) channel.
Definition: player.h:322
Base class for all drivers.
Definition: driver.h:107
Definition: TData.h:57
#define PLAYER_MSG0(level, msg)
General messages.
Definition: error.h:104
Definition: player_interfaces.h:5284
uint8_t green
Green color channel.
Definition: player_interfaces.h:5295
#define PLAYER_SET_INTPROP_REQ
Integer property set request subtype.
Definition: player.h:431
Definition: TData.h:47
player_devaddr_t addr
Device to which this message pertains.
Definition: player.h:163
#define PLAYER_MSGQUEUE_DEFAULT_MAXLEN
Default maximum length for a message queue.
Definition: player.h:75
uint8_t green
Green color channel.
Definition: player.h:326
uint8_t * data
The data we will be sending.
Definition: player_interfaces.h:3454