Personal fork
Fork of rosserial_mbed_lib by
Embed:
(wiki syntax)
Show/hide line numbers
time_test.cpp
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
Generated on Tue Jul 12 2022 19:53:57 by 1.7.2