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

joint_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: joint_c.cpp,v 1.5 2004/05/02 11:44:41 rollmark 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 #include "joint.h"
00023 
00024 using namespace boost;
00025 using namespace oxygen;
00026 using namespace salt;
00027 using namespace std;
00028 
00029 FUNCTION(Joint,attach)
00030 {
00031     string inPath1;
00032     string inPath2;
00033 
00034     if (in.GetSize() > 2)
00035         {
00036             return false;
00037         }
00038 
00039     if (
00040         (in.GetSize() >= 1) &&
00041         (! in.GetValue(in[0], inPath1))
00042         )
00043         {
00044             return false;
00045         }
00046 
00047     if (
00048         (in.GetSize() == 2) &&
00049         (! in.GetValue(in[1], inPath2))
00050         )
00051         {
00052             return false;
00053         }
00054 
00055     obj->Attach(inPath1,inPath2);
00056     return true;
00057 }
00058 
00059 FUNCTION(Joint,setLowStopDeg)
00060 {
00061     int inAxis;
00062     float inDeg;
00063 
00064     if (
00065         (in.GetSize() != 2) ||
00066         (! in.GetValue(in[0], inAxis)) ||
00067         (! in.GetValue(in[1], inDeg))
00068         )
00069         {
00070             return false;
00071         }
00072 
00073     obj->SetLowStopDeg(static_cast<Joint::EAxisIndex>(inAxis),inDeg);
00074     return true;
00075 }
00076 
00077 FUNCTION(Joint,getLowStopDeg)
00078 {
00079     int inAxis;
00080 
00081     if (
00082         (in.GetSize() != 1) ||
00083         (! in.GetValue(in[0], inAxis))
00084         )
00085     {
00086         return false;
00087     }
00088 
00089     return obj->GetLowStopDeg(static_cast<Joint::EAxisIndex>(inAxis));
00090 }
00091 
00092 FUNCTION(Joint,setHighStopDeg)
00093 {
00094     int inAxis;
00095     float inDeg;
00096 
00097     if (
00098         (in.GetSize() != 2) ||
00099         (! in.GetValue(in[0], inAxis)) ||
00100         (! in.GetValue(in[1], inDeg))
00101         )
00102         {
00103             return false;
00104         }
00105 
00106     obj->SetHighStopDeg(static_cast<Joint::EAxisIndex>(inAxis),inDeg);
00107     return true;
00108 }
00109 
00110 FUNCTION(Joint,getHighStopDeg)
00111 {
00112     int inAxis;
00113 
00114     if (
00115         (in.GetSize() != 1) ||
00116         (! in.GetValue(in[0], inAxis))
00117         )
00118     {
00119         return false;
00120     }
00121 
00122     return obj->GetHighStopDeg(static_cast<Joint::EAxisIndex>(inAxis));
00123 }
00124 
00125 FUNCTION(Joint,setLowStopPos)
00126 {
00127     int inAxis;
00128     float inPos;
00129 
00130     if (
00131         (in.GetSize() != 2) ||
00132         (! in.GetValue(in[0], inAxis)) ||
00133         (! in.GetValue(in[1], inPos))
00134         )
00135         {
00136             return false;
00137         }
00138 
00139     obj->SetLowStopPos(static_cast<Joint::EAxisIndex>(inAxis),inPos);
00140     return true;
00141 }
00142 
00143 FUNCTION(Joint,getLowStopPos)
00144 {
00145     int inAxis;
00146 
00147     if (
00148         (in.GetSize() != 1) ||
00149         (! in.GetValue(in[0], inAxis))
00150         )
00151     {
00152         return false;
00153     }
00154 
00155     return obj->GetLowStopPos(static_cast<Joint::EAxisIndex>(inAxis));
00156 }
00157 
00158 FUNCTION(Joint,setHighStopPos)
00159 {
00160     int inAxis;
00161     float inPos;
00162 
00163     if (
00164         (in.GetSize() != 2) ||
00165         (! in.GetValue(in[0], inAxis)) ||
00166         (! in.GetValue(in[1], inPos))
00167         )
00168         {
00169             return false;
00170         }
00171 
00172     obj->SetHighStopPos(static_cast<Joint::EAxisIndex>(inAxis),inPos);
00173     return true;
00174 }
00175 
00176 FUNCTION(Joint,getHighStopPos)
00177 {
00178     int inAxis;
00179 
00180     if (
00181         (in.GetSize() != 1) ||
00182         (! in.GetValue(in[0], inAxis))
00183         )
00184     {
00185         return false;
00186     }
00187 
00188     return obj->GetHighStopPos(static_cast<Joint::EAxisIndex>(inAxis));
00189 }
00190 
00191 FUNCTION(Joint,setBounce)
00192 {
00193     int inAxis;
00194     float inBounce;
00195 
00196     if (
00197         (in.GetSize() != 2) ||
00198         (! in.GetValue(in[0], inAxis)) ||
00199         (! in.GetValue(in[1], inBounce))
00200         )
00201         {
00202             return false;
00203         }
00204 
00205     obj->SetBounce(static_cast<Joint::EAxisIndex>(inAxis),inBounce);
00206     return true;
00207 }
00208 
00209 FUNCTION(Joint, getBounce)
00210 {
00211     int inAxis;
00212 
00213     if (
00214         (in.GetSize() != 1) ||
00215         (! in.GetValue(in[0], inAxis))
00216         )
00217     {
00218         return false;
00219     }
00220 
00221     return obj->GetBounce(static_cast<Joint::EAxisIndex>(inAxis));
00222 }
00223 
00224 FUNCTION(Joint, setCFM)
00225 {
00226     int inAxis;
00227     float inCFM;
00228 
00229     if (
00230         (in.GetSize() != 2) ||
00231         (! in.GetValue(in[0], inAxis)) ||
00232         (! in.GetValue(in[1], inCFM))
00233         )
00234         {
00235             return false;
00236         }
00237 
00238     return obj->GetCFM(static_cast<Joint::EAxisIndex>(inAxis));
00239 }
00240 
00241 FUNCTION(Joint, getCFM)
00242 {
00243     int inAxis;
00244 
00245     if (
00246         (in.GetSize() != 1) ||
00247         (! in.GetValue(in[0], inAxis))
00248         )
00249         {
00250             return 0;
00251         }
00252 
00253     return obj->GetCFM(static_cast<Joint::EAxisIndex>(inAxis));
00254 }
00255 
00256 FUNCTION(Joint, setStopCFM)
00257 {
00258     int inAxis;
00259     float inStopCFM;
00260 
00261     if (
00262         (in.GetSize() != 2) ||
00263         (! in.GetValue(in[0], inAxis)) ||
00264         (! in.GetValue(in[1], inStopCFM))
00265         )
00266         {
00267             return false;
00268         }
00269 
00270     return obj->GetStopCFM(static_cast<Joint::EAxisIndex>(inAxis));
00271 }
00272 
00273 FUNCTION(Joint, getStopCFM)
00274 {
00275     int inAxis;
00276 
00277     if (
00278         (in.GetSize() != 1) ||
00279         (! in.GetValue(in[0], inAxis))
00280         )
00281         {
00282             return 0;
00283         }
00284 
00285     return obj->GetStopCFM(static_cast<Joint::EAxisIndex>(inAxis));
00286 }
00287 
00288 FUNCTION(Joint, setStopERP)
00289 {
00290     int inAxis;
00291     float inStopERP;
00292 
00293     if (
00294         (in.GetSize() != 2) ||
00295         (! in.GetValue(in[0], inAxis)) ||
00296         (! in.GetValue(in[1], inStopERP))
00297         )
00298         {
00299             return false;
00300         }
00301 
00302     return obj->GetStopERP(static_cast<Joint::EAxisIndex>(inAxis));
00303 }
00304 
00305 FUNCTION(Joint, getStopERP)
00306 {
00307     int inAxis;
00308 
00309     if (
00310         (in.GetSize() != 1) ||
00311         (! in.GetValue(in[0], inAxis))
00312         )
00313         {
00314             return 0;
00315         }
00316 
00317     return obj->GetStopERP(static_cast<Joint::EAxisIndex>(inAxis));
00318 }
00319 
00320 FUNCTION(Joint, setSuspensionERP)
00321 {
00322     int inAxis;
00323     float inSuspensionERP;
00324 
00325     if (
00326         (in.GetSize() != 2) ||
00327         (! in.GetValue(in[0], inAxis)) ||
00328         (! in.GetValue(in[1], inSuspensionERP))
00329         )
00330         {
00331             return false;
00332         }
00333 
00334     return obj->GetSuspensionERP(static_cast<Joint::EAxisIndex>(inAxis));
00335 }
00336 
00337 FUNCTION(Joint, getSuspensionERP)
00338 {
00339     int inAxis;
00340 
00341     if (
00342         (in.GetSize() != 1) ||
00343         (! in.GetValue(in[0], inAxis))
00344         )
00345         {
00346             return 0;
00347         }
00348 
00349     return obj->GetSuspensionERP(static_cast<Joint::EAxisIndex>(inAxis));
00350 }
00351 
00352 FUNCTION(Joint, setSuspensionCFM)
00353 {
00354     int inAxis;
00355     float inSuspensionCFM;
00356 
00357     if (
00358         (in.GetSize() != 2) ||
00359         (! in.GetValue(in[0], inAxis)) ||
00360         (! in.GetValue(in[1], inSuspensionCFM))
00361         )
00362         {
00363             return false;
00364         }
00365 
00366     return obj->GetSuspensionCFM(static_cast<Joint::EAxisIndex>(inAxis));
00367 }
00368 
00369 FUNCTION(Joint, getSuspensionCFM)
00370 {
00371     int inAxis;
00372 
00373     if (
00374         (in.GetSize() != 1) ||
00375         (! in.GetValue(in[0], inAxis))
00376         )
00377         {
00378             return 0;
00379         }
00380 
00381     return obj->GetSuspensionCFM(static_cast<Joint::EAxisIndex>(inAxis));
00382 }
00383 
00384 FUNCTION(Joint, setLinearMotorVelocity)
00385 {
00386     int inAxis;
00387     float inVel;
00388 
00389     if (
00390         (in.GetSize() != 2) ||
00391         (! in.GetValue(in[0], inAxis)) ||
00392         (! in.GetValue(in[1], inVel))
00393         )
00394         {
00395             return false;
00396         }
00397 
00398     obj->SetLinearMotorVelocity(static_cast<Joint::EAxisIndex>(inAxis), inVel);
00399     return true;
00400 }
00401 
00402 FUNCTION(Joint, getLinearMotorVelocity)
00403 {
00404     int inAxis;
00405 
00406     if (
00407         (in.GetSize() != 1) ||
00408         (! in.GetValue(in[0], inAxis))
00409         )
00410         {
00411             return false;
00412         }
00413 
00414     return obj->GetLinearMotorVelocity(static_cast<Joint::EAxisIndex>(inAxis));
00415 }
00416 
00417 FUNCTION(Joint, getAngularMotorVelocity)
00418 {
00419     int inAxis;
00420 
00421     if (
00422         (in.GetSize() != 1) ||
00423         (! in.GetValue(in[0], inAxis))
00424         )
00425         {
00426             return false;
00427         }
00428 
00429     return obj->GetAngularMotorVelocity(static_cast<Joint::EAxisIndex>(inAxis));
00430 }
00431 
00432 FUNCTION(Joint, setAngularMotorVelocity)
00433 {
00434     int inAxis;
00435     float inDeg;
00436 
00437     if (
00438         (in.GetSize() != 2) ||
00439         (! in.GetValue(in[0], inAxis)) ||
00440         (! in.GetValue(in[1], inDeg))
00441         )
00442         {
00443             return false;
00444         }
00445 
00446     obj->SetAngularMotorVelocity(static_cast<Joint::EAxisIndex>(inAxis), inDeg);
00447     return true;
00448 }
00449 
00450 FUNCTION(Joint, setMaxMotorForce)
00451 {
00452     int inAxis;
00453     float inF;
00454 
00455     if (
00456         (in.GetSize() != 2) ||
00457         (! in.GetValue(in[0], inAxis)) ||
00458         (! in.GetValue(in[1], inF))
00459         )
00460         {
00461             return false;
00462         }
00463 
00464     obj->SetMaxMotorForce(static_cast<Joint::EAxisIndex>(inAxis), inF);
00465     return true;
00466 }
00467 
00468 FUNCTION(Joint, getMaxMotorForce)
00469 {
00470     int inAxis;
00471 
00472     if (
00473         (in.GetSize() != 1) ||
00474         (! in.GetValue(in[0], inAxis))
00475         )
00476         {
00477             return false;
00478         }
00479 
00480     return obj->GetMaxMotorForce(static_cast<Joint::EAxisIndex>(inAxis));
00481 }
00482 
00483 void CLASS(Joint)::DefineClass()
00484 {
00485     DEFINE_BASECLASS(oxygen/ODEObject);
00486     DEFINE_FUNCTION(attach);
00487     DEFINE_FUNCTION(setHighStopDeg);
00488     DEFINE_FUNCTION(getHighStopDeg);
00489     DEFINE_FUNCTION(setLowStopDeg);
00490     DEFINE_FUNCTION(getLowStopDeg);
00491     DEFINE_FUNCTION(setHighStopPos);
00492     DEFINE_FUNCTION(getHighStopPos);
00493     DEFINE_FUNCTION(setLowStopPos);
00494     DEFINE_FUNCTION(getLowStopPos);
00495     DEFINE_FUNCTION(getBounce);
00496     DEFINE_FUNCTION(setBounce);
00497     DEFINE_FUNCTION(getCFM);
00498     DEFINE_FUNCTION(setCFM);
00499     DEFINE_FUNCTION(getStopCFM);
00500     DEFINE_FUNCTION(setStopCFM);
00501     DEFINE_FUNCTION(getStopERP);
00502     DEFINE_FUNCTION(setStopERP);
00503     DEFINE_FUNCTION(getSuspensionERP);
00504     DEFINE_FUNCTION(setSuspensionERP);
00505     DEFINE_FUNCTION(getSuspensionCFM);
00506     DEFINE_FUNCTION(setSuspensionCFM);
00507     DEFINE_FUNCTION(setLinearMotorVelocity);
00508     DEFINE_FUNCTION(getLinearMotorVelocity);
00509     DEFINE_FUNCTION(setAngularMotorVelocity);
00510     DEFINE_FUNCTION(getAngularMotorVelocity);
00511     DEFINE_FUNCTION(setMaxMotorForce);
00512     DEFINE_FUNCTION(getMaxMotorForce);
00513 }
00514 

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