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

[Fetch] [jsk_robot_startup] Enable to send INFO tag on smach_to_mail #335

Merged
merged 2 commits into from
Aug 25, 2022
Merged
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
12 changes: 12 additions & 0 deletions jsk_robot_common/jsk_robot_startup/scripts/smach_to_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ def _status_cb(self, msg):
rospy.logwarn("smach does not have DESCRIPTION, see https://github.com/jsk-ros-pkg/jsk_robot/tree/master/jsk_robot_common/jsk_robot_startup#smach_to_mailpy for more info")
if 'IMAGE' in local_data_str and local_data_str['IMAGE']:
rospy.loginfo("- image_str -> {}".format(local_data_str['IMAGE'][:64]))
if 'INFO' in local_data_str:
rospy.loginfo("- description_str -> {}".format(local_data_str['INFO']))
else:
rospy.logwarn("smach does not have INFO, see https://github.com/jsk-ros-pkg/jsk_robot/tree/master/jsk_robot_common/jsk_robot_startup#smach_to_mailpy for more info")


# Store data for every callerid to self.smach_state_list[caller_id]
caller_id = msg._connection_header['callerid']
Expand Down Expand Up @@ -157,6 +162,13 @@ def _send_mail(self, subject, state_list):
image.img_data = x['IMAGE']
email_msg.body.append(image)
email_msg.body.append(changeline)
for x in state_list:
if 'INFO' in x:
info = EmailBody()
info.type = 'text'
info.message = x['INFO']
email_msg.body.append(info)
email_msg.body.append(changeline)
# rospy.loginfo("body:{}".format(email_msg.body))

if subject:
Expand Down