time_modi.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2010, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage, Inc. nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 #ifdef _MSC_VER
35 #ifndef NOMINMAX
36 #define NOMINMAX
37 #endif
38 #endif
39 
40 #include "ros/time.h"
41 #include "ros/impl/time.h"
42 #include <cmath>
43 #include <ctime>
44 #include <iomanip>
45 #include <stdexcept>
46 #include <limits>
47 #if defined _MSV_VER || defined _MSC_VER
48 #include <usleep.h>
49 #endif
50  // time related includes for macOS
51 #if defined(__APPLE__)
52 #include <mach/clock.h>
53 #include <mach/mach.h>
54 #endif // defined(__APPLE__)
55 
56 #include <thread>
57 #include <mutex>
58 #include <sstream>
59 //#include <boost/io/ios_state.hpp>
60 //#include <boost/date_time/posix_time/ptime.hpp>
61 
62 /*********************************************************************
63  ** Preprocessor
64  *********************************************************************/
65 
66  // Could probably do some better and more elaborate checking
67  // and definition here.
68 #define HAS_CLOCK_GETTIME (_POSIX_C_SOURCE >= 199309L)
69 
70 /*********************************************************************
71  ** Namespaces
72  *********************************************************************/
73 
74 namespace roswrap
75 {
76 
77  /*********************************************************************
78  ** Variables
79  *********************************************************************/
80 
81  const Duration DURATION_MAX(std::numeric_limits<int32_t>::max(), 999999999);
82  const Duration DURATION_MIN(std::numeric_limits<int32_t>::min(), 0);
83 
84  const Time TIME_MAX(std::numeric_limits<uint32_t>::max(), 999999999);
85  const Time TIME_MIN(0, 1);
86 
87  // This is declared here because it's set from the Time class but read from
88  // the Duration class, and need not be exported to users of either.
89  static bool g_stopped(false);
90 
91  // I assume that this is declared here, instead of time.h, to keep users
92  // of time.h from including mutex
93  static std::mutex g_sim_time_mutex;
94 
95  static bool g_initialized(true); //
96  static bool g_use_sim_time(true);
97  static Time g_sim_time(0, 0);
98 
99  /*********************************************************************
100  ** Cross Platform Functions
101  *********************************************************************/
102  /*
103  * These have only internal linkage to this translation unit.
104  * (i.e. not exposed to users of the time classes)
105  */
106  void ros_walltime(uint32_t& sec, uint32_t& nsec)
107  {
108 #ifndef WIN32
109 #if HAS_CLOCK_GETTIME
110  timespec start;
111  clock_gettime(CLOCK_REALTIME, &start);
112  if (start.tv_sec < 0 || start.tv_sec > UINT_MAX)
113  throw std::runtime_error("Timespec is out of dual 32-bit range");
114  sec = start.tv_sec;
115  nsec = start.tv_nsec;
116 #else
117  struct timeval timeofday;
118  gettimeofday(&timeofday, NULL);
119  if (timeofday.tv_sec < 0 || timeofday.tv_sec > UINT_MAX)
120  throw std::runtime_error("Timeofday is out of dual signed 32-bit range");
121  sec = timeofday.tv_sec;
122  nsec = timeofday.tv_usec * 1000;
123 #endif
124 #else
125  // Win32 implementation
126  // unless I've missed something obvious, the only way to get high-precision
127  // time on Windows is via the QueryPerformanceCounter() call. However,
128  // this is somewhat problematic in Windows XP on some processors, especially
129  // AMD, because the Windows implementation can freak out when the CPU clocks
130  // down to save power. Time can jump or even go backwards. Microsoft has
131  // fixed this bug for most systems now, but it can still show up if you have
132  // not installed the latest CPU drivers (an oxymoron). They fixed all these
133  // problems in Windows Vista, and this API is by far the most accurate that
134  // I know of in Windows, so I'll use it here despite all these caveats
135  static LARGE_INTEGER cpu_freq, init_cpu_time;
136  static uint32_t start_sec = 0;
137  static uint32_t start_nsec = 0;
138  if ((start_sec == 0) && (start_nsec == 0))
139  {
140  QueryPerformanceFrequency(&cpu_freq);
141  if (cpu_freq.QuadPart == 0) {
143  }
144  QueryPerformanceCounter(&init_cpu_time);
145  // compute an offset from the Epoch using the lower-performance timer API
146  FILETIME ft;
147  GetSystemTimeAsFileTime(&ft);
148  LARGE_INTEGER start_li;
149  start_li.LowPart = ft.dwLowDateTime;
150  start_li.HighPart = ft.dwHighDateTime;
151  // why did they choose 1601 as the time zero, instead of 1970?
152  // there were no outstanding hard rock bands in 1601.
153 #ifdef _MSC_VER
154  start_li.QuadPart -= 116444736000000000Ui64;
155 #else
156  start_li.QuadPart -= 116444736000000000ULL;
157 #endif
158  int64_t start_sec64 = start_li.QuadPart / 10000000; // 100-ns units
159  if (start_sec64 < 0 || start_sec64 > UINT_MAX)
160  throw std::runtime_error("SystemTime is out of dual 32-bit range");
161  start_sec = (uint32_t)start_sec64;
162  start_nsec = (start_li.LowPart % 10000000) * 100;
163  }
164  LARGE_INTEGER cur_time;
165  QueryPerformanceCounter(&cur_time);
166  LARGE_INTEGER delta_cpu_time;
167  delta_cpu_time.QuadPart = cur_time.QuadPart - init_cpu_time.QuadPart;
168  // todo: how to handle cpu clock drift. not sure it's a big deal for us.
169  // also, think about clock wraparound. seems extremely unlikey, but possible
170  double d_delta_cpu_time = delta_cpu_time.QuadPart / (double)cpu_freq.QuadPart;
171  uint32_t delta_sec = (uint32_t)floor(d_delta_cpu_time);
172  uint32_t delta_nsec = (uint32_t)std::round((d_delta_cpu_time - delta_sec) * 1e9);
173 
174  int64_t sec_sum = (int64_t)start_sec + (int64_t)delta_sec;
175  int64_t nsec_sum = (int64_t)start_nsec + (int64_t)delta_nsec;
176 
177  // Throws an exception if we go out of 32-bit range
178  normalizeSecNSecUnsigned(sec_sum, nsec_sum);
179 
180  sec = sec_sum;
181  nsec = nsec_sum;
182 #endif
183  }
184 
185  void ros_steadytime(uint32_t& sec, uint32_t& nsec)
186  {
187 #ifndef WIN32
188  timespec start;
189 #if defined(__APPLE__)
190  // On macOS use clock_get_time.
191  clock_serv_t cclock;
192  mach_timespec_t mts;
193  host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &cclock);
194  clock_get_time(cclock, &mts);
195  mach_port_deallocate(mach_task_self(), cclock);
196  start.tv_sec = mts.tv_sec;
197  start.tv_nsec = mts.tv_nsec;
198 #else // defined(__APPLE__)
199  // Otherwise use clock_gettime.
200  clock_gettime(CLOCK_MONOTONIC, &start);
201 #endif // defined(__APPLE__)
202  sec = start.tv_sec;
203  nsec = start.tv_nsec;
204 #else
205  static LARGE_INTEGER cpu_frequency, performance_count;
206  // These should not ever fail since XP is already end of life:
207  // From https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx and
208  // https://msdn.microsoft.com/en-us/library/windows/desktop/ms644904(v=vs.85).aspx:
209  // "On systems that run Windows XP or later, the function will always succeed and will
210  // thus never return zero."
211  QueryPerformanceFrequency(&cpu_frequency);
212  if (cpu_frequency.QuadPart == 0) {
214  }
215  QueryPerformanceCounter(&performance_count);
216  double steady_time = performance_count.QuadPart / (double)cpu_frequency.QuadPart;
217  int64_t steady_sec = floor(steady_time);
218  int64_t steady_nsec = std::round((steady_time - steady_sec) * 1e9);
219 
220  // Throws an exception if we go out of 32-bit range
221  normalizeSecNSecUnsigned(steady_sec, steady_nsec);
222 
223  sec = steady_sec;
224  nsec = steady_nsec;
225 #endif
226  }
227 
231  int ros_nanosleep(const uint32_t &sec, const uint32_t &nsec)
232  {
233 #if defined(WIN32)
234  HANDLE timer = NULL;
235  LARGE_INTEGER sleepTime;
236  sleepTime.QuadPart = -
237  static_cast<int64_t>(sec) * 10000000LL -
238  static_cast<int64_t>(nsec) / 100LL;
239 
240  timer = CreateWaitableTimer(NULL, TRUE, NULL);
241  if (timer == NULL)
242  {
243  return -1;
244  }
245 
246  if (!SetWaitableTimer(timer, &sleepTime, 0, NULL, NULL, 0))
247  {
248  return -1;
249  }
250 
251  if (WaitForSingleObject(timer, INFINITE) != WAIT_OBJECT_0)
252  {
253  return -1;
254  }
255  return 0;
256 #else
257  timespec req = { sec, nsec };
258  return nanosleep(&req, NULL);
259 #endif
260  }
261 
267  bool ros_wallsleep(uint32_t sec, uint32_t nsec)
268  {
269 #if defined(WIN32)
271 #else
272  timespec req = { sec, nsec };
273  timespec rem = { 0, 0 };
274  while (nanosleep(&req, &rem) && !g_stopped)
275  {
276  req = rem;
277  }
278 #endif
279  return !g_stopped;
280  }
281 
282  /*********************************************************************
283  ** Class Methods
284  *********************************************************************/
285 
286  bool Time::useSystemTime()
287  {
288  return !g_use_sim_time;
289  }
290 
291  bool Time::isSimTime()
292  {
294  }
295 
296  bool Time::isSystemTime()
297  {
298  return !isSimTime();
299  }
300 
301  Time Time::now()
302  {
304  {
306  }
307 
308  if (g_use_sim_time)
309  {
310  std::lock_guard<std::mutex> lock(g_sim_time_mutex);
311  Time t = g_sim_time;
312  return t;
313  }
314 
315  Time t;
316  ros_walltime(t.sec, t.nsec);
317 
318  return t;
319  }
320 
321  void Time::setNow(const Time& new_now)
322  {
323  std::lock_guard<std::mutex> lock(g_sim_time_mutex);
324 
325  g_sim_time = new_now;
326  g_use_sim_time = true;
327  }
328 
329  void Time::init()
330  {
331  g_stopped = false;
332  g_use_sim_time = false;
333  g_initialized = true;
334  }
335 
336  void Time::shutdown()
337  {
338  g_stopped = true;
339  }
340 
341  bool Time::isValid()
342  {
344  }
345 
346  bool Time::waitForValid()
347  {
349  }
350 
352  {
354  while (!isValid() && !g_stopped)
355  {
356  ros::WallDuration(0.01).sleep();
357 
359  {
360  return false;
361  }
362  }
363 
364  if (g_stopped)
365  {
366  return false;
367  }
368 
369  return true;
370  }
371  // Time Time::fromBoost(const boost::posix_time::ptime& t)
372  // {
373  // boost::posix_time::time_duration diff = t - boost::posix_time::from_time_t(0);
374  // return Time::fromBoost(diff);
375  // }
376 
377  // Time Time::fromBoost(const boost::posix_time::time_duration& d)
378  // {
379  // Time t;
380  // int64_t sec64 = d.total_seconds();
381  // if (sec64 < 0 || sec64 > UINT_MAX)
382  // throw std::runtime_error("time_duration is out of dual 32-bit range");
383  // t.sec = (uint32_t)sec64;
384  // #if defined(BOOST_DATE_TIME_HAS_NANOSECONDS)
385  // t.nsec = d.fractional_seconds();
386  // #else
387  // t.nsec = d.fractional_seconds() * 1000;
388  // #endif
389  // return t;
390  // }
391 
392  std::ostream& operator<<(std::ostream& os, const Time &rhs)
393  {
394  // boost::io::ios_all_saver s(os);
395  std::stringstream s;
396  s << rhs.sec << "." << std::setw(9) << std::setfill('0') << rhs.nsec;
397  os << s.str();
398  return os;
399  }
400 
401  std::ostream& operator<<(std::ostream& os, const Duration& rhs)
402  {
403  // boost::io::ios_all_saver s(os);
404  std::stringstream s;
405  if (rhs.sec >= 0 || rhs.nsec == 0)
406  {
407  s << rhs.sec << "." << std::setw(9) << std::setfill('0') << rhs.nsec;
408  }
409  else
410  {
411  s << (rhs.sec == -1 ? "-" : "") << (rhs.sec + 1) << "." << std::setw(9) << std::setfill('0') << (1000000000 - rhs.nsec);
412  }
413  os << s.str();
414  return os;
415  }
416 
417  bool Time::sleepUntil(const Time& end)
418  {
420  {
421  Duration d(end - Time::now());
422  if (d > Duration(0))
423  {
424  return d.sleep();
425  }
426 
427  return true;
428  }
429  else
430  {
431  Time start = Time::now();
432  while (!g_stopped && (Time::now() < end))
433  {
434  ros_nanosleep(0, 1000000);
435  if (Time::now() < start)
436  {
437  return false;
438  }
439  }
440 
441  return true;
442  }
443  }
444 
445  bool WallTime::sleepUntil(const WallTime& end)
446  {
448  if (d > WallDuration(0))
449  {
450  return d.sleep();
451  }
452 
453  return true;
454  }
455 #if 0
456  bool SteadyTime::sleepUntil(const SteadyTime& end)
457  {
458  WallDuration d(end - SteadyTime::now());
459  if (d > WallDuration(0))
460  {
461  return d.sleep();
462  }
463 
464  return true;
465  }
466 #endif
467  bool Duration::sleep() const
468  {
469  //TODO check this
470 #ifdef ROSSIMU
471  // usleep(sec * 1000000+nsec/1000);
472  std::this_thread::sleep_for(std::chrono::microseconds(sec * 1000000+nsec/1000));
473  return(true);
474 #else
475 
476  if (Time::useSystemTime())
477  {
478  return ros_wallsleep(sec, nsec);
479  }
480  else
481  {
482  Time start = Time::now();
483  Time end = start + *this;
484  if (start.isZero())
485  {
486  end = TIME_MAX;
487  }
488 
489  bool rc = false;
490  while (!g_stopped && (Time::now() < end))
491  {
492  ros_wallsleep(0, 1000000);
493  rc = true;
494 
495  // If we started at time 0 wait for the first actual time to arrive before starting the timer on
496  // our sleep
497  if (start.isZero())
498  {
499  start = Time::now();
500  end = start + *this;
501  }
502 
503  // If time jumped backwards from when we started sleeping, return immediately
504  if (Time::now() < start)
505  {
506  return false;
507  }
508  }
509 
510  return rc && !g_stopped;
511  }
512 #endif
513  }
514 
515  std::ostream &operator<<(std::ostream& os, const WallTime &rhs)
516  {
517  // boost::io::ios_all_saver s(os);
518  std::stringstream s;
519  s << rhs.sec << "." << std::setw(9) << std::setfill('0') << rhs.nsec;
520  os << s.str();
521  return os;
522  }
523 
524 #if 0
525  std::ostream &operator<<(std::ostream& os, const SteadyTime &rhs)
526  {
527  boost::io::ios_all_saver s(os);
528  os << rhs.sec << "." << std::setw(9) << std::setfill('0') << rhs.nsec;
529  return os;
530  }
531 #endif
532  WallTime WallTime::now()
533  {
535  ros_walltime(t.sec, t.nsec);
536 
537  return t;
538  }
539 #if 0
540  SteadyTime SteadyTime::now()
541  {
542  SteadyTime t;
543  ros_steadytime(t.sec, t.nsec);
544 
545  return t;
546  }
547 #endif
548  std::ostream &operator<<(std::ostream& os, const WallDuration& rhs)
549  {
550  // boost::io::ios_all_saver s(os);
551  std::stringstream s;
552  if (rhs.sec >= 0 || rhs.nsec == 0)
553  {
554  s << rhs.sec << "." << std::setw(9) << std::setfill('0') << rhs.nsec;
555  }
556  else
557  {
558  s << (rhs.sec == -1 ? "-" : "") << (rhs.sec + 1) << "." << std::setw(9) << std::setfill('0') << (1000000000 - rhs.nsec);
559  }
560  os << s.str();
561  return os;
562  }
563 
564  bool WallDuration::sleep() const
565  {
567  }
568 
569  void normalizeSecNSec(uint64_t& sec, uint64_t& nsec)
570  {
571  uint64_t nsec_part = nsec % 1000000000UL;
572  uint64_t sec_part = nsec / 1000000000UL;
573 
574  if (sec + sec_part > UINT_MAX)
575  throw std::runtime_error(std::string("normalizeSecNSec: time (") + std::to_string(sec) + "," + std::to_string(nsec) + ") is out of dual 32-bit range");
576 
577  sec += sec_part;
578  nsec = nsec_part;
579  }
580 
581  void normalizeSecNSec(uint32_t& sec, uint32_t& nsec)
582  {
583  uint64_t sec64 = sec;
584  uint64_t nsec64 = nsec;
585 
586  normalizeSecNSec(sec64, nsec64);
587 
588  sec = (uint32_t)sec64;
589  nsec = (uint32_t)nsec64;
590  }
591 
592  void normalizeSecNSecUnsigned(int64_t& sec, int64_t& nsec)
593  {
594  int64_t nsec_part = nsec % 1000000000L;
595  int64_t sec_part = sec + nsec / 1000000000L;
596  if (nsec_part < 0)
597  {
598  nsec_part += 1000000000L;
599  --sec_part;
600  }
601 
602  if (sec_part < 0 || sec_part > UINT_MAX)
603  throw std::runtime_error(std::string("normalizeSecNSecUnsigned: time (") + std::to_string(sec) + "," + std::to_string(nsec) + ") is out of dual 32-bit range");
604 
605  sec = sec_part;
606  nsec = nsec_part;
607  }
608 
609  template class TimeBase<Time, Duration>;
610  template class TimeBase<WallTime, WallDuration>;
611 #if 0
612  template class TimeBase<SteadyTime, WallDuration>;
613 #endif
614 }
615 
616 
roswrap::Time::isValid
static bool isValid()
Returns whether or not the current time is valid. Time is valid if it is non-zero.
Definition: time_modi.cpp:343
ros::WallDuration::sleep
bool sleep() const
roswrap::WallTime
Time representation. Always wall-clock time.
Definition: time.h:233
time.h
roswrap::Time
Time representation. May either represent wall clock time or ROS clock time.
Definition: time.h:177
roswrap::WallDuration::sleep
bool sleep() const
sleep for the amount of time specified by this Duration. If a signal interrupts the sleep,...
Definition: time_modi.cpp:566
NULL
#define NULL
roswrap::TimeBase::isZero
bool isZero() const
Definition: time.h:168
s
XmlRpcServer s
roswrap::operator<<
std::ostream & operator<<(std::ostream &os, const Time &rhs)
Definition: time_modi.cpp:394
roswrap::NoHighPerformanceTimersException
Thrown if windoze high perf. timestamping is unavailable.
Definition: time.h:103
roswrap::TIME_MIN
const Time TIME_MIN(0, 1)
Definition: time.h:226
roswrap::normalizeSecNSecUnsigned
void normalizeSecNSecUnsigned(int64_t &sec, int64_t &nsec)
Definition: time_modi.cpp:594
roswrap::ros_wallsleep
bool ros_wallsleep(uint32_t sec, uint32_t nsec)
Go to the wall!
Definition: time_modi.cpp:269
roswrap::Time::sleepUntil
static bool sleepUntil(const Time &end)
Sleep until a specific time has been reached.
Definition: time_modi.cpp:419
roswrap::Time::useSystemTime
static bool useSystemTime()
Definition: time_modi.cpp:288
roswrap::g_use_sim_time
static bool g_use_sim_time(true)
roswrap::DURATION_MIN
const ROSTIME_DECL Duration DURATION_MIN
roswrap::TIME_MAX
const ROSTIME_DECL Time TIME_MAX
ROS::now
ROS::Time now(void)
Definition: ros_wrapper.cpp:116
roswrap::DURATION_MAX
const ROSTIME_DECL Duration DURATION_MAX
roswrap::DurationBase< Duration >::sec
int32_t sec
Definition: duration.h:76
std_msgs::Duration
::std_msgs::Duration_< std::allocator< void > > Duration
Definition: Duration.h:48
nsec
uint32_t nsec(const rosTime &time)
Definition: sick_ros_wrapper.h:175
roswrap::Time::isSystemTime
static bool isSystemTime()
Definition: time_modi.cpp:298
roswrap::Time::init
static void init()
Definition: time_modi.cpp:331
TimeBase< Time, Duration >
roswrap::Duration
Duration representation for use with the Time class.
Definition: duration.h:109
ros::WallTime::now
static WallTime now()
roswrap::g_sim_time_mutex
static std::mutex g_sim_time_mutex
Definition: time_modi.cpp:95
roswrap::DurationBase< Duration >::nsec
int32_t nsec
Definition: duration.h:76
roswrap::WallTime::sleepUntil
static bool sleepUntil(const WallTime &end)
Sleep until a specific time has been reached.
Definition: time_modi.cpp:447
d
d
roswrap::Time::isSimTime
static bool isSimTime()
Definition: time_modi.cpp:293
roswrap
Definition: param_modi.cpp:41
roswrap::WallDuration
Duration representation for use with the WallTime class.
Definition: duration.h:137
sec
uint32_t sec(const rosTime &time)
Definition: sick_ros_wrapper.h:174
ros::WallTime
roswrap::Time::setNow
static void setNow(const Time &new_now)
Definition: time_modi.cpp:323
usleep.h
roswrap::Time::now
static Time now()
Retrieve the current time. If ROS clock time is in use, this returns the time according to the ROS cl...
Definition: time_modi.cpp:303
roswrap::Time::shutdown
static void shutdown()
Definition: time_modi.cpp:338
roswrap::g_initialized
static bool g_initialized(true)
roswrap::g_stopped
static bool g_stopped(false)
roswrap::Time::waitForValid
static bool waitForValid()
Wait for time to become valid.
Definition: time_modi.cpp:348
Time
Definition: Time.hpp:51
roswrap::Duration::sleep
bool sleep() const
sleep for the amount of time specified by this Duration. If a signal interrupts the sleep,...
Definition: time_modi.cpp:469
sick_generic_device_finder.timeout
timeout
Definition: sick_generic_device_finder.py:113
roswrap::ros_nanosleep
int ros_nanosleep(const uint32_t &sec, const uint32_t &nsec)
Simple representation of the rt library nanosleep function.
Definition: time_modi.cpp:233
roswrap::normalizeSecNSec
void normalizeSecNSec(uint64_t &sec, uint64_t &nsec)
Definition: time_modi.cpp:571
roswrap::ros_walltime
void ros_walltime(uint32_t &sec, uint32_t &nsec)
Definition: time_modi.cpp:108
ros::WallDuration
roswrap::g_sim_time
static Time g_sim_time(0, 0)
roswrap::TimeNotInitializedException
Thrown if the ros subsystem hasn't been initialised before use.
Definition: time.h:89
roswrap::start
ROSCPP_DECL void start()
Actually starts the internals of the node (spins up threads, starts the network polling and xmlrpc lo...
roswrap::ros_steadytime
void ros_steadytime(uint32_t &sec, uint32_t &nsec)
Definition: time_modi.cpp:187
t
geometry_msgs::TransformStamped t
roswrap::WallTime::now
static WallTime now()
Returns the current wall clock time.
Definition: time_modi.cpp:534


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:12