From fbd47706ebdc6662bc707076742a1294707b6722 Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Thu, 26 Oct 2023 21:34:47 +0900 Subject: [PATCH 1/2] google_chat_ros: enable to return message result --- google_chat_ros/scripts/google-chat.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google_chat_ros/scripts/google-chat.l b/google_chat_ros/scripts/google-chat.l index f146737e5..385537e78 100755 --- a/google_chat_ros/scripts/google-chat.l +++ b/google_chat_ros/scripts/google-chat.l @@ -19,7 +19,7 @@ (send goal :goal :text content) (send ac :send-goal goal) (if wait - (return-from send-google-chat-text (send ac :wait-for-result :timeout 5)) + (return-from send-google-chat-text (if (send ac :wait-for-result :timeout 5) (send ac :get-result) nil)) (return-from send-google-chat-text t)))))) (defun send-google-chat-image From 34ad00e80a7c2e0bed0b93f24004a98be8f1a7f6 Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Thu, 26 Oct 2023 21:46:10 +0900 Subject: [PATCH 2/2] google_chat_ros: enable to pass action client to get message result --- google_chat_ros/scripts/google-chat.l | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/google_chat_ros/scripts/google-chat.l b/google_chat_ros/scripts/google-chat.l index 385537e78..2850e7202 100755 --- a/google_chat_ros/scripts/google-chat.l +++ b/google_chat_ros/scripts/google-chat.l @@ -4,11 +4,11 @@ (ros::roseus "google_chat_eus_client") (defun send-google-chat-text (space content - &key (thread-name nil) (action-goal-name "google_chat_ros/send") (wait t)) + &key (thread-name nil) (action-goal-name "google_chat_ros/send") (wait t) + (ac (instance ros::simple-action-client :init + action-goal-name google_chat_ros::SendMessageAction))) (wait (boundp 'google_chat_ros::SendMessageAction) - (let ((goal (instance google_chat_ros::SendMessageActionGoal :init)) - (ac (instance ros::simple-action-client :init - action-goal-name google_chat_ros::SendMessageAction))) + (let ((goal (instance google_chat_ros::SendMessageActionGoal :init))) (when (send ac :wait-for-server 1) (when (eq (send ac :get-state) actionlib_msgs::GoalStatus::*active*) (send ac :cancel-goal) @@ -25,11 +25,11 @@ (defun send-google-chat-image (space image-path &key (image-header "") (thread-name nil) - (action-goal-name "google_chat_ros/send") (wait t)) + (action-goal-name "google_chat_ros/send") (wait t) + (ac (instance ros::simple-action-client :init + action-goal-name google_chat_ros::SendMessageAction))) (when (boundp 'google_chat_ros::SendMessageAction) - (let ((goal (instance google_chat_ros::SendMessageActionGoal :init)) - (ac (instance ros::simple-action-client :init - action-goal-name google_chat_ros::SendMessageAction)) + (let ((goal (instance google_chat_ros::SendMessageActionGoal :init))) (card (instance google_chat_ros::Card :init)) (section (instance google_chat_ros::Section :init)) (widget (instance google_chat_ros::WidgetMarkup :init)) @@ -72,11 +72,11 @@ ;; buttons should be list (space buttons &key (buttons-header "") (thread-name nil) - (action-goal-name "google_chat_ros/send") (wait nil)) + (action-goal-name "google_chat_ros/send") (wait nil) + (ac (instance ros::simple-action-client :init + action-goal-name google_chat_ros::SendMessageAction))) (when (boundp 'google_chat_ros::SendMessageAction) (let ((goal (instance google_chat_ros::SendMessageActionGoal :init)) - (ac (instance ros::simple-action-client :init - action-goal-name google_chat_ros::SendMessageAction)) (card (instance google_chat_ros::Card :init)) (section (instance google_chat_ros::Section :init)) (widget (instance google_chat_ros::WidgetMarkup :init)))