Translation.cpp

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 #include "Translation.h"
00020 
00021 
00022 Translation::Translation(){
00023   v_clear(trans);
00024   // SetRate(0.0001);
00025   SetRate(0.003);
00026 }
00027 
00028 
00029 void Translation::Update(CVector3_t v, CVector3_t v_tr){
00030   CVector3_t y,v1;
00031   Transform(v,y);
00032   v_sub(v_tr,y,v1);
00033   v_scale(v1,eps_tr,v1);
00034   v_add(trans,v1,trans);
00035 }
00036 
00037 void Translation::Add(CVector3_t dtrans){
00038   CVector3_t v;
00039   v_scale(dtrans,eps_tr,v);
00040   v_add(trans,v,trans);
00041 }
00042 
00043 
00044 
00045 
00046 ostream&  operator<<(ostream& out, const Translation& t){
00047   CVector3_t v;
00048   t.GetTranslation(v);
00049   out<<v[0]<<" "<<v[1]<<" "<<v[2];
00050   return out;
00051 }
00052 
00053 istream& operator>>(istream& in,Translation& t){
00054   CVector3_t v;
00055   in>>v[0]>>v[1]>>v[2];
00056   t.SetTranslation(v);
00057   return in;
00058 }
 All Data Structures Functions Variables

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