Skip to content

Commit

Permalink
fix typoe (overridd), use ~override_project_id if you enable this fea…
Browse files Browse the repository at this point in the history
…ture
  • Loading branch information
k-okada committed Apr 30, 2023
1 parent 0b38962 commit 64321fc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dialogflow_task_executive/README.md
Expand Up @@ -52,6 +52,8 @@ Or we can use `credential` and `project_id` arguments of ` dialogflow_task_execu
roslaunch dialogflow_task_executive dialogflow_task_executive.launch credential:=/etc/ros/hogehoge.json project_id:=pr2-hogehoge
```

If you have `project_id` in both your credential file and rospram (or argument of `dialogflow_task_executive.launch`), the `project_id` in both your credential file becomes effective. To use `project_id` in rosparam, use `~override_project_id` option.

## How to register new task in Dialogflow

### Create new `app_manager` app
Expand Down
2 changes: 2 additions & 0 deletions dialogflow_task_executive/launch/dialogflow_ros.launch
Expand Up @@ -7,6 +7,7 @@
<arg name="volume" default="1.0" />
<arg name="credential" default="$(optenv GOOGLE_APPLICATION_CREDENTIALS false)" doc="Read credentials JSON from this value when use_yaml is false." />
<arg name="project_id" default="$(optenv DIALOGFLOW_PROJECT_ID false)"/>
<arg name="override_project_id" default="false" doc="Specify true if the project_id argument takes priority over the project_id section of the credential file." />
<arg name="enable_hotword" default="true" />
<arg name="always_publish_result" default="false" doc="Always publish dialog_response topic even the node gets actionlib request." />

Expand All @@ -20,6 +21,7 @@
soundplay_action_name: $(arg soundplay_action_name)
volume: $(arg volume)
project_id: $(arg project_id)
override_project_id: $(arg override_project_id)
google_cloud_credentials_json: $(arg credential)
enable_hotword: $(arg enable_hotword)
always_publish_result: $(arg always_publish_result)
Expand Down
Expand Up @@ -3,6 +3,7 @@
<arg name="applist" default="$(find dialogflow_task_executive)/apps"/>
<arg name="credential" default="$(optenv GOOGLE_APPLICATION_CREDENTIALS false)" doc="Read credentials JSON from this value when use_yaml is false." />
<arg name="project_id" default="$(optenv DIALOGFLOW_PROJECT_ID false)"/>
<arg name="override_project_id" default="false" doc="Specify true if the project_id argument takes priority over the project_id section of the credential file." />
<arg name="enable_hotword" default="true" />
<arg name="always_publish_result" default="false" doc="Always publish dialog_response topic even the node gets actionlib request." />

Expand All @@ -29,6 +30,7 @@
<arg name="volume" value="$(arg volume)" />
<arg name="credential" value="$(arg credential)" />
<arg name="project_id" value="$(arg project_id)" />
<arg name="override_project_id" value="$(arg override_project_id)" />
<arg name="enable_hotword" value="$(arg enable_hotword)" />
<arg name="always_publish_result" value="$(arg always_publish_result)" />
</include>
Expand Down
4 changes: 2 additions & 2 deletions dialogflow_task_executive/node_scripts/dialogflow_client.py
Expand Up @@ -83,9 +83,9 @@ def __init__(self):
credentials_json
)
self.project_id = credentials.project_id
if rospy.has_param("~project_id"):
if rospy.has_param("~project_id") and rospy.get_param("~override_project_id", False):
self.project_id = rospy.get_param("~project_id")
rospy.logwarn("overridd project_id")
rospy.logwarn("override project_id")
rospy.logwarn(" from : project_id in a credential file {}".format(credentials.project_id))
rospy.logwarn(" to : project_id stored in rosparam {}".format(self.project_id))
self.session_client = df.SessionsClient(
Expand Down

0 comments on commit 64321fc

Please sign in to comment.