예제 #1
0
  FrameStoreConfig *
  FrameStoreInit::createFrameStoreConfig()
  {
    FrameStoreConfig * config = NULL;

#ifdef RTIDDS_FOUND
    config = FrameStoreConfigTypeSupport::create_data();

    Miro::RobotParameters * params = Miro::RobotParameters::instance();

    // populate header
    strncpy(config->hdr.srcName, params->name.c_str(), 32);
    strncpy(config->hdr.assetName, params->name.c_str(), 32);
    config->hdr.serial = m_serialId++;

    ACE_Time_Value const timestamp = ACE_OS::gettimeofday();
    ACE_UINT64 uSec;
    timestamp.to_usec(uSec);
    config->hdr.timeStamp = ACE_INT64(uSec);


    FrameStore::FrameTree tree;
    m_frameStore->cloneTree(tree);

    FrameStore::FrameTree::const_iterator first, last = tree.end();
    for (first = tree.begin(); first != last; ++first) {
      addToConfig(config, *first);
    }
#endif

    return config;
  }
예제 #2
0
파일: common.cpp 프로젝트: WenzCao/gabriel
uint64 get_usec_tick()
{
    uint64 tick;
    ACE_Time_Value tv = ACE_OS::gettimeofday();
    tv.to_usec(tick);
    
    return tick;
}