33 #define OBOT_DEFAULT_PORT "/dev/usb/ttyUSB1"
36 #define OBOT_DELAY_US 50000
39 #define OBOT_PUBLISH_INTERVAL 0.1
43 #define OBOT_AXLE_LENGTH 0.317
44 #define OBOT_WHEEL_DIAM 0.10795
45 #define OBOT_WHEEL_CIRCUM (OBOT_WHEEL_DIAM * M_PI)
46 #define OBOT_TICKS_PER_REV 11600.0
47 #define OBOT_M_PER_TICK (OBOT_WHEEL_CIRCUM / OBOT_TICKS_PER_REV)
49 #define OBOT_PID_FREQUENCY (1/1.9375e-3)
50 #define OBOT_MAGIC_TIMING_CONSTANT 1.0
51 #define OBOT_MPS_PER_TICK (OBOT_M_PER_TICK * OBOT_PID_FREQUENCY / \
52 OBOT_MAGIC_TIMING_CONSTANT)
53 #define OBOT_WIDTH 0.45
54 #define OBOT_LENGTH 0.45
55 #define OBOT_POSE_X 0.0
56 #define OBOT_POSE_Y 0.0
57 #define OBOT_POSE_A 0.0
58 #define OBOT_NOMINAL_VOLTAGE 48.0
61 #define OBOT_MAX_TICS 2147483648U
65 #define OBOT_MAX_WHEELSPEED 5.0
68 #define OBOT_MIN_WHEELSPEED_TICKS 5
72 #define OBOT_ACK 6 // if command acknowledged
73 #define OBOT_NACK 21 // if garbled message
75 #define OBOT_INIT1 253 // The init commands are used in sequence(1,2,3)
76 #define OBOT_INIT2 252 // to initialize a link to a cerebellum.
77 #define OBOT_INIT3 251 // It will then blink green and start accepting other
80 #define OBOT_DEINIT 250
82 #define OBOT_SET_VELOCITIES 118 // 'v'(left_vel, right_vel) as 16-bit signed ints
83 #define OBOT_SET_ACCELERATIONS 97 // 'a'(left_accel, right_accel) as 16-bit unsigned ints
84 #define OBOT_ENABLE_VEL_CONTROL 101 // 'e'()
85 #define OBOT_DISABLE_VEL_CONTROL 100 // 'd'()
86 #define OBOT_GET_ODOM 111 // 'o'()->(left_count, right_count, left_vel, right_vel)
87 #define OBOT_GET_VOLTAGE 98 // 'b'()->(batt_voltage)
88 #define OBOT_STOP 115 // 's'() [shortcut for set_velocities(0,0)]
89 #define OBOT_KILL 107 // 'k'() [shortcut for disable_velocity_control]
90 #define OBOT_HEARTBEAT 104 // 'h'() sends keepalive
#define PLAYER_WARN1(msg, a)
Definition: error.h:90
static bool MatchMessage(player_msghdr_t *hdr, int type, int subtype, player_devaddr_t addr)
Helper for message processing.
Definition: message.h:159
A rectangular bounding box, used to define the size of an object.
Definition: player.h:255
double ReadFloat(int section, const char *name, double value)
Read a floating point (double) value.
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:162
virtual int MainSetup(void)
Sets up the resources needed by the driver thread.
Definition: driver.h:658
virtual void MainQuit(void)
Cleanup method for driver thread (called when main exits)
Definition: driver.h:664
const char * ReadString(int section, const char *name, const char *value)
Read a string value.
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:95
#define PLAYER_MSGTYPE_RESP_ACK
A positive response message.
Definition: player.h:112
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
#define PLAYER_MSGTYPE_REQ
A request message.
Definition: player.h:106
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:197
A device address.
Definition: player.h:146
An autopointer for the message queue.
Definition: message.h:74
#define PLAYER_ERROR1(msg, a)
Definition: error.h:82
A pose in space.
Definition: player.h:229
#define PLAYER_ERROR(msg)
Definition: error.h:81
Base class for drivers which oeprate with a thread.
Definition: driver.h:553
uint32_t size
Size in bytes of the payload to follow.
Definition: player.h:174
#define PLAYER_WARN(msg)
Warning message macros.
Definition: error.h:89
#define PLAYER_MSGTYPE_CMD
A command message.
Definition: player.h:99
Base class for all drivers.
Definition: driver.h:109
#define PLAYER_MSGQUEUE_DEFAULT_MAXLEN
Default maximum length for a message queue.
Definition: player.h:76