Skip to content

Commit

Permalink
change config file path settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mqcmd196 committed Jun 3, 2021
1 parent 68cc571 commit 36951c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
3 changes: 1 addition & 2 deletions dialogflow_task_executive/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/auth/
/config/https.json
/config/webhook.json
15 changes: 6 additions & 9 deletions dialogflow_task_executive/node_scripts/webhook_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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 = {}

Expand Down

0 comments on commit 36951c2

Please sign in to comment.