Skip to content

Commit

Permalink
[jsk_robot_startup] Enable to send INFO tag
Browse files Browse the repository at this point in the history
  • Loading branch information
tkmtnt7000 authored and knorth55 committed Sep 1, 2022
1 parent 98b3f14 commit 8882da7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 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,12 @@ def _send_mail(self, subject, state_list):
image.img_data = x['IMAGE']
email_msg.body.append(image)
email_msg.body.append(changeline)
if 'INFO' in x:
description = EmailBody()
description.type = 'text'
description.message = x['INFO']
email_msg.body.append(description)
email_msg.body.append(changeline)
# rospy.loginfo("body:{}".format(email_msg.body))

if subject:
Expand Down

0 comments on commit 8882da7

Please sign in to comment.