Working readout for beacon frequency thanks to Dylan!

This commit is contained in:
2018-08-09 22:21:18 -07:00
parent d9e8458797
commit c3a98cc0a7
6 changed files with 293 additions and 202 deletions

View File

@@ -0,0 +1,30 @@
#!/usr/bin/env python
import rospy
import time
from std_msgs.msg import Float64MultiArray
class RDFProceesor(object):
def __init__(self):
super(RDFProceesor, self).__init__()
self.sub = rospy.Subscriber("/rover_science/rdf/data", Float64MultiArray, self.on_rdf_data_received)
self.new_data = False
self.current_data = None
print self.sub
def run(self):
while True:
if self.new_data:
print self.current_data
self.new_data = False
time.sleep(0.01)
def on_rdf_data_received(self, rdf_data):
print rdf_data
self.current_data = rdf_data
self.new_data = True
if __name__ == '__main__':
processor = RDFProceesor()
processor.run()