Gazebo logo

RayProximity.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: Ray proximity sensor
00022  * Author: Carle Cote (Laborius - Universite de Sherbrooke - Sherbrooke, Quebec, Canada)
00023  * Date: 23 february 2004
00024  * CVS: $Id: RayProximity.hh,v 1.11 2005/11/22 16:44:51 natepak Exp $
00025  *
00026  * Modification description :
00027  *
00028  * Author: Carle Cote 
00029  *           (Laborius - Universite de Sherbrooke - Sherbrooke, Quebec, Canada)
00030  * Date: 26 may 2004 
00031  * Desc: Fix model with refactored core
00032  *          - Change collision detection mechanism
00033  *          - Change rays to have their own spaceID 
00034  */
00035 
00036 #ifndef RAYPROXIMITYSENSOR_HH
00037 #define RAYPROXIMITYSENSOR_HH
00038 
00039 #include "Sensor.hh"
00040 #include "Body.hh"
00041 
00042 class RayGeom;
00043 
00044 
00050 class RayProximity: public Sensor
00051 {
00057   public: RayProximity(World *world, Body *body, int rayCount);
00058 
00059   
00061   public: virtual ~RayProximity();
00062 
00067   public: void SetRay(int index, GzVector a, GzVector b);
00068 
00072   public: void GetRay(int index, GzVector *pos, GzVector *dir);
00073 
00076   public: double GetRange(int index);   
00077 
00079   public: double GetRetro(int index);   
00080 
00082   public: int GetFiducial(int index);   
00083 
00085   public: void Update();
00086   
00088   private: static void UpdateCallback( void *data, dGeomID o1, dGeomID o2 );
00089   
00091   private: Body *body;
00092   
00094   private: dSpaceID superSpaceId;
00095   private: dSpaceID raySpaceId; 
00096 
00098   private: int rayCount;
00099   private: RayGeom **rays;
00100 };
00101 
00102 #endif

Last updated 12 September 2005 21:38:45