ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Figured it out. For those that might run into this to.
This video helped explain it to me. http://vimeo.com/24616666
import roslib; roslib.load_manifest('sensorcsv')
import rospy
# from rosserial_arduino import adc
from std_msgs.msg import UInt16
from rosserial_arduino.msg import Adc
def callback(data):
print "Callback"
print data.adc0, data.adc1, data.adc2, data.adc3, data.adc4, data.adc5
# print rospy.get_name()+': ' + str(data.data)
def listener():
print "listener"
rospy.init_node('listener')
rospy.Subscriber("adc", Adc, callback)
print "rospy.subscriber"
rospy.spin()
print "rospy.spin()"
if __name__ == '__main__':
print "Main"
listener()