From ed9e12a3623305c1ccb336bf254ae26b85aadb6b Mon Sep 17 00:00:00 2001 From: "Inohira, Eiichi" Date: Fri, 5 Nov 2021 10:28:00 +0900 Subject: [PATCH] fix comp name replace comp name with var --- route_guidance_ros/scripts/sa_multi.py | 8 +++++--- route_guidance_ros/scripts/service_app_with_eng_client.py | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/route_guidance_ros/scripts/sa_multi.py b/route_guidance_ros/scripts/sa_multi.py index 2eb11291..e35862c4 100644 --- a/route_guidance_ros/scripts/sa_multi.py +++ b/route_guidance_ros/scripts/sa_multi.py @@ -25,6 +25,8 @@ class Task(enum.Enum): class Service(HRI_Engine_client_sample.IF): + # vn = 'urn:x-rois:def:HRIComponent:Kyutech:robot1:Navigation' + vn = 'urn:x-rois:def:HRIComponent:Kyutech:main:VirtualNavigation' def __init__(self, uri="http://127.0.0.1:8000", logger=None): HRI_Engine_client_sample.IF.__init__(self, uri, logger=None, event_queue=None) # buid state machine @@ -80,7 +82,7 @@ class Service(HRI_Engine_client_sample.IF): print(colored("person localized successfully.", 'green')) dest = results[3] print("Destination is {} ({})".format(dest, type(dest).__name__)) - (return_code, command_id) = self.set_parameter('urn:x-rois:def:HRIComponent:Kyutech:main:Navigation', [dest, "", ""]) + (return_code, command_id) = self.set_parameter(Service.vn, [dest, "", ""]) # (return_code, command_id) = self.set_parameter('urn:x-rois:def:HRIComponent:Kyutech:robot1:Navigation', [dest, "", ""]) status = RoIS_HRI.ReturnCode_t(return_code) if status == RoIS_HRI.ReturnCode_t.OUT_OF_RESOURCES: @@ -98,7 +100,7 @@ class Service(HRI_Engine_client_sample.IF): print(colored("speech recognized successfully.", 'green')) dest = results[2][0] print("Destination is {} ({})".format(dest, type(dest).__name__)) - (return_code, command_id) = self.set_parameter('urn:x-rois:def:HRIComponent:Kyutech:main:Navigation', [dest, "", ""]) + (return_code, command_id) = self.set_parameter(Service.vn, [dest, "", ""]) # (return_code, command_id) = self.set_parameter('urn:x-rois:def:HRIComponent:Kyutech:robot1:Navigation', [dest, "", ""]) status = RoIS_HRI.ReturnCode_t(return_code) if status == RoIS_HRI.ReturnCode_t.BAD_PARAMETER: @@ -125,7 +127,7 @@ class Service(HRI_Engine_client_sample.IF): # self.bind('urn:x-rois:def:HRIComponent:Kyutech:main:SystemInformation') # self.bind('urn:x-rois:def:HRIComponent:Kyutech:main:SpeechRecognition') # self.bind('urn:x-rois:def:HRIComponent:Kyutech:main:PersonLocalization') - self.bind('urn:x-rois:def:HRIComponent:Kyutech:main:Navigation') + self.bind('urn:x-rois:def:HRIComponent:Kyutech:main:VirtualNavigation') self.bind('urn:x-rois:def:HRIComponent:Kyutech:main:PersonLocalization') self.bind('urn:x-rois:def:HRIComponent:Kyutech:robot1:Navigation') self.bind('urn:x-rois:def:HRIComponent:Kyutech:robot1:SystemInformation') diff --git a/route_guidance_ros/scripts/service_app_with_eng_client.py b/route_guidance_ros/scripts/service_app_with_eng_client.py index a9d68589..16b4d3e6 100644 --- a/route_guidance_ros/scripts/service_app_with_eng_client.py +++ b/route_guidance_ros/scripts/service_app_with_eng_client.py @@ -25,6 +25,7 @@ class Task(enum.Enum): class Service(HRI_Engine_client_sample.IF): + vn = 'urn:x-rois:def:HRIComponent:Kyutech:robot1:Navigation' def __init__(self, uri="http://127.0.0.1:8000", logger=None): HRI_Engine_client_sample.IF.__init__(self, uri, logger=None, event_queue=None) # buid state machine @@ -80,7 +81,7 @@ class Service(HRI_Engine_client_sample.IF): print(colored("person localized successfully.", 'green')) dest = results[3] print("Destination is {} ({})".format(dest, type(dest).__name__)) - (return_code, command_id) = self.set_parameter('urn:x-rois:def:HRIComponent:Kyutech:main:Navigation', [dest, "", ""]) + (return_code, command_id) = self.set_parameter(vn, [dest, "", ""]) status = RoIS_HRI.ReturnCode_t(return_code) if status == RoIS_HRI.ReturnCode_t.OUT_OF_RESOURCES: print(colored("There is no robot that is available.", 'red')) @@ -97,7 +98,7 @@ class Service(HRI_Engine_client_sample.IF): print(colored("speech recognized successfully.", 'green')) dest = results[2][0] print("Destination is {} ({})".format(dest, type(dest).__name__)) - (return_code, command_id) = self.set_parameter('urn:x-rois:def:HRIComponent:Kyutech:main:Navigation', [dest, "", ""]) + (return_code, command_id) = self.set_parameter(vn, [dest, "", ""]) status = RoIS_HRI.ReturnCode_t(return_code) if status == RoIS_HRI.ReturnCode_t.BAD_PARAMETER: print(colored("Bad destination detected.", 'yellow')) -- GitLab