def run(): cf = conf_loader.ConfLoader("testinfo.yaml") prms = cf.prms['RoutingRequest_xiongan'] print(str(prms)) request = hmi_routing_pb2.RoutingRequest(\ start=hmi_common_pb2.PolygonPoint(\ x=prms['start']['x'], y=prms['start']['y'], z=prms['start']['z']), end=hmi_common_pb2.PolygonPoint(\ x=prms['end']['x'], y=prms['end']['y'], z=prms['end']['z']), start_quaternion=common_geometry_pb2.Quaternion(\ qx=prms['start_quaternion']['qx'], qy=prms['start_quaternion']['qy'],\ qz=prms['start_quaternion']['qz'], qw=prms['start_quaternion']['qw']), end_quaternion=common_geometry_pb2.Quaternion(\ qx=prms['end_quaternion']['qx'], qy=prms['end_quaternion']['qy'],\ qz=prms['end_quaternion']['qz'], qw=prms['end_quaternion']['qw']) ) channel = grpc.insecure_channel("127.0.0.1:8090") stub = hmi_grpc_api_pb2_grpc.HMIGrpcServiceStub(channel) print("Client request: " + str(request)) # response = stub.StartRouting(request) response = stub.StartRouting(request) print("Greeter client received: " + str(response)) time.sleep(2)
def load_conf_parm(self, ymal_filename, params): cf = conf_loader.ConfLoader(ymal_filename) #if not cf None: parms_list = cf.prms[params] #print(parms_list) for each_parm in parms_list: #print (each_parm) self.msgs.append(self.messge_desriptor(**each_parm))
def run(): cf = conf_loader.ConfLoader("testinfo.yaml") prms = cf.prms['CalibrationValidityRequest'] print("CalibrationValidityRequest: " + str(prms)) request = hmi_world_pb2.CalibrationValidityRequest(type=prms['type']) channel = grpc.insecure_channel("172.20.72.16:8090") stub = hmi_grpc_api_pb2_grpc.HMIGrpcServiceStub(channel) print("Client request: " + str(request)) response = stub.CheckCalibrationValidity(request) print("Greeter client received: " + str(response)) time.sleep(2)
def test_disengage_feedback(self): """ """ cf = conf_loader.ConfLoader("testinfo.yaml") prms = cf.prms['DisengageTypeContent'] print(str(prms)) request = hmi_driving_control_pb2.DisengageTypeContent( timestamp=prms['timestamp'], type=prms['type']) channel = grpc.insecure_channel("127.0.0.1:8090") stub = hmi_grpc_api_pb2_grpc.HMIGrpcServiceStub(channel) print("Client request: " + str(request)) response = stub.DisengageTypeFeedback(request) print("Greeter client received: " + str(response)) self.assertTrue(response.code == hmi_error_code_pb2.OK) self.assertTrue(response.info == 'disengage update!') time.sleep(2)
def __init__(self, *args, **kwargs): super(TestLauncher, self).__init__(*args, **kwargs) cf = conf_loader.ConfLoader("conf/hmi_launcher.test.yml") self._test_worker = cf.prms['workers'][0]['name']
import unittest import grpc import hmi_error_code_pb2 import hmi_grpc_api_pb2_grpc import hmi_system_control_pb2 import hmi_routing_pb2 import hmi_common_pb2 import common_geometry_pb2 import conf_loader channel = grpc.insecure_channel('127.0.0.1:8090') stub = hmi_grpc_api_pb2_grpc.HMIGrpcServiceStub(channel) cf = conf_loader.ConfLoader("testinfo.yaml") prms = cf.prms['RoutingRequest_dasha'] print(str(prms)) req = hmi_routing_pb2.RoutingRequest(\ start=hmi_common_pb2.PolygonPoint(\ x=prms['start']['x'], y=prms['start']['y'], z=prms['start']['z']), end=hmi_common_pb2.PolygonPoint(\ x=prms['end']['x'], y=prms['end']['y'], z=prms['end']['z']), start_quaternion=common_geometry_pb2.Quaternion(\ qx=prms['start_quaternion']['qx'], qy=prms['start_quaternion']['qy'],\ qz=prms['start_quaternion']['qz'], qw=prms['start_quaternion']['qw']), end_quaternion=common_geometry_pb2.Quaternion(\ qx=prms['end_quaternion']['qx'], qy=prms['end_quaternion']['qy'],\ qz=prms['end_quaternion']['qz'], qw=prms['end_quaternion']['qw']) )