2 #if !defined(WIN32) || defined (__MINGW32__)
6 #include <netinet/in.h>
10 #include <libplayercore/playercore.h>
42 #define LOCAL2GLOBAL_X(x,y,px,py,pa) (cos(pa)*(x) - sin(pa)*(y) + px)
43 #define LOCAL2GLOBAL_Y(x,y,px,py,pa) (sin(pa)*(x) + cos(pa)*(y) + py)
44 #define MAP_INDEX(map, i, j) (int)((i) + (j) * map.width)
45 #define MAP_VALID(map, i, j) ((i >= 0) && (i <= (int)map.width) && (j >= 0) && (j <= (int)map.height))
46 #define ROTATE_X(x,y,th) (cos(th)*(x) - sin(th)*(y))
47 #define ROTATE_Y(x,y,th) (sin(th)*(x) + cos(th)*(y))
56 double sonar_treshold;
57 double sonar_aperture;
58 double sensor_model(
double x,
double y,
double r);
63 sonar_aperture=0.5235987;
101 MAP_POSE(
double px1,
double py1,
double pa1,
double P1)
111 class Map :
public map<MAP_POINT,MAP_POSE>
122 float sonar_treshold;
133 player_map_data_t ToPlayer();
157 std::cout<<
"not implemented yet" << std::endl;
160 double Sonar::sensor_model(
double x,
double y,
double r)
162 return(exp((-pow(x,2)/r)-(pow(y,2)/sonar_aperture))/((
double)1.7));
static bool MatchMessage(player_msghdr_t *hdr, int type, int subtype, player_devaddr_t addr)
Helper for message processing.
Definition: message.h:159
double ReadFloat(int section, const char *name, double value)
Read a floating point (double) value.
Generic message header.
Definition: player.h:162
Encapsulates a device (i.e., a driver bound to an interface)
Definition: device.h:75
int ReadInt(int section, const char *name, int value)
Read an integer value.
void * GetPayload()
Get pointer to payload.
Definition: message.h:188
#define PLAYER_MSGTYPE_DATA
A data message.
Definition: player.h:95
#define PLAYER_MSGTYPE_RESP_ACK
A positive response message.
Definition: player.h:112
#define PLAYER_WARN2(msg, a, b)
Error message macros.
Definition: error.h:91
int width
the map is defined as x,y -> pose (px,py,pa,P)
Definition: gridmap.h:117
#define PLAYER_MSGTYPE_REQ
A request message.
Definition: player.h:106
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:197
#define PLAYER_CAPABILITIES_REQ
Capability request message type.
Definition: player.h:397
A device address.
Definition: player.h:146
An autopointer for the message queue.
Definition: message.h:74
#define PLAYER_ERROR(msg)
Error message macros.
Definition: error.h:81
Base class for drivers which oeprate with a thread.
Definition: driver.h:553
Definition: gridmap.h:112
Reference-counted message objects.
Definition: message.h:133
Base class for all drivers.
Definition: driver.h:109