hairo

Dependencies:   mbed BufferedSerial

Revision:
1:a849bf78d77f
Parent:
0:9e9b7db60fd5
--- a/ros/duration.h	Sat Dec 31 00:48:34 2016 +0000
+++ b/ros/duration.h	Sat Dec 31 00:59:58 2016 +0000
@@ -53,6 +53,7 @@
         normalizeSecNSecSigned(sec, nsec);
       }
 
+      double round(double number) { return number < 0.0 ? ceil(number - 0.5): floor(number + 0.5); }
       double toSec() const { return (double)sec + 1e-9*(double)nsec; };
       void fromSec(double t) { sec = (uint32_t) floor(t); nsec = (uint32_t) round((t-sec) * 1e9); };