Gazebo logo

Wifi.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: Sensor for getting truth values
00022  * Author: Chris Jones
00023  * Date: Nov 2003
00024  * CVS: $Id: Wifi.hh,v 1.4 2004/11/16 21:41:19 inspectorg Exp $
00025  */
00026 
00027 #ifndef WIFI_HH
00028 #define WIFI_HH
00029 
00030 #define MAX_MODELS 10
00031 
00032 #include "gazebo.h"
00033 #include "World.hh"
00034 #include "WorldFile.hh"
00035 #include "RayGeom.hh"
00036 #include "Sensor.hh"
00037 
00038 
00039 class Wifi : public Sensor
00040 {
00041   // Constructor, destructor
00042   public: Wifi( World *world );
00043   public: virtual ~Wifi();
00044 
00045   // Load the model
00046   public: virtual int Load( WorldFile *file, WorldFileNode *node );
00047 
00048   // Initialize the model
00049   public: virtual int Init( WorldFile *file, WorldFileNode *node );
00050 
00051   // Finalize the model
00052   public: virtual int Fini();
00053 
00054   // Update the model state
00055   public: virtual void Update( double step );
00056 
00057   // Get the canonical body for this model
00058   public: virtual Body *GetBody() {return NULL;}
00059 
00060   // Initialize the external interface
00061   private: int IfaceInit();
00062 
00063   // Finalize the external interface
00064   private: int IfaceFini();
00065 
00066   // Get commands from the interface
00067   private: bool IfaceGetCmd(GzVector *pos, GzQuatern *rot);
00068 
00069   // Update the data in the external interface
00070   private: void IfacePutData();
00071   private: int RayInit();
00072   private: static void UpdateCallback( void *data, dGeomID o1, dGeomID o2 );
00073   private: bool first_run;
00074   private: int totalnodes; // number of wifi nodes in the environment
00075 
00076   // ray
00077   private: RayGeom *ray,*ray1;
00078 
00079   // Ray space for collision detector
00080   private: dSpaceID superSpaceId;
00081   private: dSpaceID raySpaceId;
00082   private: WorldModel wifi_models[MAX_MODELS];
00083 
00084   // External interfaces
00085   private: const char *id;
00086   private: gz_wifi_t *wifi_iface;
00087   private: gz_wifi_link_t links[GAZEBO_WIFI_MAX_LINKS];
00088 
00089   private: int link_count; // same as total_nodes? yes.
00090   private: const char *ip; // ip for self.
00091   private: double m; // m is the scale factor to scale the same response to a smaller radius.
00092 
00093 
00094 };
00095 
00096 
00097 #endif

Last updated 12 September 2005 21:38:45