Home
FAQ
Player
Stage
Gazebo
Contrib
Documentation
Publications
Contributors
Users

Project
Download
Bugs/Feedback
Mailing lists

Radish

Old news
Old stuff

obot_constants.h

Go to the documentation of this file.
00001 /*
00002  *  Player - One Hell of a Robot Server
00003  *  Copyright (C) 2000-2003
00004  *     Brian Gerkey
00005  *                      
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  */
00022 
00023 /*
00024  * $Id: obot_constants.h,v 1.1 2004/09/23 19:42:48 gerkey Exp $
00025  *
00026  * Relevant constants for the so-called "Trogdor" robots, by Botrics.
00027  * These values are taken from the 'cerebellum' module of CARMEN; thanks to
00028  * the authors of that module.
00029  */
00030 
00031 #include <math.h>
00032 
00033 #define OBOT_DEFAULT_PORT "/dev/usb/ttyUSB1"
00034 
00035 // might need to define a longer delay to wait for acks
00036 #define OBOT_DELAY_US 10000
00037 
00038 /************************************************************************/
00039 /* Physical constants, in meters, radians, seconds (unless otherwise noted) */
00040 #define OBOT_AXLE_LENGTH    0.317
00041 #define OBOT_WHEEL_DIAM     0.10795  /* 4.25 inches */
00042 #define OBOT_WHEEL_CIRCUM   (OBOT_WHEEL_DIAM * M_PI)
00043 #define OBOT_TICKS_PER_REV  11600.0
00044 #define OBOT_M_PER_TICK     (OBOT_WHEEL_CIRCUM / OBOT_TICKS_PER_REV)
00045 /* the new internal PID loop runs every 1.9375ms (we think) */
00046 #define OBOT_PID_FREQUENCY  (1/1.9375e-3)
00047 #define OBOT_MAGIC_TIMING_CONSTANT 1.0
00048 #define OBOT_MPS_PER_TICK  (OBOT_M_PER_TICK * OBOT_PID_FREQUENCY / \
00049                                 OBOT_MAGIC_TIMING_CONSTANT)
00050 
00051 /* assuming that the counts can use the full space of a signed 32-bit int */
00052 #define OBOT_MAX_TICS 2147483648U
00053 
00054 /* for safety */
00055 //#define OBOT_MAX_WHEELSPEED   1.0
00056 #define OBOT_MAX_WHEELSPEED   5.0
00057 
00058 /* to account for our bad low-level PID motor controller */
00059 #define OBOT_MIN_WHEELSPEED_TICKS 5
00060 
00061 /************************************************************************/
00062 /* Comm protocol values */
00063 #define OBOT_ACK   6 // if command acknowledged
00064 #define OBOT_NACK 21 // if garbled message
00065 
00066 #define OBOT_INIT1 253 // The init commands are used in sequence(1,2,3)
00067 #define OBOT_INIT2 252 // to initialize a link to a cerebellum.
00068 #define OBOT_INIT3 251 // It will then blink green and start accepting other 
00069                   // commands.
00070 
00071 #define OBOT_DEINIT 250
00072 
00073 #define OBOT_SET_VELOCITIES 118 // 'v'(left_vel, right_vel) as 16-bit signed ints
00074 #define OBOT_SET_ACCELERATIONS 97 // 'a'(left_accel, right_accel) as 16-bit unsigned ints
00075 #define OBOT_ENABLE_VEL_CONTROL  101 // 'e'()
00076 #define OBOT_DISABLE_VEL_CONTROL 100 // 'd'()
00077 #define OBOT_GET_ODOM            111 // 'o'()->(left_count, right_count, left_vel, right_vel)
00078 #define OBOT_GET_VOLTAGE          98 // 'b'()->(batt_voltage)
00079 #define OBOT_STOP                115 // 's'()  [shortcut for set_velocities(0,0)]
00080 #define OBOT_KILL                107 // 'k'()  [shortcut for disable_velocity_control]
00081 #define OBOT_HEARTBEAT           104 // 'h'() sends keepalive
00082 /************************************************************************/
00083 
00084 

Generated on Tue May 3 14:15:34 2005 for Player by doxygen 1.3.6