Ignore:
Timestamp:
Feb 27, 2018, 12:20:03 PM (4 years ago)
Author:
Sanahuja Guillaume
Message:

add delta time to io_data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairFilter/src/AhrsComplementaryFilter.cpp

    r198 r223  
    3535namespace flair { namespace filter {
    3636
    37 AhrsComplementaryFilter::AhrsComplementaryFilter(const Imu* parent,string name): isInit(false), Ahrs(parent,name) {
     37AhrsComplementaryFilter::AhrsComplementaryFilter(const Imu* parent,string name): Ahrs(parent,name) {
    3838
    3939  QHat.q0=1;
     
    7676    input->GetRawAccMagAndGyr(rawAcc,rawMag,rawGyr);
    7777
    78     delta_t=(float)(data->DataTime()-previous_time)/1000000000.;
    79     previous_time=data->DataTime();
     78    delta_t=(float)(data->DataDeltaTime())/1000000000.;
    8079
    8180    Vector3Df aBar,aHat,aTilde;
     
    8988    magRef=this->magRef->Value();
    9089
    91     if(isInit==true) {
     90    if(delta_t!=0) {
    9291        // CORRECTION FROM ACCELEROMETER
    9392        aBar = rawAcc;
     
    153152        ahrsData->SetQuaternionAndAngularRates(QHat,rawGyr - BHat);
    154153
    155     } else {
    156         isInit=true;
    157     }
     154    }
    158155
    159156    ahrsData->SetDataTime(data->DataTime());
Note: See TracChangeset for help on using the changeset viewer.