Changeset 19558

Show
Ignore:
Timestamp:
11/16/06 18:46:40 (2 years ago)
Author:
aronb
Message:

- Try to use quaternions for rotation. This should still work with older hardware that does not support quaternions since we load the tracker state again after setting the values.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/gadgeteer/drivers/Intersense/IntersenseAPI/IntersenseAPI.cpp

    r19337 r19558  
    149149      mTracker.loadConfigState(station_index); 
    150150      mTracker.setState(station_index, mStations[i].enabled); 
    151       mTracker.setAngleFormat(station_index, ISD_EULER); 
     151      mTracker.setAngleFormat(station_index, ISD_QUATERNION); 
     152      //mTracker.setAngleFormat(station_index, ISD_EULER); 
    152153      mTracker.setInputs(station_index, 
    153154                         mStations[i].useDigital || mStations[i].useAnalog); 
    154155      // Save the config state to the physical tracker. 
    155156      mTracker.saveConfigState(station_index); 
     157      mTracker.loadConfigState(station_index); 
    156158   } 
    157159 
     
    264266                               mTracker.zQuat( stationIndex ), 
    265267                               mTracker.wQuat( stationIndex )); 
    266          gmtl::set( cur_pos_samples[i].mPosData, quatValue ); 
     268         gmtl::setRot( cur_pos_samples[i].mPosData, quatValue ); 
     269         gmtl::setTrans( cur_pos_samples[i].mPosData, 
     270                         gmtl::Vec3f(mTracker.xPos( stationIndex ), 
     271                                     mTracker.yPos( stationIndex ), 
     272                                     mTracker.zPos( stationIndex )) ); 
    267273      } 
    268274 
  • juggler/trunk/modules/gadgeteer/drivers/Intersense/IntersenseAPI/IntersenseAPIStandalone.h

    r18824 r19558  
    291291   float xQuat(const unsigned int i) const 
    292292   { 
     293      return mData.Station[i].Orientation[0]; 
     294   } 
     295 
     296   /** 
     297    * Gets the y quaternion value of the i'th receiver.  
     298    */ 
     299   float yQuat(const unsigned int i) const 
     300   { 
     301      return mData.Station[i].Orientation[1]; 
     302   } 
     303 
     304   /** 
     305    * Gets the z quaternion value of the i'th receiver.  
     306    */ 
     307   float zQuat(const unsigned int i) const 
     308   { 
    293309      return mData.Station[i].Orientation[2]; 
    294    } 
    295  
    296    /** 
    297     * Gets the y quaternion value of the i'th receiver.  
    298     */ 
    299    float yQuat(const unsigned int i) const 
    300    { 
    301       return mData.Station[i].Orientation[1]; 
    302    } 
    303  
    304    /** 
    305     * Gets the z quaternion value of the i'th receiver.  
    306     */ 
    307    float zQuat(const unsigned int i) const 
    308    { 
    309       return mData.Station[i].Orientation[0]; 
    310310   } 
    311311