test_time.cpp
Go to the documentation of this file.
1 /*
2  * test_time.cpp
3  *
4  * Created on: July 15, 2014
5  * Author: Markus Bader
6  */
7 
8 #include <gtest/gtest.h>
9 #include <mrpt_bridge/time.h>
10 #define __STDC_FORMAT_MACROS
11 #include <inttypes.h>
12 #include <boost/date_time/posix_time/time_formatters.hpp>
13 #include <boost/date_time/posix_time/posix_time.hpp>
14 
15 TEST(Time, basicTest)
16 {
17  mrpt::system::TTimeStamp mtime = mrpt::system::getCurrentLocalTime();
18  ros::Time rtimeDes;
19  mrpt::system::TTimeStamp mtimeDes;
20  mrpt_bridge::convert(mtime, rtimeDes);
21  mrpt_bridge::convert(rtimeDes, mtimeDes);
22  std::cout << "TimeNow: "
23  << boost::posix_time::to_simple_string(rtimeDes.toBoost())
24  << std::endl;
25  EXPECT_EQ(mtime, mtimeDes);
26 }
bool convert(const mrpt_msgs::ObservationRangeBeacon &_msg, const mrpt::poses::CPose3D &_pose, mrpt::obs::CObservationBeaconRanges &_obj)
TEST(Time, basicTest)
Definition: test_time.cpp:15
boost::posix_time::ptime toBoost() const


mrpt_bridge
Author(s): Markus Bader , Raphael Zack
autogenerated on Sat Apr 28 2018 02:49:17