Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

roboticarm.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 /*
00022  * Desc: EXAMPLE ONLY for dynamically-loaded models
00023  * Author: Andrew Howard
00024  * Date: 14 Jul 2004
00025  * CVS: $Id: roboticarm.hh,v 1.1.1.1 2005/12/24 06:55:31 jjz5 Exp $
00026  */
00027 
00028 #ifndef ROBOTICARM_HH
00029 #define ROBOTICARM_HH
00030 
00031 #include <gazebo/Body.hh>
00032 #include <gazebo/Model.hh>
00033 #include <gazebo/World.hh>
00034 #include <gazebo/HingeJoint.hh>
00035 #include <gazebo/Body.hh>
00036 #include <gazebo/CylinderGeom.hh>
00037 #include <gazebo/BoxGeom.hh>
00038 #include <gazebo/ModelFactory.hh>
00039 
00040 class roboticarm : public Model
00041 {
00042   // Constructor
00043   public: roboticarm( World *world );
00044   
00045   // Destructor
00046   public: virtual ~roboticarm();
00047 
00048   // Load stuff
00049   public: int Load( WorldFile *file, WorldFileNode *node );
00050   
00051   // Initialize stuff
00052   public: int Init( WorldFile *file, WorldFileNode *node );
00053 
00054   // Finalize stuff
00055   public: int Fini();
00056   
00057   // Get commands from the external interface
00058   private: void IfaceGetCmd();
00059 
00060   // Update the data in the external interface
00061   private: void IfacePutData();  
00062 
00063   // Do updates
00064   public: void Update( double step );
00065 
00066   private: Body *baseBody;
00067   private: Body *motorBody;
00068   private: HingeJoint *panJoint;
00069 #define NUMSEGS 4
00070            HingeJoint *joints[NUMSEGS-1];
00071 
00072         double time;
00073 
00074 double angles[NUMSEGS];
00075 
00076   private: bool already;
00077 
00078   public:
00079            void InitBody();
00080            void InitDebug();
00081                 int c;
00082 
00083 Geom* getCylinder(Body*, double rad, double height, GzVector, double, GzColor);
00084 Geom* getBox(Body*, double x, double y, double z, GzVector, double, GzColor);
00085 
00086 
00087 
00088 
00089 };
00090 
00091 #endif

Generated on Tue Jan 10 17:29:19 2006 for Stanford AI Robot (STAIR) by doxygen1.2.17