test/time.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #include <vector>
31 
32 #include <gtest/gtest.h>
33 #include <ros/rate.h>
34 #include <ros/time.h>
35 #include <sys/time.h>
36 
37 #include <boost/date_time/posix_time/ptime.hpp>
38 
39 using namespace ros;
40 
42 
43 double epsilon = 1e-9;
44 
45 void seed_rand()
46 {
47  //Seed random number generator with current microseond count
48  timeval temp_time_struct;
49  gettimeofday(&temp_time_struct,NULL);
50  srand(temp_time_struct.tv_usec);
51 };
52 
53 void generate_rand_times(uint32_t range, uint64_t runs, std::vector<ros::Time>& values1, std::vector<ros::Time>& values2)
54 {
55  seed_rand();
56  values1.clear();
57  values2.clear();
58  values1.reserve(runs);
59  values2.reserve(runs);
60  for ( uint32_t i = 0; i < runs ; i++ )
61  {
62  values1.push_back(ros::Time( (rand() * range / RAND_MAX), (rand() * 1000000000ULL/RAND_MAX)));
63  values2.push_back(ros::Time( (rand() * range / RAND_MAX), (rand() * 1000000000ULL/RAND_MAX)));
64  }
65 }
66 
67 void generate_rand_durations(uint32_t range, uint64_t runs, std::vector<ros::Duration>& values1, std::vector<ros::Duration>& values2)
68 {
69  seed_rand();
70  values1.clear();
71  values2.clear();
72  values1.reserve(runs * 4);
73  values2.reserve(runs * 4);
74  for ( uint32_t i = 0; i < runs ; i++ )
75  {
76  // positive durations
77  values1.push_back(ros::Duration( (rand() * range / RAND_MAX), (rand() * 1000000000ULL/RAND_MAX)));
78  values2.push_back(ros::Duration( (rand() * range / RAND_MAX), (rand() * 1000000000ULL/RAND_MAX)));
79  EXPECT_GE(values1.back(), ros::Duration(0,0));
80  EXPECT_GE(values2.back(), ros::Duration(0,0));
81 
82  // negative durations
83  values1.push_back(ros::Duration( -(rand() * range / RAND_MAX), -(rand() * 1000000000ULL/RAND_MAX)));
84  values2.push_back(ros::Duration( -(rand() * range / RAND_MAX), -(rand() * 1000000000ULL/RAND_MAX)));
85  EXPECT_LE(values1.back(), ros::Duration(0,0));
86  EXPECT_LE(values2.back(), ros::Duration(0,0));
87 
88  // positive and negative durations
89  values1.push_back(ros::Duration( (rand() * range / RAND_MAX), (rand() * 1000000000ULL/RAND_MAX)));
90  values2.push_back(ros::Duration( -(rand() * range / RAND_MAX), -(rand() * 1000000000ULL/RAND_MAX)));
91  EXPECT_GE(values1.back(), ros::Duration(0,0));
92  EXPECT_LE(values2.back(), ros::Duration(0,0));
93 
94  // negative and positive durations
95  values1.push_back(ros::Duration( -(rand() * range / RAND_MAX), -(rand() * 1000000000ULL/RAND_MAX)));
96  values2.push_back(ros::Duration( (rand() * range / RAND_MAX), (rand() * 1000000000ULL/RAND_MAX)));
97  EXPECT_LE(values1.back(), ros::Duration(0,0));
98  EXPECT_GE(values2.back(), ros::Duration(0,0));
99  }
100 }
101 
102 TEST(Time, size)
103 {
104  ASSERT_EQ(sizeof(Time), 8);
105  ASSERT_EQ(sizeof(Duration), 8);
106 }
107 
108 TEST(Time, Comparitors)
109 {
110  std::vector<ros::Time> v1;
111  std::vector<ros::Time> v2;
112  generate_rand_times(100, 1000, v1,v2);
113 
114  for (uint32_t i = 0; i < v1.size(); i++)
115  {
116  if (v1[i].sec * 1000000000ULL + v1[i].nsec < v2[i].sec * 1000000000ULL + v2[i].nsec)
117  {
118  EXPECT_LT(v1[i], v2[i]);
119  // printf("%f %d ", v1[i].toSec(), v1[i].sec * 1000000000ULL + v1[i].nsec);
120  //printf("vs %f %d\n", v2[i].toSec(), v2[i].sec * 1000000000ULL + v2[i].nsec);
121  EXPECT_LE(v1[i], v2[i]);
122  EXPECT_NE(v1[i], v2[i]);
123  }
124  else if (v1[i].sec * 1000000000ULL + v1[i].nsec > v2[i].sec * 1000000000ULL + v2[i].nsec)
125  {
126  EXPECT_GT(v1[i], v2[i]);
127  EXPECT_GE(v1[i], v2[i]);
128  EXPECT_NE(v1[i], v2[i]);
129  }
130  else
131  {
132  EXPECT_EQ(v1[i], v2[i]);
133  EXPECT_LE(v1[i], v2[i]);
134  EXPECT_GE(v1[i], v2[i]);
135  }
136 
137  }
138 
139 }
140 
141 TEST(Time, ToFromDouble)
142 {
143  std::vector<ros::Time> v1;
144  std::vector<ros::Time> v2;
145  generate_rand_times(100, 1000, v1,v2);
146 
147  for (uint32_t i = 0; i < v1.size(); i++)
148  {
149  EXPECT_EQ(v1[i].toSec(), v1[i].fromSec(v1[i].toSec()).toSec());
150 
151  }
152 
153 }
154 
155 TEST(Time, RoundingError)
156 {
157  double someInt = 1031.0; // some integer
158  double t = std::nextafter(someInt, 0); // someint - epsilon
159  // t should be 1031.000000
160 
161  ros::Time exampleTime;
162  exampleTime.fromSec(t);
163 
164  // if rounded incorrectly, sec may be 1030
165  // and nsec may be 1e9.
166  EXPECT_EQ(exampleTime.sec, 1031);
167  EXPECT_EQ(exampleTime.nsec, 0);
168 }
169 
170 TEST(Time, OperatorPlus)
171 {
172  Time t(100, 0);
173  Duration d(100, 0);
174  Time r = t + d;
175  EXPECT_EQ(r.sec, 200UL);
176  EXPECT_EQ(r.nsec, 0UL);
177 
178  t = Time(0, 100000UL);
179  d = Duration(0, 100UL);
180  r = t + d;
181  EXPECT_EQ(r.sec, 0UL);
182  EXPECT_EQ(r.nsec, 100100UL);
183 
184  t = Time(0, 0);
185  d = Duration(10, 2000003000UL);
186  r = t + d;
187  EXPECT_EQ(r.sec, 12UL);
188  EXPECT_EQ(r.nsec, 3000UL);
189 }
190 
191 TEST(Time, OperatorMinus)
192 {
193  Time t(100, 0);
194  Duration d(100, 0);
195  Time r = t - d;
196  EXPECT_EQ(r.sec, 0UL);
197  EXPECT_EQ(r.nsec, 0UL);
198 
199  t = Time(0, 100000UL);
200  d = Duration(0, 100UL);
201  r = t - d;
202  EXPECT_EQ(r.sec, 0UL);
203  EXPECT_EQ(r.nsec, 99900UL);
204 
205  t = Time(30, 0);
206  d = Duration(10, 2000003000UL);
207  r = t - d;
208  EXPECT_EQ(r.sec, 17UL);
209  EXPECT_EQ(r.nsec, 999997000ULL);
210 }
211 
212 TEST(Time, OperatorPlusEquals)
213 {
214  Time t(100, 0);
215  Duration d(100, 0);
216  t += d;
217  EXPECT_EQ(t.sec, 200UL);
218  EXPECT_EQ(t.nsec, 0UL);
219 
220  t = Time(0, 100000UL);
221  d = Duration(0, 100UL);
222  t += d;
223  EXPECT_EQ(t.sec, 0UL);
224  EXPECT_EQ(t.nsec, 100100UL);
225 
226  t = Time(0, 0);
227  d = Duration(10, 2000003000UL);
228  t += d;
229  EXPECT_EQ(t.sec, 12UL);
230  EXPECT_EQ(t.nsec, 3000UL);
231 }
232 
233 TEST(Time, OperatorMinusEquals)
234 {
235  Time t(100, 0);
236  Duration d(100, 0);
237  t -= d;
238  EXPECT_EQ(t.sec, 0UL);
239  EXPECT_EQ(t.nsec, 0UL);
240 
241  t = Time(0, 100000UL);
242  d = Duration(0, 100UL);
243  t -= d;
244  EXPECT_EQ(t.sec, 0UL);
245  EXPECT_EQ(t.nsec, 99900UL);
246 
247  t = Time(30, 0);
248  d = Duration(10, 2000003000UL);
249  t -= d;
250  EXPECT_EQ(t.sec, 17UL);
251  EXPECT_EQ(t.nsec, 999997000ULL);
252 }
253 
254 TEST(Time, SecNSecConstructor)
255 {
256  Time t(100, 2000003000UL);
257  EXPECT_EQ(t.sec, 102UL);
258  EXPECT_EQ(t.nsec, 3000UL);
259 }
260 
261 TEST(Time, DontMungeStreamState)
262 {
263  std::ostringstream oss;
264  Time t(100, 2000003000UL);
265  oss << std::setfill('N');
266  oss << std::setw(13);
267  oss << t;
268 
269  EXPECT_EQ(oss.width(), 13);
270  EXPECT_EQ(oss.fill(), 'N');
271 }
272 
273 TEST(Time, ToFromBoost)
274 {
275  std::vector<ros::Time> v1;
276  std::vector<ros::Time> v2;
277  generate_rand_times(100, 1000, v1,v2);
278 
279  for (uint32_t i = 0; i < v1.size(); i++)
280  {
281  Time t = v1[i];
282  // dont assume that nanosecond are available
283  t.nsec = uint32_t(t.nsec / 1000.0) * 1000;
284  boost::posix_time::ptime b = t.toBoost();
285  Time tt = Time::fromBoost(b);
286  EXPECT_EQ(t, tt);
287  }
288 }
289 
290 TEST(Time, CastFromDoubleExceptions)
291 {
292  ros::Time::init();
293 
294  Time t1, t2, t3;
295  // Valid values to cast, must not throw exceptions
296  EXPECT_NO_THROW(t1.fromSec(4294967295.0));
297  EXPECT_NO_THROW(t2.fromSec(4294967295.999));
298  EXPECT_NO_THROW(t3.fromSec(0.0000001));
299 
300  // The next casts all incorrect.
301  EXPECT_THROW(t1.fromSec(4294967296.0), std::runtime_error);
302  EXPECT_THROW(t2.fromSec(-0.0001), std::runtime_error);
303  EXPECT_THROW(t3.fromSec(-4294967296.0), std::runtime_error);
304 }
305 
306 TEST(Time, OperatorMinusExceptions)
307 {
308  ros::Time::init();
309 
310  Time t1(2147483648, 0);
311  Time t2(2147483647, 999999999);
312  Time t3(2147483647, 999999998);
313  Time t4(4294967295, 999999999);
314  Time t5(4294967295, 999999998);
315  Time t6(0, 1);
316 
317  Duration d1(2147483647, 999999999);
318  Duration d2(-2147483648, 0);
319  Duration d3(-2147483648, 1);
320  Duration d4(0, 1);
321 
322  EXPECT_NO_THROW(t1 - t2);
323  EXPECT_NO_THROW(t3 - t2);
324  EXPECT_NO_THROW(t4 - t5);
325 
326  EXPECT_NO_THROW(t1 - d1);
327  EXPECT_NO_THROW(t5 - d1);
328 
329  EXPECT_THROW(t4 - t6, std::runtime_error);
330  EXPECT_THROW(t4 - t3, std::runtime_error);
331 
332  EXPECT_THROW(t1 - d2, std::runtime_error);
333  EXPECT_THROW(t2 - d2, std::runtime_error);
334  EXPECT_THROW(t4 - d3, std::runtime_error);
335 }
336 
337 TEST(Time, OperatorPlusExceptions)
338 {
339  ros::Time::init();
340 
341  Time t1(2147483648, 0);
342  Time t2(2147483647, 999999999);
343  Time t4(4294967295, 999999999);
344  Time t5(4294967295, 999999998);
345 
346  Duration d1(2147483647, 999999999);
347  Duration d2(-2147483648, 1);
348  Duration d3(0, 2);
349  Duration d4(0, 1);
350 
351  EXPECT_NO_THROW(t2 + d2);
352  EXPECT_NO_THROW(t1 + d1);
353 
354  EXPECT_THROW(t4 + d4, std::runtime_error);
355  EXPECT_THROW(t4 + d1, std::runtime_error);
356  EXPECT_THROW(t5 + d3, std::runtime_error);
357 }
358 
359 
360 /************************************* Duration Tests *****************/
361 
362 TEST(Duration, Comparitors)
363 {
364  std::vector<ros::Duration> v1;
365  std::vector<ros::Duration> v2;
366  generate_rand_durations(100, 1000, v1,v2);
367 
368  for (uint32_t i = 0; i < v1.size(); i++)
369  {
370  if (v1[i].sec * 1000000000LL + v1[i].nsec < v2[i].sec * 1000000000LL + v2[i].nsec)
371  {
372  EXPECT_LT(v1[i], v2[i]);
373 // printf("%f %lld ", v1[i].toSec(), v1[i].sec * 1000000000LL + v1[i].nsec);
374 // printf("vs %f %lld\n", v2[i].toSec(), v2[i].sec * 1000000000LL + v2[i].nsec);
375  EXPECT_LE(v1[i], v2[i]);
376  EXPECT_NE(v1[i], v2[i]);
377  }
378  else if (v1[i].sec * 1000000000LL + v1[i].nsec > v2[i].sec * 1000000000LL + v2[i].nsec)
379  {
380  EXPECT_GT(v1[i], v2[i]);
381 // printf("%f %lld ", v1[i].toSec(), v1[i].sec * 1000000000LL + v1[i].nsec);
382 // printf("vs %f %lld\n", v2[i].toSec(), v2[i].sec * 1000000000LL + v2[i].nsec);
383  EXPECT_GE(v1[i], v2[i]);
384  EXPECT_NE(v1[i], v2[i]);
385  }
386  else
387  {
388  EXPECT_EQ(v1[i], v2[i]);
389  EXPECT_LE(v1[i], v2[i]);
390  EXPECT_GE(v1[i], v2[i]);
391  }
392 
393  }
394 }
395 
396 TEST(Duration, ToFromSec)
397 {
398  std::vector<ros::Duration> v1;
399  std::vector<ros::Duration> v2;
400  generate_rand_durations(100, 1000, v1,v2);
401 
402  for (uint32_t i = 0; i < v1.size(); i++)
403  {
404  EXPECT_EQ(v1[i].toSec(), v1[i].fromSec(v1[i].toSec()).toSec());
405  EXPECT_GE(ros::Duration(v1[i].toSec()).nsec, 0);
406  }
407 
408  EXPECT_EQ(ros::Duration(-0.5), ros::Duration(-1LL, 500000000LL));
409  EXPECT_EQ(ros::Duration(-0.5), ros::Duration(0, -500000000LL));
410 }
411 
412 
413 TEST(Duration, OperatorPlus)
414 {
415  std::vector<ros::Duration> v1;
416  std::vector<ros::Duration> v2;
417  generate_rand_durations(100, 1000, v1,v2);
418 
419  for (uint32_t i = 0; i < v1.size(); i++)
420  {
421  EXPECT_NEAR(v1[i].toSec() + v2[i].toSec(), (v1[i] + v2[i]).toSec(), epsilon);
422  ros::Duration temp = v1[i];
423  EXPECT_NEAR(v1[i].toSec() + v2[i].toSec(), (temp += v2[i]).toSec(), epsilon);
424 
425  }
426 
427 }
428 
429 TEST(Duration, OperatorMinus)
430 {
431  std::vector<ros::Duration> v1;
432  std::vector<ros::Duration> v2;
433  generate_rand_durations(100, 1000, v1,v2);
434 
435  for (uint32_t i = 0; i < v1.size(); i++)
436  {
437  EXPECT_NEAR(v1[i].toSec() - v2[i].toSec(), (v1[i] - v2[i]).toSec(), epsilon);
438  ros::Duration temp = v1[i];
439  EXPECT_NEAR(v1[i].toSec() - v2[i].toSec(), (temp -= v2[i]).toSec(), epsilon);
440 
441  EXPECT_NEAR(- v2[i].toSec(), (-v2[i]).toSec(), epsilon);
442 
443  }
444 
445 }
446 
447 TEST(Duration, OperatorTimes)
448 {
449  std::vector<ros::Duration> v1;
450  std::vector<ros::Duration> v2;
451  generate_rand_durations(100, 1000, v1,v2);
452 
453  for (uint32_t i = 0; i < v1.size(); i++)
454  {
455  EXPECT_NEAR(v1[i].toSec() * v2[i].toSec(), (v1[i] * v2[i].toSec()).toSec(), epsilon);
456  ros::Duration temp = v1[i];
457  EXPECT_NEAR(v1[i].toSec() * v2[i].toSec(), (temp *= v2[i].toSec()).toSec(), epsilon);
458 
459  }
460 
461 }
462 
463 TEST(Duration, OperatorPlusEquals)
464 {
465  Duration t(100, 0);
466  Duration d(100, 0);
467  t += d;
468  EXPECT_EQ(t.sec, 200L);
469  EXPECT_EQ(t.nsec, 0L);
470 
471  t = Duration(0, 100000L);
472  d = Duration(0, 100L);
473  t += d;
474  EXPECT_EQ(t.sec, 0L);
475  EXPECT_EQ(t.nsec, 100100L);
476 
477  t = Duration(0, 0);
478  d = Duration(10, 2000003000L);
479  t += d;
480  EXPECT_EQ(t.sec, 12L);
481  EXPECT_EQ(t.nsec, 3000L);
482 }
483 
484 TEST(Duration, OperatorMinusEquals)
485 {
486  Duration t(100, 0);
487  Duration d(100, 0);
488  t -= d;
489  EXPECT_EQ(t.sec, 0L);
490  EXPECT_EQ(t.nsec, 0L);
491 
492  t = Duration(0, 100000L);
493  d = Duration(0, 100L);
494  t -= d;
495  EXPECT_EQ(t.sec, 0L);
496  EXPECT_EQ(t.nsec, 99900L);
497 
498  t = Duration(30, 0);
499  d = Duration(10, 2000003000L);
500  t -= d;
501  EXPECT_EQ(t.sec, 17L);
502  EXPECT_EQ(t.nsec, 999997000L);
503 }
504 
505 void alarmHandler(int sig)
506 {
507 
508 }
509 
510 TEST(Duration, sleepWithSignal)
511 {
512  signal(SIGALRM, alarmHandler);
513  alarm(1);
514  Time start = Time::now();
515  Duration d(2.0);
516  bool rc = d.sleep();
517  Time end = Time::now();
518 
519  ASSERT_GT(end - start, d);
520  ASSERT_TRUE(rc);
521 }
522 
523 TEST(Rate, constructFromDuration){
524  Duration d(4, 0);
525  Rate r(d);
526  EXPECT_EQ(r.expectedCycleTime(), d);
527 }
528 
529 TEST(Rate, sleep_return_value_true){
530  Rate r(Duration(0.2));
531  Duration(r.expectedCycleTime() * 0.5).sleep();
532  EXPECT_TRUE(r.sleep());
533 }
534 
535 TEST(Rate, sleep_return_value_false){
536  Rate r(Duration(0.2));
537  Duration(r.expectedCycleTime() * 2).sleep();
538  EXPECT_FALSE(r.sleep()); // requested rate cannot be achieved
539 }
540 
541 TEST(WallRate, constructFromDuration){
542  Duration d(4, 0);
543  WallRate r(d);
544  WallDuration wd(4, 0);
545  EXPECT_EQ(r.expectedCycleTime(), wd);
546 }
547 
549 // WallTime/WallDuration
551 
552 
554 // SteadyTime/WallDuration
556 
557 TEST(SteadyTime, sleep){
558  SteadyTime start = SteadyTime::now();
559  WallDuration d(2.0);
560  bool rc = d.sleep();
561  SteadyTime end = SteadyTime::now();
562 
563  ASSERT_GT(end - start, d);
564  ASSERT_TRUE(rc);
565 }
566 
567 TEST(SteadyTime, sleepUntil){
568  SteadyTime start = SteadyTime::now();
569  SteadyTime end = start + WallDuration(2.0);
570  bool rc = SteadyTime::sleepUntil(end);
571  SteadyTime finished = SteadyTime::now();
572 
573  ASSERT_GT(finished, end);
574  ASSERT_TRUE(rc);
575 }
576 
577 int main(int argc, char **argv){
578  testing::InitGoogleTest(&argc, argv);
579  ros::Time::init();
580  return RUN_ALL_TESTS();
581 }
double epsilon
Definition: test/time.cpp:43
void seed_rand()
Definition: test/time.cpp:45
Time representation. May either represent wall clock time or ROS clock time.
Definition: time.h:180
uint32_t sec
Definition: time.h:133
bool sleep() const
sleep for the amount of time specified by this Duration. If a signal interrupts the sleep...
Definition: src/time.cpp:461
Class to help run loops at a desired frequency.
Definition: rate.h:51
Duration representation for use with the WallTime class.
Definition: duration.h:136
uint32_t nsec
Definition: time.h:133
int32_t nsec
Definition: duration.h:75
void alarmHandler(int sig)
Definition: test/time.cpp:505
Class to help run loops at a desired frequency. This version always uses wall-clock time...
Definition: rate.h:92
void generate_rand_durations(uint32_t range, uint64_t runs, std::vector< ros::Duration > &values1, std::vector< ros::Duration > &values2)
Definition: test/time.cpp:67
bool sleep() const
sleep for the amount of time specified by this Duration. If a signal interrupts the sleep...
Definition: src/time.cpp:545
static bool sleepUntil(const SteadyTime &end)
Sleep until a specific time has been reached.
Definition: src/time.cpp:450
static SteadyTime now()
Returns the current steady (monotonic) clock time.
Definition: src/time.cpp:523
TEST(Time, size)
Definition: test/time.cpp:102
Duration expectedCycleTime() const
Get the expected cycle time – one over the frequency passed in to the constructor.
Definition: rate.h:81
static void init()
Definition: src/time.cpp:326
Time representation. Always steady-clock time.
Definition: time.h:270
bool sleep()
Sleeps for any leftover time in a cycle. Calculated from the last time sleep, reset, or the constructor was called.
Definition: rate.cpp:56
Duration representation for use with the Time class.
Definition: duration.h:108
WallDuration expectedCycleTime() const
Get the expected cycle time – one over the frequency passed in to the constructor.
Definition: rate.h:122
T & fromSec(double t)
Definition: time.h:154
static Time now()
Retrieve the current time. If ROS clock time is in use, this returns the time according to the ROS cl...
Definition: src/time.cpp:298
static Time fromBoost(const boost::posix_time::ptime &t)
Definition: src/time.cpp:369
boost::posix_time::ptime toBoost() const
Definition: impl/time.h:164
void generate_rand_times(uint32_t range, uint64_t runs, std::vector< ros::Time > &values1, std::vector< ros::Time > &values2)
Definition: test/time.cpp:53
int main(int argc, char **argv)
Definition: test/time.cpp:577


rostime
Author(s): Josh Faust
autogenerated on Sat Jun 9 2018 02:21:15