Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: rosserial_mbed_hello_world_publisher_kinetic s-rov-firmware ROS_HCSR04 DISCO-F469NI_LCDTS_demo ... more
Revision 1:a849bf78d77f, committed 2016-12-31
- Comitter:
- garyservin
- Date:
- Sat Dec 31 00:59:58 2016 +0000
- Parent:
- 0:9e9b7db60fd5
- Commit message:
- Add missing round() method
Changed in this revision
| ros/duration.h | Show annotated file Show diff for this revision Revisions of this file |
| ros/time.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 9e9b7db60fd5 -r a849bf78d77f ros/duration.h
--- 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); };
diff -r 9e9b7db60fd5 -r a849bf78d77f ros/time.h
--- a/ros/time.h Sat Dec 31 00:48:34 2016 +0000
+++ b/ros/time.h Sat Dec 31 00:59:58 2016 +0000
@@ -54,6 +54,7 @@
normalizeSecNSec(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); };