Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google_chat_ros: enable to get therad_name message result #516

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions google_chat_ros/scripts/google-chat.l
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -19,17 +19,17 @@
(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
(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))
Expand Down Expand Up @@ -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)))
Expand Down
Loading