Gazebo

Geom.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 /* Desc: Geom class
00022  * Author: Nate Koenig
00023  * Date: 13 Feb 2006
00024  * SVN: $Id: Geom.hh 4402 2008-03-09 14:39:27Z robotos $
00025  */
00026 
00027 #ifndef GEOM_HH
00028 #define GEOM_HH
00029 
00030 #include <ode/ode.h>
00031 
00032 #include "Entity.hh"
00033 #include "Pose3d.hh"
00034 #include "Vector3.hh"
00035 
00036 namespace gazebo
00037 {
00038 
00039   class Body;
00040   class ContactParams;
00041   class XMLConfigNode;
00042   class OgreVisual;
00043 
00047 
00049   class Geom : public Entity
00050   {
00051   
00053     //public: Geom(Body *body, const std::string &name);
00054     public: Geom(Body *body);
00055   
00057     public: virtual ~Geom();
00058 
00060     public: virtual void Load(XMLConfigNode *node);
00061 
00063     public: virtual void Save();
00064 
00066     protected: virtual void LoadChild(XMLConfigNode *node) = 0;
00067   
00069     public: void SetGeom(dGeomID geomId, bool placeable);
00070   
00072     public: void Update();
00073 
00075     public: virtual void UpdateChild() {};
00076   
00079     public: dGeomID GetGeomId() const;
00080   
00083     public: dGeomID GetTransId() const;
00084   
00086     public: int GetGeomClass() const;
00087   
00089     public: bool IsPlaceable() const;
00090   
00094     public: void SetPose(const Pose3d &pose, bool updateCoM=true);
00095   
00097     public: Pose3d GetPose() const;
00098   
00101     public: void SetPosition(const Vector3 &pos);
00102   
00105     public: void SetRotation(const Quatern &rot);
00106   
00109     public: void SetCategoryBits(unsigned int bits);
00110   
00113     public: void SetCollideBits(unsigned int bits);
00114   
00116     public: const dMass *GetBodyMassMatrix();
00117   
00119     public: void SetLaserFiducialId(int id);
00120   
00122     public: int GetLaserFiducialId() const;
00123   
00125     public: void SetLaserRetro(float retro);
00126   
00128     public: float GetLaserRetro() const;
00129 
00131     public: void SetTransparency( float trans );
00132 
00134     public: float GetTransparency() const;
00135   
00137     public: void ShowBoundingBox(bool show);
00138 
00140     public: void ShowJoints(bool show);
00141 
00143     public: void ShowPhysics(bool);
00144 
00146     private: void PlaceImmovable( );
00147 
00149     public: virtual void SetImmovableBasePose( const Pose3d & pose );
00150 
00152     public: ContactParams *contact; 
00153   
00155     protected: Body *body;
00156   
00157     private: bool placeable;
00158 
00160     protected: dGeomID transId;
00161 
00163     protected: dGeomID geomId;
00164   
00165     private: static int geomIdCounter;
00166   
00168     protected: dMass mass;
00169 
00171     protected: dMass bodyMass;
00172  
00173     private: int laserFiducialId;
00174     private: float laserRetro;
00175 
00177     protected: double dblMass;
00178 
00180     private: OgreVisual *bbVisual;
00181 
00182     private: float transparency;
00183 
00185     private: std::vector<OgreVisual*> visuals;
00186 
00188     private: XMLConfigNode *xmlNode;
00189 
00190     private: Pose3d immovableBasePose;
00191     private: Pose3d immovableRelativePose;
00192 
00193   };
00194 
00196 
00197 }
00198 #endif

Last updated Aug 04 2007