diff --git a/google_chat_ros/README.md b/google_chat_ros/README.md index d4c4c2a0e..e911ef41b 100644 --- a/google_chat_ros/README.md +++ b/google_chat_ros/README.md @@ -2,7 +2,7 @@ The ROS wrapper for Google Chat API 1. [Installation Guide](#install) 1. [Sending the message](#send) -1. [Recieving the message](#recieve) +1. [Receiving the message](#recieve) 1. [Handling the event](#event) 1. [Optional functions](#optional) 1. [Helper nodes](#helper) @@ -69,12 +69,12 @@ catkin build ``` ### 1.4 Launch the node #### HTTPS mode -You have to set rosparams `recieving_mode=https`, `google_cloud_credentials_json`, `host`, `port`, `ssl_certfile`, `ssl_keyfile`. +You have to set rosparams `receiving_mode=https`, `google_cloud_credentials_json`, `host`, `port`, `ssl_certfile`, `ssl_keyfile`. #### Pub/Sub mode -You have to set rosparams `recieving_mode=pubsub`, `google_cloud_credentials_json`, `project_id`, `subscription_id`. `subscription_id` would be `chat-sub` if you follow [Pub/Sub mode](#pubsub) example. +You have to set rosparams `receiving_mode=pubsub`, `google_cloud_credentials_json`, `project_id`, `subscription_id`. `subscription_id` would be `chat-sub` if you follow [Pub/Sub mode](#pubsub) example. ##### Example ```bash -roslaunch google_chat_ros google_chat.launch recieving_mode:=pubsub google_cloud_credentials_json:=/path/to/-XXXXXXXX.json project_id:= subscription_id:=chat-sub +roslaunch google_chat_ros google_chat.launch receiving_mode:=pubsub google_cloud_credentials_json:=/path/to/-XXXXXXXX.json project_id:= subscription_id:=chat-sub ``` ## 2. Sending the message @@ -160,13 +160,13 @@ rostopic pub -1 /google_chat_ros/send/goal google_chat_ros/SendMessageActionGoal See [Here](#image). -## 3. Recieving the messages +## 3. Receiving the messages ### 3.1 ROS Topic When the bot was mentioned, the node publishes `~message_activity` topic. ### 3.2 Examples -#### Recieving a text message +#### Receiving a text message ```yaml event_time: "2022-04-28T06:25:26.884623Z" space: @@ -200,7 +200,7 @@ user: human: True ``` -#### Recieving a message with an image or gdrive file and download it +#### Receiving a message with an image or gdrive file and download it @@ -297,5 +297,5 @@ rostopic pub -1 /google_chat_ros/send/goal google_chat_ros/SendMessageActionGoal localpath: '/home/user/Pictures/image.png' space: 'spaces/' ``` -### 5.2 Recieving a message with images or gdrive file +### 5.2 Receiving a message with images or gdrive file You have to set rosparam `~download_data` True, `~download_directory`. If the node recieved the message with image or google drive file, it automatically downloads to `~donwload_directory` path. diff --git a/google_chat_ros/launch/google_chat.launch b/google_chat_ros/launch/google_chat.launch index 72ce564ef..39c589796 100644 --- a/google_chat_ros/launch/google_chat.launch +++ b/google_chat_ros/launch/google_chat.launch @@ -1,5 +1,5 @@ - + @@ -27,7 +27,7 @@ - recieving_mode: $(arg recieving_mode) + receiving_mode: $(arg receiving_mode) gdrive_upload_service: $(arg gdrive_upload_service) upload_data_timeout: $(arg upload_data_timeout) download_data_timeout: $(arg download_data_timeout) diff --git a/google_chat_ros/msg/MessageEvent.msg b/google_chat_ros/msg/MessageEvent.msg index 12d9153f0..b50f7454f 100644 --- a/google_chat_ros/msg/MessageEvent.msg +++ b/google_chat_ros/msg/MessageEvent.msg @@ -1,4 +1,4 @@ -# ROS message for recieving Google Chat message +# ROS message for receiving Google Chat message string event_time google_chat_ros/Space space google_chat_ros/Message message diff --git a/google_chat_ros/scripts/google_chat_ros_node.py b/google_chat_ros/scripts/google_chat_ros_node.py index 05fa36c6f..8f98eafd6 100755 --- a/google_chat_ros/scripts/google_chat_ros_node.py +++ b/google_chat_ros/scripts/google_chat_ros_node.py @@ -23,7 +23,7 @@ class GoogleChatROS(object): Send request to Google Chat REST API via ROS """ def __init__(self): - recieving_chat_mode = rospy.get_param('~recieving_mode') # select from 'url', 'pubsub', 'none' + receiving_chat_mode = rospy.get_param('~receiving_mode') # select from 'url', 'pubsub', 'none' self.gdrive_ros_srv = rospy.get_param('~gdrive_upload_service') google_credentials = rospy.get_param('~google_cloud_credentials_json') @@ -43,8 +43,8 @@ def __init__(self): rospy.logwarn("Failed to start Google Chat REST service") rospy.logerr(e) - # For recieving message - if recieving_chat_mode in ("url", "dialogflow", "pubsub"): + # For receiving message + if receiving_chat_mode in ("url", "dialogflow", "pubsub"): # rosparams self.upload_data_timeout = rospy.get_param('~upload_data_timeout') self.download_data = rospy.get_param('~download_data') @@ -55,7 +55,7 @@ def __init__(self): self._space_activity_pub = rospy.Publisher("~space_activity", SpaceEvent, queue_size=1) self._card_activity_pub = rospy.Publisher("~card_activity", CardEvent, queue_size=1) - if recieving_chat_mode == "url": + if receiving_chat_mode == "url": rospy.loginfo("Expected to get Google Chat Bot URL request") rospy.loginfo("Starting Google Chat HTTPS server...") self.host = rospy.get_param('~host') @@ -70,7 +70,7 @@ def __init__(self): except ConnectionError as e: rospy.logwarn("The error occurred while starting HTTPS server") rospy.logerr(e) - elif recieving_chat_mode == "pubsub": + elif receiving_chat_mode == "pubsub": rospy.loginfo("Expected to use Google Cloud Pub Sub service") self.project_id = rospy.get_param("~project_id") self.subscription_id = rospy.get_param("~subscription_id") @@ -79,11 +79,11 @@ def __init__(self): rospy.on_shutdown(self.killpubsub) self._pubsub_client.run() - elif recieving_chat_mode == "none": + elif receiving_chat_mode == "none": rospy.logwarn("You cannot recieve Google Chat event because HTTPS server or Google Cloud Pub/Sub is not running.") else: - rospy.logerr("Please choose recieving_mode param from dialogflow, https, pubsub, none.") + rospy.logerr("Please choose receiving_mode param from dialogflow, https, pubsub, none.") def killhttpd(self): self._server.kill() diff --git a/google_chat_ros/src/google_chat_ros/google_chat.py b/google_chat_ros/src/google_chat_ros/google_chat.py index 7206ac5ce..5ce613f80 100644 --- a/google_chat_ros/src/google_chat_ros/google_chat.py +++ b/google_chat_ros/src/google_chat_ros/google_chat.py @@ -77,7 +77,7 @@ def kill(self): self._httpd.server_close() class GoogleChatHTTPSHandler(s.BaseHTTPRequestHandler): - """The handler for https request from Google chat API. Mainly used for recieving messages, events. + """The handler for https request from Google chat API. Mainly used for receiving messages, events. """ def __init__(self, callback, user_agent, *args): self._callback = callback