jsk-ros-pkg / jsk_3rdparty

42 stars 60 forks source link

google_chat_ros: enable to get therad_name message result #496

Open k-okada opened 10 months ago

k-okada commented 10 months ago

@mqcmd196 This is a modification to reply messages in the same thread like this Screenshot from 2023-10-26 21-48-47

instead of creating a new thread like this one. Screenshot from 2023-10-26 22-04-00

One strategy is to pass SimpleActionClient to the function, as in this PR modification.

(setq action goal name "google_chat_ros/send")
(setq ac (instance ros::simple-action-client :init action-goal-name google_chat_ros::SendMessageAction)))
(send-google-chat-text "spaces/AAAARE9CrfA" "Hello" :ac ac)
(send-google-chat-text "spaces/AAAARE9CrfA" "World" :thread-name (send (send ac :get-result) :message_result :thread_name) :ac ac)

Another solution would be to return the result of the message like https://github.com/k-okada/jsk_3rdparty/commit/e9a4904cb2449ab86415d8d4046592546a42b801 and write code like this

(setq r (send-google-chat-text "spaces/AAAARE9CrfA" "Hello"))
(send-google-chat-text "spaces/AAAARE9CrfA" "World" :thread-name (send r :message_result :thread_name)).

Which would be better? Or is there another way?

mqcmd196 commented 10 months ago

@k-okada I think

Another solution would be to return the result of the message like https://github.com/k-okada/jsk_3rdparty/commit/e9a4904cb2449ab86415d8d4046592546a42b801 and write code like this

is better because the eus function is designed to be usable without knowing the detailed message specifications.