main.cpp 685 Bytes
Newer Older
1
#include "ros/ros.h"
2
#include "std_msgs/Float64MultiArray.h"
3 4 5 6 7 8 9

#include <sstream>

int main(int argc, char **argv)
{
    ros::init(argc, argv, "publisher");
    ros::NodeHandle n;
10
    ros::Publisher chatter_pub = n.advertise<std_msgs::Float64MultiArray>("/camera", 1000);
11 12
    ros::Rate loop_rate(10);
    int count = 0;
13

14 15
    while (ros::ok())
    {
16 17 18 19 20
        std_msgs::Float64MultiArray msg;
	msg.data.resize(512 * 512);
        msg.data[0] = double(count) / 1000.; // Set first bit to "iteration/1000" for debugging
        
        ROS_INFO("%f", msg.data[0]);
21 22 23 24 25 26 27
        chatter_pub.publish(msg);
        ros::spinOnce();
        loop_rate.sleep();
        ++count;
    }
    return 0;
}