Changeset 223 in flair-src for trunk/lib/FlairSensorActuator/src


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

add delta time to io_data

Location:
trunk/lib/FlairSensorActuator/src
Files:
2 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
  • trunk/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h

    r214 r223  
    6767  vrpn_Tracker_Remote *tracker;
    6868  void Update(void);
     69  flair::core::Time previousTime;
    6970};
    7071
Note: See TracChangeset for help on using the changeset viewer.