20 lines
449 B
Python
20 lines
449 B
Python
|
#! /usr/bin/python
|
||
|
# coding: utf8
|
||
|
|
||
|
import sys
|
||
|
import rospy
|
||
|
import csv
|
||
|
|
||
|
from std_msgs.msg import Float64
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
rospy.init_node('publish_csv', anonymous=True)
|
||
|
pub = rospy.Publisher('output', Float64, queue_size=1)
|
||
|
file = sys.argv[1]
|
||
|
with open(file) as csvfile:
|
||
|
reader = csv.reader(csvfile)
|
||
|
r = rospy.Rate(20)
|
||
|
for row in reader:
|
||
|
pub.publish(float(row[1]))
|
||
|
r.sleep()
|