Ignore:
Timestamp:
02/27/18 12:20:03 (4 years ago)
Author:
Sanahuja Guillaume
Message:

add delta time to io_data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSensorActuator/src/VrpnObject_impl.cpp

    r218 r223  
    9393    parent->pimpl_->AddTrackable(this);
    9494  }
    95  
     95 
     96  previousTime=TIME_INFINITE;
    9697}
    9798
     
    143144  Time time = GetTime();
    144145  //Printf("%s %lld %lld\n",caller->self->ObjectName().c_str(),time,t.msg_time.tv_sec*1000000+t.msg_time.tv_usec);
    145 
     146  Time vrpnTime=t.msg_time.tv_sec*1000000000+t.msg_time.tv_usec*1000;
     147  Time deltaTime;
     148  if(caller->previousTime!=TIME_INFINITE) {
     149    deltaTime=vrpnTime-caller->previousTime;
     150  } else {
     151    deltaTime=TIME_INFINITE;
     152  }
     153  caller->previousTime=vrpnTime;
     154 
    146155  // check if something is nan
    147156  for (int i = 0; i < 3; i++) {
     
    178187  caller->output->SetValueNoMutex(6, 0, pos.z);
    179188
    180   caller->output->SetDataTime(time);
     189  caller->output->SetDataTime(time,deltaTime);
    181190  caller->output->ReleaseMutex();
    182191
Note: See TracChangeset for help on using the changeset viewer.