Gazebo logo

Shrimp.hh

Go to the documentation of this file.
00001 /*
00002  *  Gazebo - Outdoor Multi-Robot Simulator
00003  *  Copyright (C) 2003  
00004  *     Nate Koenig & Andrew Howard
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 /* Desc: Model for a Shrimp
00022  * Author: Stijn Opheide, Jef Marien, Koen Jans
00023  * Date: December 2003
00024  * CVS: $Id: Shrimp.hh,v 1.7 2004/11/16 04:47:08 inspectorg Exp $
00025  */
00026 
00027 #ifndef SHRIMP_HH
00028 #define SHRIMP_HH
00029 
00030 #include "Model.hh"
00031 
00032 // Forward declarations
00033 class Body;
00034 class HingeJoint;
00035 class ShrimpSideFork;
00036 
00037 class Shrimp : public Model
00038 {
00039   // Construct, destructor
00040   public: Shrimp( World *world );
00041   public: virtual ~Shrimp();
00042 
00043   // Load the model
00044   public: virtual int Load( WorldFile *file, WorldFileNode *node );
00045 
00046   // Initialize the model
00047   public: virtual int Init( WorldFile *file, WorldFileNode *node );
00048 
00049   // Finalize the model
00050   public: virtual int Fini();
00051 
00052   // Update the model state
00053   public: virtual void Update( double step );
00054 
00055   // Update the odometry
00056   private: void UpdateOdometry( double step );
00057 
00058   // Load ODE stuff
00059   private: int OdeLoad( WorldFile *file, WorldFileNode *node );
00060 
00061   // Get commands from the external interface
00062   private: void PositionGetCmd();
00063   
00064   // Update the data in the external interface
00065   private: void PositionPutData();
00066 
00067   // Robot parameters
00068   private: double wheelSep, wheelDiam;
00069 
00070   // Update time
00071   private: double updatePeriod, updateTime;
00072   
00073   // ODE components
00074   private: Body *chassis;
00075   private: Body *wheels[4];
00076   private: HingeJoint *wheelJoints[4];
00077 
00078   // External interface
00079   private: gz_position_t *iface;
00080 
00081   // Wheel speeds (left and right wheels are paired)
00082   private: double wheelSpeed[2];
00083 
00084   // Odometric pose estimate
00085   private: double odomPose[3];
00086 
00087   private: Body *bovenBalk;
00088   private: Body *backWheel;
00089   private: ShrimpSideFork *leftFork, *rightFork;
00090 
00091   private: Body *forkPart1;
00092   private: Body *forkPart1b;
00093   private: Body *forkPart2;
00094   private: Body *frontwheel;
00095   private: HingeJoint *forkJoint;
00096   private: HingeJoint *forkJointb;
00097   private: HingeJoint *forkforkJoint;
00098   private: HingeJoint *forkforkbJoint;
00099   private: HingeJoint *frontwheelJoint;
00100 };
00101 
00102 #endif

Last updated 12 September 2005 21:38:45