メインページ | ネームスペース一覧 | クラス階層 | 構成 | Directories | ファイル一覧 | ネームスペースメンバ | 構成メンバ | ファイルメンバ | 関連ページ

HISpidar4Angle.h

00001 #ifndef HDSPIDAR_H
00002 #define HDSPIDAR_H
00003 
00004 #include "HIHapticDevice.h"
00005 #include "HISpidarMotorAngle.h"
00006 #include "Device/DVDeviceManager.h"
00007 #include <vector>
00008 #include <Base/TMatrix.h>
00009 
00010 using namespace  PTM;
00011 namespace Spr {
00012 
00013 class SPR_DLL HISpidar4Angle: public HIForceDevice6D{
00014 public:
00015 
00016     typedef HIForceDevice6D superclass;
00017 protected:
00018     Vec3f initPos[5];
00019     Vec3f pos[5];
00020     /// 位置を計算するための定数
00021     Vec3f posSqrConst;
00022     /// 位置を計算するための行列
00023     Matrix3f matPos;
00024     Vec3f phi[4];
00025     float realtens[4];  // computed tension + min tension
00026     float tension[4];   // computed tension
00027     
00028 protected:
00029     /// モータ
00030     HISpidarMotorAngle motor[4];
00031 
00032     /** 出力可能な力を計算し、その出力の得点を計算する.
00033         @param disable  使用しない糸の番号
00034         @param f        出力したい力. 出力可能な力に変更される.
00035         @param v3Str    4本の糸の向き
00036         @return 得点(力の正確さとモータ出力の大きさで決まる。
00037                 この糸を選択することの正しさ)   */
00038     float AvailableForce(int disable, Vec3f& f, Vec3f* v3Str);
00039     /// 位置を計算するための行列の初期化
00040     void InitMat();
00041 
00042 public:
00043     ///
00044     HISpidar4Angle();
00045     ///
00046     virtual ~HISpidar4Angle();
00047     /// デバイスの初期化(使用前に呼ぶ)
00048     virtual bool Init(DVDeviceManager& dev);
00049     /// デバイスの初期化(使用前に呼ぶ)
00050     virtual bool Init(DVDeviceManager& dev, Vec3f* motorPos, Vec3f* iPos, float vpn, float lpp, float app, float minF, float maxF);
00051     /// キャリブレーションの前に行う処理
00052     virtual bool BeforeCalib(){ SetMinForce(); return true; }
00053     /// キャリブレーション
00054     bool Calib();
00055     /// 最低張力を出力
00056     void SetMinForce();
00057     /// 力の出力
00058     virtual void SetForce(const Vec3f& f){ SetForce(f, 0.1f); }
00059     virtual void SetForce(const Vec3f& f,float eff){ SetForce(f, eff, 0.0f); }
00060     virtual void SetForce(const Vec3f& f, float eff, float cont);
00061     /// デバイスの状態を更新する.
00062     virtual void Update(float dt);
00063     virtual Vec3f GetForce();
00064     virtual Vec3f GetPos(){return Vec3f();}
00065 //追加  
00066     virtual Vec3f GetPos(int i){return pos[i];}
00067 
00068     HISpidarMotor* Motor(){
00069         return motor;
00070     }
00071 
00072 //**************************追加分****************************//
00073     float l1, l2, l3, l4, a1, a2, a3, a4;
00074     float Len[4],Ang[4];
00075     float l1old, l2old, l3old, l4old, a1old, a2old, a3old, a4old;
00076     float l1new, l2new, l3new, l4new, a1new, a2new, a3new, a4new;
00077 
00078     float X, Y, Z, X1, Y1, Z1, X2, Y2, Z2;
00079     float Xnew, Ynew, Znew, X1new, Y1new, Z1new, X2new, Y2new, Z2new;
00080     float deltaX, deltaY, deltaZ, deltaX1, deltaY1, deltaZ1, deltaX2, deltaY2, deltaZ2;
00081 
00082     float   vec1[2], vec2[3],vec3[3];
00083 
00084     TMatrixRow<11,9,float>      matA;
00085     TMatrixRow<9,9,float>       ATA;
00086     TVector<9,float>        deltaL;
00087     TVector<9,float>        LdeltaL;
00088     TVector<11,float>       lengthDiff;
00089     TVector<9,float>        postureDiff;
00090     float sigma;
00091     float errorLen;
00092     float errorAng;
00093 
00094     Vec3f rot;
00095     
00096     void CholeskyFacToGetSolution(TMatrixRow<9,9,float> Q, TVector<9,float> s);
00097     void SetMat(float x,float y, float z, float x1,float y1, float z1, float x2,float y2, float z2);
00098     bool Pos_6dof();
00099     Vec3f GetRot(){return rot;}
00100     void CalcRot();
00101     bool flag;
00102 //************************追加分終了***************************//
00103 
00104 };
00105 
00106 
00107 }   //  namespace Spr
00108 #endif
00109 

Springheadに対してSun Apr 16 01:57:53 2006に生成されました。  doxygen 1.4.1