Home
FAQ
Player
Utilities
Stage
Gazebo
Contrib
Documentation
Publications
Contributors
Users

Project
Download
Bugs/Feedback
Mailing lists

Radish

Old news
Old stuff

Atrv.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 SickLMS200
00022  * Author: Andrew Howard
00023  * Date: 8 May 2003
00024  */
00025 
00026 #ifndef ATRV_HH
00027 #define ATRV_HH
00028 
00029 #include "Model.hh"
00030 
00031 // Forward declarations
00032 class Body;
00033 class HingeJoint;
00034 class RayProximity;
00035 
00036 
00037 class Atrv : public Model
00038 {
00039   // Construct, destructor
00040   public: Atrv( World *world );
00041   public: virtual ~Atrv();
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   // Load ODE stuff
00053   private: int OdeLoad( WorldFile *file, WorldFileNode *node );
00054 
00055   // Load sonar stuff
00056   private: int LoadSonar( WorldFile *file, WorldFileNode *node );
00057 
00058   // Update the model state
00059   public: virtual void Update( double step );
00060 
00061   // Update the odometry
00062   private: void UpdateOdometry( double step );
00063 
00064   // Get commands from the external interface
00065   private: void GetPositionCmd();
00066   
00067   // Update the data in the external interface
00068   private: void PutPositionData();
00069 
00070   // Update the data in the power interface
00071   private: void PutPowerData();
00072 
00073   // Update the data in the sonar interface
00074   private: void PutSonarData();
00075 
00076   // Update parameters
00077   private: double updatePeriod, updateTime;
00078 
00079   // Robot parameters
00080   private: double wheelSep, wheelDiam;
00081     
00082   // Sonar configuration
00083   private: double sonarMaxRange;
00084   private: GzVector pos[12];
00085   private: double dir[12];
00086 
00087   // ODE components
00088   private: Body *chassis;
00089   private: Body *wheels[4];
00090   private: HingeJoint *wheelJoints[4];
00091 
00092   // Sensor for sonar ranging
00093   private: RayProximity *sonarSensor;
00094 
00095   // External interface
00096   private: gz_position_t *position_iface;
00097   private: gz_power_t *power_iface;
00098   private: gz_sonar_t *sonar_iface;
00099 
00100   // Wheel speeds (left and right wheels are paired)
00101   private: double wheelSpeed[2];
00102 
00103   // Odometric pose estimate
00104   private: double odomPose[3];
00105 
00106   // Odometric speed estimate
00107   private: double odomVel[3];
00108 
00109   // Battery level
00110   private: double batteryLevel;
00111 
00112   // Coefficients of battery discharge curve
00113   private: double batteryCurve[2];
00114 };
00115 
00116 #endif


Last updated $Date: 2004/12/21 01:49:15 $
Generated on Sun May 22 18:39:07 2005 for Gazebo by doxygen 1.4.2