ArTimeToROSTime.h
Go to the documentation of this file.
00001 
00002 #ifndef ARTIMETOROSTIMESTAMP_H
00003 #define ARTIMETOROSTIMESTAMP_H
00004 
00005 #include <ros/ros.h>
00006 
00007 #ifdef ADEPT_PKG
00008 #include "ariaUtil.h"
00009 #else
00010 #include "Aria/ariaUtil.h"
00011 #endif
00012 
00013 ros::Time convertArTimeToROS(const ArTime& t)
00014 {
00015   // ARIA/ARNL times are in reference to an arbitrary starting time, not OS
00016   // clock, so find the time elapsed between now and t
00017   // to adjust the time stamp in ROS time vs. now accordingly.
00018   ArTime arianow;
00019   const double dtsec = (double) t.mSecSince(arianow) / 1000.0;
00020   //printf("was %f seconds ago\n", dtsec);
00021   return ros::Time(ros::Time::now().toSec() - dtsec);
00022 }
00023 
00024 #endif


rosaria
Author(s): Srećko Jurić-Kavelj
autogenerated on Thu Jun 6 2019 22:00:56