mirror of
https://github.com/OSURoboticsClub/Rover_2017_2018.git
synced 2025-11-08 18:21:15 +00:00
Working readout for beacon frequency thanks to Dylan!
This commit is contained in:
30
software/testing/rdf_data_processing.py
Executable file
30
software/testing/rdf_data_processing.py
Executable 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()
|
||||
Reference in New Issue
Block a user