Go to the documentation of this file.00001 #include "ros/ros.h"
00002 #include "std_msgs/String.h"
00003 #include "smart_battery_msgs/SmartBatteryStatus.h"
00004 #include <sstream>
00005
00006 int main(int argc, char **argv){
00007 ros::init(argc, argv, "talker");
00008 ros::NodeHandle n;
00009 ros::Publisher chatter_pub = n.advertise<smart_battery_msgs::SmartBatteryStatus>("/battery0", 1);
00010 ros::Rate loop_rate(10);
00011
00012 int count = 0;
00013 while (ros::ok()){
00014 smart_battery_msgs::SmartBatteryStatus stat;
00015 stat.voltage = 10.9;
00016 chatter_pub.publish(stat);
00017 ros::spinOnce();
00018
00019 loop_rate.sleep();
00020 }
00021 return 0;
00022 }