robot_params.h
Go to the documentation of this file.
00001 /*
00002  *  P2OS for ROS
00003  *  Copyright (C) 2009
00004  *     David Feil-Seifer, Brian Gerkey, Kasper Stoy,
00005  *      Richard Vaughan, & Andrew Howard
00006  *
00007  *
00008  *  This program is free software; you can redistribute it and/or modify
00009  *  it under the terms of the GNU General Public License as published by
00010  *  the Free Software Foundation; either version 2 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  This program is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  *  GNU General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU General Public License
00019  *  along with this program; if not, write to the Free Software
00020  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  */
00023 
00024 /*
00025  * robot_params.h
00026  *
00027  * ActivMedia robot parameters, automatically generated by saphconv.tcl from
00028  * Saphira parameter files:
00029  *    amigo.p
00030  *    amigo-sh.p
00031  *    p2at.p
00032  *    p2at8+.p
00033  *    p2at8.p
00034  *    p2ce.p
00035  *    p2d8+.p
00036  *    p2d8.p
00037  *    p2de.p
00038  *    p2df.p
00039  *    p2dx.p
00040  *    p2it.p
00041  *    p2pb.p
00042  *    p2pp.p
00043  *    p3at-sh.p
00044  *    p3at.p
00045  *    p3atiw.p
00046  *    p3dx-sh.p
00047  *    p3dx.p
00048  *    peoplebot-sh.p
00049  *    perfpb+.p
00050  *    perfpb.p
00051  *    pion1m.p
00052  *    pion1x.p
00053  *    pionat.p
00054  *    powerbot-sh.p
00055  *    powerbot.p
00056  *    psos1m.p
00057  *    psos1x.p
00058  *    p3dx-sh-lms1xx.p
00059 */
00060 
00061 #ifndef _ROBOT_PARAMS_H
00062 #define _ROBOT_PARAMS_H
00063 #include <string>
00064 
00065 void initialize_robot_params(void);
00066 
00067 
00068 #define PLAYER_NUM_ROBOT_TYPES 30
00069 
00070 // Default max speeds
00071 #define MOTOR_DEF_MAX_SPEED 0.5
00072 #define MOTOR_DEF_MAX_TURNSPEED DTOR(100)
00073 
00074 /*
00075  * Apparently, newer kernel require a large value (200000) here.  It only
00076  * makes the initialization phase take a bit longer, and doesn't have any
00077  * impact on the speed at which packets are received from P2OS
00078  */
00079 #define P2OS_CYCLETIME_USEC 200000
00080 
00081 /* p2os constants */
00082 
00083 #define P2OS_NOMINAL_VOLTAGE 12.0
00084 
00085 /* Command numbers */
00086 #define SYNC0 0
00087 #define SYNC1 1
00088 #define SYNC2 2
00089 
00090 enum P2OSCommand {
00091   PULSE = 0,
00092   OPEN = 1,
00093   CLOSE = 2,
00094   ENABLE = 4,
00095   SETA = 5,
00096   SETV = 6,
00097   SETO = 7,
00098   MOVE = 8, 
00099   ROTATE = 9, 
00100   SETRV = 10, 
00101   VEL = 11,
00102   HEAD = 12, 
00103   DHEAD = 13, 
00104   //DROTATE = 14, does not really exist
00105   SAY = 15, 
00107   JOYINFO = 17, // int, requests joystick packet, 0 to stop, 1 for 1, 2 for
00108                 // continuous
00109   CONFIG = 18, 
00110   ENCODER = 19, 
00111   RVEL = 21,
00112   DCHEAD = 22, 
00113   SETRA = 23,
00114   SONAR = 28,
00115   STOP = 29,
00116   DIGOUT = 30, 
00117   //TIMER = 31, ... no clue about this one
00118   VEL2 = 32,
00119   GRIPPER = 33,
00120   //KICK = 34, um...
00121   ADSEL = 35, 
00122   GRIPPERVAL = 36,
00123   GRIPPERPACREQUEST = 37, 
00124   IOREQUEST = 40, 
00125   PTUPOS = 41, 
00126   TTY2 = 42,   // Added in AmigOS 1.2
00127   GETAUX = 43, // Added in AmigOS 1.2
00128   BUMP_STALL = 44,
00129   TCM2 = 45, 
00130   JOYDRIVE = 47,
00131   MOVINGBLINK = 49, 
00132 
00133   HOSTBAUD = 50, 
00134 
00135   AUX1BAUD = 51, 
00136 
00137   AUX2BAUD = 52, 
00138 
00139   ESTOP = 55, 
00140   ESTALL = 56, // ?
00141   GYRO = 58,         // Added in AROS 1.8
00142   // SRISIM specific:
00143 
00144   // for calibrating the compass:
00145   CALCOMP = 65, 
00146 
00147   TTY3 = 66,   // Added in AmigOS 1.3
00148   GETAUX2 = 67,  // Added in AmigOS 1.3
00149   ARM_INFO = 70,
00150   ARM_STATUS = 71,
00151   ARM_INIT = 72,
00152   ARM_CHECK = 73,
00153   ARM_POWER = 74,
00154   ARM_HOME = 75,
00155   ARM_PARK = 76,
00156   ARM_POS = 77,
00157   ARM_SPEED = 78,
00158   ARM_STOP = 79,
00159   ARM_AUTOPARK = 80,
00160   ARM_GRIPPARK = 81,
00161 
00162   ROTKP = 82,        // Added in P2OS1.M
00163   ROTKV = 83,        // Added in P2OS1.M
00164   ROTKI = 84,        // Added in P2OS1.M
00165   TRANSKP = 85,      // Added in P2OS1.M
00166   TRANSKV = 86,      // Added in P2OS1.M
00167   TRANSKI = 87,      // Added in P2OS1.M
00168   SOUND = 90,
00169   PLAYLIST = 91,
00170   SOUNDTOG = 92, 
00171 
00172   // Power commands
00173   POWER_PC = 95,
00174   POWER_LRF = 96,
00175   POWER_5V = 97,
00176   POWER_12V = 98,
00177   POWER_24V = 98,
00178   POWER_AUX_PC = 125,
00179   POWER_TOUCHSCREEN = 126,
00180   POWER_PTZ = 127,
00181   POWER_AUDIO = 128,
00182   POWER_LRF2 = 129,
00183 
00184   // For SEEKUR or later lateral-capable robots
00185   LATVEL = 110, 
00186   LATACCEL = 113, 
00187 
00188   SETLATV = 0, 
00189 };
00190 
00191 /* Server Information Packet (SIP) types */
00192 #define STATUSSTOPPED 0x32
00193 #define STATUSMOVING  0x33
00194 #define ENCODER   0x90
00195 #define SERAUX    0xB0
00196 #define SERAUX2   0xB8  // Added in AmigOS 1.3
00197 #define GYROPAC         0x98    // Added AROS 1.8
00198 #define ARMPAC    160   // ARMpac
00199 #define ARMINFOPAC  161   // ARMINFOpac
00200 //#define PLAYLIST  0xD0
00201 
00202 /* Argument types */
00203 #define ARGINT    0x3B  // Positive int (LSB, MSB)
00204 #define ARGNINT   0x1B  // Negative int (LSB, MSB)
00205 #define ARGSTR    0x2B  // String (Note: 1st byte is length!!)
00206 
00207 /* gripper stuff */
00208 #define GRIPopen   1
00209 #define GRIPclose  2
00210 #define GRIPstop   3
00211 #define LIFTup     4
00212 #define LIFTdown   5
00213 #define LIFTstop   6
00214 #define GRIPstore  7
00215 #define GRIPdeploy 8
00216 #define GRIPhalt   15
00217 #define GRIPpress  16
00218 #define LIFTcarry  17
00219 
00220 /* CMUcam stuff */
00221 #define CMUCAM_IMAGE_WIDTH  80
00222 #define CMUCAM_IMAGE_HEIGHT 143
00223 #define CMUCAM_MESSAGE_LEN  10
00224 
00225 /* conection stuff */
00226 #define DEFAULT_P2OS_PORT "/dev/ttyS0"
00227 #define DEFAULT_P2OS_TCP_REMOTE_HOST "localhost"
00228 #define DEFAULT_P2OS_TCP_REMOTE_PORT 8101
00229 
00230 /* degrees and radians */
00231 #define DTOR(a) M_PI * a / 180.0
00232 #define RTOD(a) 180.0 * a / M_PI
00233 
00234 typedef struct
00235 {
00236   double x;
00237   double y;
00238   double th;
00239   double length;
00240   double radius;
00241 } bumper_def_t;
00242 
00243 typedef struct
00244 {
00245   double x;
00246   double y;
00247   double th;
00248 } sonar_pose_t;
00249 
00250 
00251 typedef struct
00252 {
00253   double AngleConvFactor; //
00254   std::string Class;
00255   double DiffConvFactor; //
00256   double DistConvFactor; //
00257   int FrontBumpers; //
00258   double GyroScaler; //
00259   int HasMoveCommand; //
00260   int Holonomic; //
00261   int IRNum; //
00262   int IRUnit; //
00263   int LaserFlipped; //
00264   std::string LaserIgnore;
00265   std::string LaserPort;
00266   int LaserPossessed; //
00267   int LaserPowerControlled; //
00268   int LaserTh; //
00269   int LaserX; //
00270   int LaserY; //
00271   int MaxRVelocity; //
00272   int MaxVelocity; //
00273   int NewTableSensingIR; //
00274   int NumFrontBumpers; //
00275   int NumRearBumpers; //
00276   double RangeConvFactor; //
00277   int RearBumpers; //
00278   int RequestEncoderPackets; //
00279   int RequestIOPackets; //
00280   int RobotDiagonal; //
00281   int RobotLength; //
00282   int RobotRadius; //
00283   int RobotWidth; //
00284   int RotAccel; //
00285   int RotDecel; //
00286   int RotVelMax; //
00287   int SettableAccsDecs; //
00288   int SettableVelMaxes; //
00289   int SonarNum; //
00290   std::string Subclass;
00291   int SwitchToBaudRate; //
00292   int TableSensingIR; //
00293   int TransAccel; //
00294   int TransDecel; //
00295   int TransVelMax; //
00296   int Vel2Divisor; //
00297   double VelConvFactor; //
00298   sonar_pose_t sonar_pose[32];
00299   //bumper_def_t bumper_geom[32];
00300 } RobotParams_t;
00301 
00302 
00303 extern RobotParams_t PlayerRobotParams[];
00304 
00305 
00306 #endif


p2os_driver
Author(s): Hunter Allen , David Feil-Seifer , Aris Synodinos , Brian Gerkey, Kasper Stoy, Richard Vaughan, Andrew Howard, Tucker Hermans, ActivMedia Robotics LLC, MobileRobots Inc.
autogenerated on Wed Aug 26 2015 15:15:07