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.
Dependencies: rosserial_mbed_lib mbed Servo
Diff: tests/time_test.cpp
- Revision:
- 0:06fc856e99ca
diff -r 000000000000 -r 06fc856e99ca tests/time_test.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/time_test.cpp Fri Aug 19 09:06:16 2011 +0000
@@ -0,0 +1,31 @@
+//#define COMPILE_TIME_CODE_ROSSERIAL
+#ifdef COMPILE_TIME_CODE_ROSSERIAL
+
+/*
+ * rosserial::std_msgs::Time Test
+ * Publishes current time
+ */
+
+#include "mbed.h"
+#include <ros.h>
+#include <ros/time.h>
+#include <std_msgs/Time.h>
+
+
+ros::NodeHandle nh;
+
+std_msgs::Time test;
+ros::Publisher p("my_topic", &test);
+
+int main() {
+ nh.initNode();
+ nh.advertise(p);
+
+ while (1) {
+ test.data = nh.now();
+ p.publish( &test );
+ nh.spinOnce();
+ wait_ms(10);
+ }
+}
+#endif
\ No newline at end of file