time_test.cpp
Go to the documentation of this file.
00001 //#define COMPILE_TIME_CODE_ROSSERIAL
00002 #ifdef COMPILE_TIME_CODE_ROSSERIAL
00003 
00004 /*
00005  * rosserial::std_msgs::Time Test
00006  * Publishes current time
00007  */
00008 
00009 #include "mbed.h"
00010 #include <ros.h>
00011 #include <ros/time.h>
00012 #include <std_msgs/Time.h>
00013 
00014 
00015 ros::NodeHandle  nh;
00016 
00017 std_msgs::Time test;
00018 ros::Publisher p("my_topic", &test);
00019 
00020 int main() {
00021     nh.initNode();
00022     nh.advertise(p);
00023 
00024     while (1) {
00025         test.data = nh.now();
00026         p.publish( &test );
00027         nh.spinOnce();
00028         wait_ms(10);
00029     }
00030 }
00031 #endif


rosserial_mbed
Author(s): Gary Servin
autogenerated on Sat Oct 7 2017 03:08:46