K AKAGAWA / Mbed 2 deprecated rosserial_helloworld

Dependencies:   mbed ros_lib_kinetic USBDevice

Files at this revision

API Documentation at this revision

Comitter:
ksingyuunyuu
Date:
Mon May 27 04:20:26 2019 +0000
Commit message:
rosserial_helloworld SampleProgram

Changed in this revision

USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
ros_lib_kinetic.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice.lib	Mon May 27 04:20:26 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/USBDevice/#53949e6131f6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon May 27 04:20:26 2019 +0000
@@ -0,0 +1,30 @@
+/*
+ * rosserial Publisher Example
+ * Prints "hello world!"
+ */
+
+#include"mbed.h"
+#include <ros.h>
+#include <std_msgs/String.h>
+
+ros::NodeHandle  nh;
+
+std_msgs::String str_msg;
+ros::Publisher chatter("chatter", &str_msg);
+
+char hello[13] = "hello world!";
+
+DigitalOut led = LED1;
+
+int main() {
+    nh.initNode();
+    nh.advertise(chatter);
+
+    while (1) {
+        led = !led;
+        str_msg.data = hello;
+        chatter.publish( &str_msg );
+        nh.spinOnce();
+        wait_ms(1000);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon May 27 04:20:26 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ros_lib_kinetic.lib	Mon May 27 04:20:26 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/garyservin/code/ros_lib_kinetic/#a849bf78d77f