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

[jsk_fetch_startup] Send kitchen demo mail and twitter with smach_to_mail.py #1568

Merged
merged 13 commits into from
Sep 8, 2022

Conversation

tkmtnt7000
Copy link
Member

From jsk-ros-pkg/jsk_3rdparty#375 (comment)
This PR enables us to send kitchen demo mail with embed image and description by using smach_to_mail.py.
And this can send tweet automatically, too.jsk-ros-pkg/jsk_3rdparty#375

smach-kitchen-20220822.mp4

======
This PR contains knorth55#327, knorth55#326, knorth55#311, knorth55#312.

And also this PR contains and partically depends on obinata-san changes (the place to patrol and take photos) 8ea2c32, dff17cf, 6d5475f, acf1026, so please feel free to revise and send another PR to jsk-ros-pkg. cc:@mqcmd196

@tkmtnt7000 tkmtnt7000 changed the title [jsk_fetch_startup] Send kitchen demo mail and twitter with smach_to_mail.py [Merge after #1558] [jsk_fetch_startup] Send kitchen demo mail and twitter with smach_to_mail.py Aug 23, 2022
@tkmtnt7000 tkmtnt7000 force-pushed the PR-smach-mail-kitchen-demo branch from 6fa24a2 to 26346d4 Compare August 23, 2022 03:37
"inspect-kitchen"
(let ()
(inspect-kitchen :tweet (cdr (assoc 'tweet args)))
(set-alist 'description "キッチンの様子を見たよ" args)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I comment on jsk-ros-pkg/jsk_roseus#716 (comment), DESCRIPTION is the message from robot to users to tell how they thik and what they do. so

(let ((label-names (inspect-kitchen ....))
      (set-alist 'description (format nil "キッチンの様子を見たよ。~Aがあったよ" label-names) args)

(defun notify-recognition (&key (location "kitchen"))
  ...
  label-names)
 ...
 

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for advice.
I add notify-text in description and write like this. ba5fc8f

キッチンの様子を見たよ.cupがあったよ
[ IMAGE ]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this, this is tracshcan example, though.
B7DB04F2-F5E5-4259-9025-EA59CD487257

(let* ((n-trial (cdr (assoc 'n-kitchen-trial args)))
(success (move-to-sink-front :n-trial n-trial)))
(setf (cdr (assoc 'success-go-to-kitchen args)) success)
(set-alist 'description "キッチンに向かったよ" argw)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can undeerstand DESCRIPTION as transition (arrow) of smach state, can we write DESCRIPTION based on the exit status of each node ? instead of https://github.com/jsk-ros-pkg/jsk_robot/pull/1568/files#diff-db470e8365f9cf73b75d39c7822ddc1513068c80cf3e12dd4a3127cba08d2863R684-R687 ???

(if succcess 
    (set-alist 'description "キッチンに向かったよ" argw)
    (set-alist 'description "キッチンに向かったけど,迷子になっちゃった" argw)
)

c.f jsk-ros-pkg/jsk_roseus#716 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.
I use exit status of each node in 1213188

"get-light-on-state"
(let ((light-on (get-light-on)))
(set-alist 'initial-light-on light-on args)
(set-alist 'description "電気がついているか確認したよ" args)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do not have to set DESCRIPTOIN/IMAGE for all states, if it is redundant

If we get messages as follows, may be we can remove "電気がついているか確認したよ" descprion and IMAGE

電気がついているか確認したよ
[IMAGE-BRIGHT]
電気がついていたよ
[IMAGE-BRIGHT]
キッチンをみにいくよ
[IMAGE-DARK]
電気がついているか確認したよ
[IMAGE-DARK]
電気をつけたよ
[IMAGE-BRIGHT]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remove "電気がついているか確認したよ" and check if room light is on by get-light-on status.1213188

@tkmtnt7000 tkmtnt7000 force-pushed the PR-smach-mail-kitchen-demo branch from 4622bc8 to 1213188 Compare August 24, 2022 08:32
@tkmtnt7000 tkmtnt7000 force-pushed the PR-smach-mail-kitchen-demo branch from 7054a72 to 9726fc9 Compare September 7, 2022 13:09
@tkmtnt7000 tkmtnt7000 changed the title [Merge after #1558] [jsk_fetch_startup] Send kitchen demo mail and twitter with smach_to_mail.py [jsk_fetch_startup] Send kitchen demo mail and twitter with smach_to_mail.py Sep 7, 2022
@k-okada
Copy link
Member

k-okada commented Sep 8, 2022

@tkmtnt7000 sorry could you resolve conflicts or create new PR that only update send_to_mail.py ?

@tkmtnt7000 tkmtnt7000 force-pushed the PR-smach-mail-kitchen-demo branch from 9726fc9 to c069170 Compare September 8, 2022 06:20
@tkmtnt7000 tkmtnt7000 force-pushed the PR-smach-mail-kitchen-demo branch from c069170 to 3cfab64 Compare September 8, 2022 06:21
@tkmtnt7000
Copy link
Member Author

I rebased current master branch to resolve conflicts.

@@ -265,6 +265,13 @@
</rosparam>
</node>

<!-- send email, twitter with smach -->
<node name="server_name" pkg="jsk_robot_startup" type="smach_to_mail.py" output="screen">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smach topic name is normally /server_name/smach/container_status.
thats why smach_to_mail node's name is server_name in launch
but I think it is confusing and a bit lazy solution...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants