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

HISpidarG6.h

00001 #ifndef HDSPIDARG6_H
00002 #define HDSPIDARG6_H
00003 
00004 #include "HIHapticDevice.h"
00005 #include "HISpidarMotor.h"
00006 #include "Device/DVPioBase.h"
00007 #include "Device/DVDeviceManager.h"
00008 #include "HISpidarCalc6Dof.h"
00009 
00010 namespace Spr {;
00011 
00012 /** @JA エンドエフェクタ(グリップ)が剛体で6自由度なSPIDAR.糸の本数は可変.
00013     @EN A SPIDAR with a 6DOF solid grip. The number of the strings is variable.@@*/
00014 class SPR_DLL HISpidarG6: public HIForceDevice6D,public HISpidarCalc6Dof{
00015 public:
00016     std::vector<HISpidarMotor> motor;   ///<    モータ
00017     std::vector<DVPioBase*> button; ///<    ボタン
00018 
00019     /// デバイスのタイプ
00020     HIOBJECTDEF(HISpidarG6);
00021 
00022     HISpidarG6();
00023     virtual ~HISpidarG6();
00024     /// デバイスの初期化(使用前に呼ぶ)
00025     bool Init(DVDeviceManager& dev, int nMotor, const Vec3f(* motorPos)[2], float vpn, float lpp, float minF, float maxF);
00026     /// キャリブレーションの前に行う処理
00027     virtual bool BeforeCalib(){ SetMinForce(); return true; }
00028     /// キャリブレーション
00029     virtual bool Calib();
00030     /// 最低張力を出力
00031     void SetMinForce();
00032     
00033     /// 位置の取得
00034     Vec3f GetPos(){ return pos; }
00035     /// 角度の取得
00036     Quaternionf GetOri(){ return ori; }
00037     
00038     /// 力の設定
00039     void SetForce(const Vec3f& f){ SetForce(f, Vec3f()); }
00040     /// トルクの設定
00041     void SetForce(const Vec3f& f, const Vec3f& t){ HISpidarCalc6Dof::SetForce(f, t); }
00042     /// 重み付けの設定
00043     void SetWeight(float s=0.3f, float t=1.0f, float r=6.0f){ smooth=s; lambda_t=t; lambda_r=r; }
00044 
00045     /// 力の取得
00046     Vec3f GetForce(){ return trnForce; }
00047     /// トルクの取得
00048     Vec3f GetTorque(){ return rotForce; }
00049 
00050     /// ボタン情報の取得
00051     int HISpidarG6::GetButton(int ch){
00052         if(button[ch]) return button[ch]->Get();
00053         else return 0;
00054     }
00055 
00056     /// デバイスの状態を更新する.
00057     virtual void Update(float dt);
00058     virtual void Update(){ HISpidarCalc6Dof::Update(); }
00059 
00060 protected:
00061     virtual void MakeWireVec();                 ///<    ワイヤ方向ベクトルの計算
00062     virtual void UpdatePos();                   ///<    ワイヤ設置位置座標の更新
00063     virtual void MeasureWire();                 ///<    ワイヤ長の計測
00064 };
00065 
00066 }   //  namespace Spr
00067 #endif

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