Gazebo logo

Bandit.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: Model of a simple humanoid torso
00023  * Author: Nate Koenig
00024  * Date: 31 Aug 2005
00025  * CVS: $Id: Bandit.hh,v 1.1 2005/08/31 23:06:00 natepak Exp $
00026  */
00027 
00028 #ifndef BANDIT_HH
00029 #define BANDIT_HH
00030 
00031 #include "gazebo.h"
00032 #include "Model.hh"
00033 
00034 class Body;
00035 class HingeJoint;
00036 
00037 enum Joints {L_SHOULDER, L_UPPERARM, L_ELBOW, L_LOWERARM, L_WRIST, R_SHOULDER, R_UPPERARM, R_ELBOW, R_LOWERARM, R_WRIST, HEAD, JOINT_COUNT};
00038 
00039 class Bandit : public Model
00040 {
00041   // Constructor
00042   public: Bandit( World *world );
00043   
00044   // Destructor
00045   public: virtual ~Bandit();
00046 
00047   // Load stuff
00048   public: int Load( WorldFile *file, WorldFileNode *node );
00049   
00050   // Initialize stuff
00051   public: int Init( WorldFile *file, WorldFileNode *node );
00052 
00053   // Finalize stuff
00054   public: int Fini();
00055   
00056   // Get commands from the external interface
00057   private: void IfaceGetCmd();
00058 
00059   // Update the data in the external interface
00060   private: void IfacePutData();  
00061 
00062   // Do updates
00063   public: void Update( double step );
00064 
00065   // Set the velocity of a joint
00066   private: void SetJointVelocity( Joint *joint, int param, double angle, double cmd_angle);
00067 
00068   // The canonical body
00069   private: Body *torso;
00070   private: Body *head;
00071 
00072   private: Body *leftShoulder;
00073   private: Body *leftUpperArm;
00074   private: Body *leftElbow;
00075   private: Body *leftLowerArm;
00076   private: Body *leftHand;
00077 
00078   private: Body *rightShoulder;
00079   private: Body *rightUpperArm;
00080   private: Body *rightElbow;
00081   private: Body *rightLowerArm;
00082   private: Body *rightHand;
00083 
00084   private: Joint *joints[JOINT_COUNT];
00085 
00086   private: gz_joint_t *joint_iface;
00087 };
00088 
00089 #endif

Last updated 12 September 2005 21:38:45