Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

restrictedvisionperceptor_c.cpp

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002 
00003    this file is part of rcssserver3D
00004    Fri May 9 2003
00005    Copyright (C) 2002,2003 Koblenz University
00006    Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
00007    $Id: restrictedvisionperceptor_c.cpp,v 1.1 2006/02/28 17:20:45 jamu Exp $
00008 
00009    This program is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; version 2 of the License.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021 */
00022 
00023 #include "restrictedvisionperceptor.h"
00024 
00025 using namespace boost;
00026 using namespace oxygen;
00027 using namespace std;
00028 
00029 FUNCTION(RestrictedVisionPerceptor,setNoiseParams)
00030 {
00031     float inDist;
00032     float inPhi;
00033     float inTheta;
00034     float inErrorAbs;
00035 
00036     if (
00037         (in.GetSize() != 4) ||
00038         (! in.GetValue(in[0],inDist)) ||
00039         (! in.GetValue(in[1],inPhi)) ||
00040         (! in.GetValue(in[2],inTheta)) ||
00041         (! in.GetValue(in[3],inErrorAbs))
00042         )
00043         {
00044             return false;
00045         }
00046 
00047     obj->SetNoiseParams(inDist,inPhi,inTheta,inErrorAbs);
00048     return true;
00049 }
00050 
00051 FUNCTION(RestrictedVisionPerceptor,addNoise)
00052 {
00053     bool inAddNoise;
00054 
00055     if (
00056         (in.GetSize() != 1) ||
00057         (! in.GetValue(in.begin(),inAddNoise))
00058         )
00059     {
00060         return false;
00061     }
00062 
00063     obj->AddNoise(inAddNoise);
00064     return true;
00065 }
00066 
00067 FUNCTION(RestrictedVisionPerceptor,setSenseMyPos)
00068 {
00069     bool inSenseMyPos;
00070 
00071     if (
00072         (in.GetSize() != 1) ||
00073         (! in.GetValue(in.begin(),inSenseMyPos))
00074         )
00075         {
00076             return false;
00077         }
00078 
00079     obj->SetSenseMyPos(inSenseMyPos);
00080     return true;
00081 }
00082 
00083 FUNCTION(RestrictedVisionPerceptor,setStaticSenseAxis)
00084 {
00085     bool inStaticAxis;
00086 
00087     if (
00088         (in.GetSize() != 1) ||
00089         (! in.GetValue(in.begin(),inStaticAxis))
00090         )
00091         {
00092             return false;
00093         }
00094 
00095     obj->SetStaticSenseAxis(inStaticAxis);
00096     return true;
00097 }
00098 
00099 FUNCTION(RestrictedVisionPerceptor,setViewCones)
00100 {
00101     int inHAngle;
00102     int inVAngle;
00103 
00104     if (
00105         (in.GetSize() != 2) ||
00106         (! in.GetValue(in[0],inHAngle)) ||
00107         (! in.GetValue(in[1],inVAngle))
00108         )
00109         {
00110             return false;
00111         }
00112 
00113     obj->SetViewCones(inHAngle,inVAngle);
00114     return true;
00115 }
00116 
00117 FUNCTION(RestrictedVisionPerceptor,setPanRange)
00118 {
00119     int inLower;
00120     int inUpper;
00121 
00122     if (
00123         (in.GetSize() != 2) ||
00124         (! in.GetValue(in[0],inLower)) ||
00125         (! in.GetValue(in[1],inUpper))
00126         )
00127         {
00128             return false;
00129         }
00130 
00131     obj->SetPanRange(inLower,inUpper);
00132     return true;
00133 }
00134 
00135 FUNCTION(RestrictedVisionPerceptor,setTiltRange)
00136 {
00137     int inLower;
00138     int inUpper;
00139 
00140     if (
00141         (in.GetSize() != 2) ||
00142         (! in.GetValue(in[0],inLower)) ||
00143         (! in.GetValue(in[1],inUpper))
00144         )
00145         {
00146             return false;
00147         }
00148 
00149     obj->SetTiltRange(inLower,inUpper);
00150     return true;
00151 }
00152 
00153 void CLASS(RestrictedVisionPerceptor)::DefineClass()
00154 {
00155     DEFINE_BASECLASS(oxygen/Perceptor);
00156     DEFINE_FUNCTION(setNoiseParams);
00157     DEFINE_FUNCTION(addNoise);
00158     DEFINE_FUNCTION(setSenseMyPos);
00159     DEFINE_FUNCTION(setStaticSenseAxis);
00160     DEFINE_FUNCTION(setViewCones);
00161     DEFINE_FUNCTION(setPanRange);
00162     DEFINE_FUNCTION(setTiltRange);
00163 }

Generated on Thu Apr 6 15:25:39 2006 for rcssserver3d by  doxygen 1.4.4