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;
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));
Definition: player_interfaces.h:3039
uint32_t data_count
The number of cells.
Definition: player_interfaces.h:3071
static bool MatchMessage(player_msghdr_t *hdr, int type, int subtype, player_devaddr_t addr)
Helper for message processing.
Definition: message.h:158
double ReadFloat(int section, const char *name, double value)
Read a floating point (double) value.
Data: ranges (PLAYER_SONAR_DATA_RANGES)
Definition: player_interfaces.h:771
Data AND Request/reply: geometry.
Definition: player_interfaces.h:785
int8_t * data
Cell occupancy value.
Definition: player_interfaces.h:3075
Generic message header.
Definition: player.h:160
Encapsulates a device (i.e., a driver bound to an interface)
Definition: device.h:73
double px
X [m].
Definition: player.h:219
Request/reply: get grid map tile.
Definition: player_interfaces.h:3060
int ReadInt(int section, const char *name, int value)
Read an integer value.
void * GetPayload()
Get pointer to payload.
Definition: message.h:187
#define PLAYER_MSGTYPE_DATA
A data message.
Definition: player.h:94
double py
Y [m].
Definition: player.h:221
#define PLAYER_MSGTYPE_RESP_ACK
A positive response message.
Definition: player.h:111
#define PLAYER_WARN2(msg, a, b)
Error message macros.
Definition: error.h:90
uint32_t row
The tile origin [pixels].
Definition: player_interfaces.h:3065
struct player_map_data player_map_data_t
Request/reply: get grid map tile.
int width
the map is defined as x,y -> pose (px,py,pa,P)
Definition: gridmap.h:117
uint32_t width
The size of the tile [pixels].
Definition: player_interfaces.h:3067
#define PLAYER_MSGTYPE_REQ
A request message.
Definition: player.h:105
uint32_t height
The size of the tile [pixels].
Definition: player_interfaces.h:3069
#define PLAYER_SONAR_DATA_RANGES
Data subtype: ranges.
Definition: player_interfaces.h:761
float * ranges
The range readings [m].
Definition: player_interfaces.h:776
int ReadDeviceAddr(player_devaddr_t *addr, int section, const char *name, int code, int index, const char *key)
Read a device id.
#define PLAYER_SONAR_REQ_GET_GEOM
Request/reply subtype: get geometry.
Definition: player_interfaces.h:755
Class for loading configuration file information.
Definition: configfile.h:195
#define PLAYER_MAP_REQ_GET_DATA
Request/reply subtype: get grid map tile
Definition: player_interfaces.h:3024
uint32_t col
The tile origin [pixels].
Definition: player_interfaces.h:3063
#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
player_pose2d_t vel
translational velocities [m/s,m/s,rad/s] (x, y, yaw)
Definition: player_interfaces.h:611
position2d data
Definition: player_interfaces.h:606
#define PLAYER_ERROR(msg)
Error message macros.
Definition: error.h:80
Base class for drivers which oeprate with a thread.
Definition: driver.h:551
uint32_t ranges_count
The number of valid range readings.
Definition: player_interfaces.h:774
#define PLAYER_POSITION2D_DATA_STATE
Data: state (PLAYER_POSITION2D_DATA_STATE)
Definition: player_interfaces.h:568
Definition: gridmap.h:111
player_pose2d_t pos
position [m,m,rad] (x, y, yaw)
Definition: player_interfaces.h:609
Reference-counted message objects.
Definition: message.h:131
double pa
yaw [rad]
Definition: player.h:223
Base class for all drivers.
Definition: driver.h:107
#define PLAYER_MAP_DATA_INFO
Data subtype: grid map metadata.
Definition: player_interfaces.h:3033
#define PLAYER_MAP_REQ_GET_INFO
Request/reply subtype: get grid map metadata
Definition: player_interfaces.h:3021