Gazebo

Differential_Position2d.hh

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: Position2d controller for a Differential drive.
00023  * Author: Nathan Koenig
00024  * Date: 01 Feb 2007
00025  * SVN: $Id: Differential_Position2d.hh 198 2007-12-18 00:20:58Z natepak $
00026  */
00027 #ifndef DIFFERENTIAL_POSITION2D_HH
00028 #define DIFFERENTIAL_POSITION2D_HH
00029 
00030 #include <map>
00031 
00032 #include "Controller.hh"
00033 
00034 namespace gazebo
00035 {
00036   class HingeJoint;
00037   class Entity;
00038   class PositionIface;
00039 
00042 
00062 
00063 
00064 class Differential_Position2d : public Controller
00065 {
00067   public: Differential_Position2d(Entity *parent );
00068 
00070   public: virtual ~Differential_Position2d();
00071 
00074   protected: virtual void LoadChild(XMLConfigNode *node);
00075 
00078   protected: virtual void SaveChild(XMLConfigNode *node);
00079 
00081   protected: virtual void InitChild();
00082 
00084   protected: void ResetChild();
00085 
00087   protected: virtual void UpdateChild(UpdateParams &params);
00088 
00090   protected: virtual void FiniChild();
00091 
00093   private: void PutPositionData();
00094 
00096   private: void GetPositionCmd();
00097 
00099   private: PositionIface *myIface;
00100 
00102   private: Model *myParent;
00103 
00105   private: float wheelSep;
00106 
00108   private: float wheelDiam;
00109 
00111   private: float torque;
00112 
00114   private: float wheelSpeed[2];
00115 
00117   private: bool enableMotors;
00118 
00119   private: float odomPose[3];
00120   private: float odomVel[3];
00121 
00122   private: HingeJoint *joints[2];
00123 
00124 };
00125 
00127 
00128 
00129 }
00130 
00131 #endif
00132 

Last updated Aug 04 2007