from re import T
import rospy
from std_srvs.srv import *
from sensor_msgs.msg import LaserScan
import numpy as np
class testArduinoService(object):
def __init__(self):
self.test_client = rospy.ServiceProxy("test_srv2", Trigger)
self.trig_req = TriggerRequest()
self.trig_res = TriggerResponse()
self.subs_lidar = rospy.Subscriber("scan", LaserScan, self.get_scan_data)
self.scan = None
def get_scan_data(self, scan):
self.scan = np.array(scan)
if __name__=="__main__":
rospy.init_node("get_service")
testArduinoService().do_req()