From 36951c2b1c4ed7dc8a70847f899a689c368ce813 Mon Sep 17 00:00:00 2001 From: Yoshiki Obinata Date: Thu, 3 Jun 2021 13:14:24 +0900 Subject: [PATCH] change config file path settings --- dialogflow_task_executive/.gitignore | 3 +-- .../node_scripts/webhook_server.py | 15 ++++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/dialogflow_task_executive/.gitignore b/dialogflow_task_executive/.gitignore index 2c51db66f..405d9fa8f 100644 --- a/dialogflow_task_executive/.gitignore +++ b/dialogflow_task_executive/.gitignore @@ -1,2 +1 @@ -/auth/ -/config/https.json \ No newline at end of file +/config/webhook.json \ No newline at end of file diff --git a/dialogflow_task_executive/node_scripts/webhook_server.py b/dialogflow_task_executive/node_scripts/webhook_server.py index 505e4b80d..aca249ff5 100755 --- a/dialogflow_task_executive/node_scripts/webhook_server.py +++ b/dialogflow_task_executive/node_scripts/webhook_server.py @@ -20,18 +20,15 @@ def __init__(self): You need to set the path to certfile for ssl connection. You shouldn't use self-signed certificate. """ rospack = rospkg.RosPack() - httpsconffile = rospack.get_path('dialogflow_task_executive') + "/config/https.json" - certfile = rospack.get_path('dialogflow_task_executive') + "/auth/certfile.json" - with open(httpsconffile) as f: - json_dict = json.load(f) - self.host = json_dict['ip'] - self.port = int(json_dict['port']) - with open(certfile) as f: + conffile = rospack.get_path('dialogflow_task_executive') + "/config/webhook.json" + with open(conffile) as f: json_dict = json.load(f) + self.host = json_dict['host'] + self.port = json_dict['port'] self._certfile_path = json_dict['certfile'] self._keyfile_path = json_dict['keyfile'] rospy.on_shutdown(self.killnode) - rospy.init_node('dialogflow_https_server', disable_signals=True) + rospy.init_node('dialogflow_webhook_server', disable_signals=True) self._run_handler() def killnode(self): @@ -89,7 +86,7 @@ def _pub_task(self): def _make_response(self): """ This function is in development. If you want to develop the application like the robot sends its state to the Dialogflow and the Dialogflow handle it, you have to make new response_type. - Plese see https://cloud.google.com/dialogflow/es/docs/fulfillment-webhook#webhook_response for details. + Please see https://cloud.google.com/dialogflow/es/docs/fulfillment-webhook#webhook_response for details. """ res_body = {}