Personal fork

Dependencies:   MODSERIAL

Dependents:   rosserial_mbed

Fork of rosserial_mbed_lib by nucho

Revision:
5:19c5437ed9fe
Parent:
3:1cf99502f396
--- a/ros/duration.h	Wed Feb 29 23:00:21 2012 +0000
+++ b/ros/duration.h	Thu May 01 06:01:31 2014 +0000
@@ -35,6 +35,8 @@
 #ifndef _ROS_DURATION_H_
 #define _ROS_DURATION_H_
 
+#include <math.h>
+
 namespace ros {
 
   void normalizeSecNSecSigned(long& sec, long& nsec);
@@ -49,6 +51,9 @@
       {
         normalizeSecNSecSigned(sec, nsec);
       }
+      
+      //double toSec() const { return (double)sec + 1e-9*(double)nsec; };
+      //void fromSec(double t) { sec = (unsigned long) floor(t); nsec = (unsigned long) round((t-sec) * 1e9); };void fromSec(double t) { sec = (unsigned long) floor(t); nsec = (unsigned long) round((t-sec) * 1e9); };
 
       Duration& operator+=(const Duration &rhs);
       Duration& operator-=(const Duration &rhs);