Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Follow the tutorial in Publishers and Subscribers to learn how to publish a message.

After that, follow these simple steps.

Step 1 : Read integers from file and store them in an array / vector

Step 2 : Advertise a publisher to a topic of your preference with message type std_msgs/Int64.msg

ros::Publisher pub = nh.advertise<std_msgs::Int64>("topic_name", 5);

Step 3 : Iterate through your integer array/vector and publish them.