KChainOrientationBodySchema.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 __K_CHAIN_ORIENTATION_BODY_SCHEMA_H__
00020 #define __K_CHAIN_ORIENTATION_BODY_SCHEMA_H__
00021 
00022 #include "KChainBodySchema.h"
00023 
00027 class KChainOrientationBodySchema : public KChainBodySchema{
00028 
00029  protected:
00030   float rot_tol;
00031 
00032 
00033  public:
00034  KChainOrientationBodySchema():KChainBodySchema(){rot_tol=0.05;};
00035     KChainOrientationBodySchema(int teles):KChainBodySchema(teles){rot_tol=0.05;};
00036   virtual ~KChainOrientationBodySchema(){};
00037   //  KChainOrientationBodySchema(char *filename):BodySchema(),KinematicChain(){BodySchema::Load(filename);};
00038   //  KChainBodySchema(const KinematicChain& chain);
00039   void Angle2Cart(joint_vec_t& angles,cart_vec_t& pos)
00040   {KinematicChain::SetAngles(angles.GetArray());Angle2Cart(pos);}
00041   void Angle2Cart(cart_vec_t& pos)
00042   {Rotation r;ForwardKinematics(pos.GetArray());GlobalRotation(r);r.GetRotationParam(pos.GetArray()+3);}
00043   int InverseKinematics(const cart_vec_t& pos,joint_vec_t& angles);
00044   /* int InverseKinematics(const cart_vec_t& pos,joint_vec_t& start_angle,joint_vec_t& angles) */
00045 /*   {SetAngles(start_angle.GetArray()); return InverseKinematics(pos,angles);} */
00046  /*  void SetRandomAngle(joint_vec_t& angles) */
00047 /*   {GetRandomAngle(angles);SetAngles(angles.GetArray());} */
00048   void Jacobian(Matrix& jac);//jac is assumed to of the right dimension
00049   // void Jacobian(joint_vec_t& angles, Matrix& jac){SetAngles(angles.GetArray());Jacobian(jac);}
00050   //  void Load(istream& in){in>>*((KinematicChain *)this);};
00051   // void Print(ostream& out)const{out<<"P "<<*((KinematicChain *)this);}
00052   // void GetWeights(cart_vec_t& cart_weights, joint_vec_t& joint_weights);
00053   // void SetPosition(joint_vec_t& angles){SetAngles(angles.GetArray());};
00054   // void GetAngles(joint_vec_t& angles){KinematicChain::GetAngles(angles.GetArray());};
00055   void AddVirtualRotationAxis(){};
00056 
00057 /* virtual float UpdateTransfo(joint_vec_t& proprio, cart_vec_t& vision) */
00058 /*     {return UpdateToolTransfo(proprio,vision);} */
00059 /*   virtual float UpdateToolTransfo(joint_vec_t& proprio, cart_vec_t& vision) */
00060 /*     {return Update(proprio,vision);}//maybe update a single transfo */
00061 /*   virtual void ShowTransformation(){cout<<(KinematicChain )(*this)<<endl;} */
00062 
00063  protected:
00064   float TryInverseKinematics(const cart_vec_t);
00065 
00066 };
00067 
00068 
00069 
00070 
00071 
00072 
00073 #endif
 All Data Structures Functions Variables

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