34 #ifndef _KHEPERADEVICE_H 35 #define _KHEPERADEVICE_H 41 #include <libplayercore/playercore.h> 43 #include "khepera_serial.h" 45 #define KHEPERA_CONFIG_BUFFER_SIZE 1024 46 #define KHEPERA_BAUDRATE B38400 47 #define KHEPERA_DEFAULT_SERIAL_PORT "/dev/ttyUSB0" 48 #define KHEPERA_DEFAULT_SCALE 10 49 #define KHEPERA_DEFAULT_ENCODER_RES (1.0/12.0) 50 #define KHEPERA_DEFAULT_IR_CALIB_A (64.158) 51 #define KHEPERA_DEFAULT_IR_CALIB_B (-0.1238) 53 #define KHEPERA_MOTOR_LEFT 0 54 #define KHEPERA_MOTOR_RIGHT 1 56 #define KHEPERA_FIXED_FACTOR 10000 59 #define KHEPERA_COMMAND_PROMPT "\r\n" 62 #define ABS(x) ((x) < 0 ? -(x) : (x)) 66 #define SGN(x) ((x) < 0 ? -1 : 1) 94 virtual int MainSetup();
95 virtual void MainQuit();
100 void SetIRState(
int);
102 void UpdateData(
void);
110 unsigned short ReadAD(
int);
114 int SetSpeed(
int,
int);
115 int ReadSpeed(
int*,
int*);
117 int SetPos(
int,
int);
119 int SetPosCounter(
int,
int);
120 int ReadPos(
int *,
int*);
130 int position_subscriptions;
131 int ir_subscriptions;
135 player_khepera_geom_t* geometry;
140 struct timeval last_position;
141 bool refresh_last_position;
142 int last_lpos, last_rpos;
144 int last_x_f, last_y_f;
147 struct timeval last_pos_update;
148 struct timeval last_ir_update;
150 int pos_update_period;
152 short desired_heading;
155 struct timeval last_ir;
159 bool direct_velocity_control;
162 char khepera_serial_port[MAX_FILENAME_SIZE];
Class for loading configuration file information.
Definition: configfile.h:196
Generic message header.
Definition: player.h:161
Definition: khepera_serial.h:33
A device address.
Definition: player.h:145
Base class for drivers which oeprate with a thread.
Definition: driver.h:552
Messages between wsn and a robot.
Definition: er.h:86
position2d geom
Definition: player_interfaces.h:655
An autopointer for the message queue.
Definition: message.h:73
Data: ranges (PLAYER_IR_DATA_RANGES)
Definition: player_interfaces.h:2115
Request/reply: get pose.
Definition: player_interfaces.h:2130
position2d data
Definition: player_interfaces.h:606