RigidTransfo.h

00001 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
00002 /* 
00003  * Copyright (C) 2008 Micha Hersch, EPFL
00004  * RobotCub Consortium, European Commission FP6 Project IST-004370
00005  * email:   micha.hersch@robotcub.org
00006  * website: www.robotcub.org
00007  * Permission is granted to copy, distribute, and/or modify this program
00008  * under the terms of the GNU General Public License, version 2 or any
00009  * later version published by the Free Software Foundation.
00010  *
00011  * A copy of the license can be found at
00012  * http://www.robotcub.org/icub/license/gpl.txt
00013  *
00014  * This program is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
00017  * Public License for more details
00018  */
00019 #ifndef __RIGID_TRANSFO_H__
00020 #define __RIGID_TRANSFO_H__
00021 
00022 #include "mathlib.h"
00023 #include "Translation.h"
00024 #include "Rotation.h"
00025 
00026 
00027 
00028 
00034 class RigidTransfo : public Rotation, public Translation{
00035    
00036  protected:
00037   int adaptive;
00038 
00039  public:
00040    RigidTransfo(){adaptive=1;};
00041 /*   virtual ~RigidTransfo(); */
00042 
00043 
00044    float Update(CVector3_t v, CVector3_t v_tr);
00045 
00046 #ifdef WRONG_UPDATE
00047    void UpdateRotation(CVector3_t v, CVector3_t v_tr);
00048 
00049    void UpdateAxis(CVector3_t v, CVector3_t v_tr,float angle);
00050 
00051    void UpdateTranslation(CVector3_t v, CVector3_t v_tr);
00052 
00053    void UpdateTranslation(CVector3_t v, CVector3_t v_tr,float angle);
00054 
00055    void UpdateAxisAndTranslation(CVector3_t v, CVector3_t v_tr,float angle);
00056 #endif
00057 
00058 
00059   int SetTransfo(CVector3_t beta, CVector3_t transl);
00060  
00061 
00067   virtual void SetRate(float new_eps,float new_eps_tr );
00068 
00074   virtual void ScaleRate(float factor);
00075 
00081   void Transform(const CVector3_t in, CVector3_t out);
00082 
00083 
00084   void Transform(const CVector3_t in, float angle, CVector3_t out)
00085   {SetAngle(angle);Transform(in,out);};
00092    void InverseTransform(const CVector3_t in,CVector3_t out);
00093    void ReverseTransform(const CVector3_t in,CVector3_t out);
00094 
00095    void InverseTransform(CVector3_t in, float angle,CVector3_t out)
00096    {SetAngle(angle);InverseTransform(in,out);};
00097 
00098    void Invert();
00099    void NoLearning(){adaptive=0;};
00100    int IsAdaptive()const{return adaptive;}
00101    void Copy(const RigidTransfo& r){Rotation::Copy(r);Translation::Copy(r);adaptive=r.IsAdaptive();}
00102    RigidTransfo& operator*(const RigidTransfo& rt1);
00103    void Identity(){v_clear(beta);alpha=1;v_clear(trans);}
00104 };
00105 
00109 ostream& operator<<(ostream& out, const RigidTransfo& rt);
00110 
00114 istream& operator>>(istream& in, RigidTransfo& rt);
00115 #endif
 All Data Structures Functions Variables

Generated on Wed Sep 22 16:51:25 2010 for Body_Schema_Learning by  doxygen 1.6.1