#!/usr/bin/env python


import roslib
roslib.load_manifest('diagnostic_updater')
import rospy
import diagnostic_updater
import diagnostic_msgs

temperature = 0

def check_temprature(stat):

    #$B%(%i!<H=Dj(B
    if temperature < 10:
        stat.summary(diagnostic_msgs.msg.DiagnosticStatus.OK, "Temperature OK")
    else:
        stat.summary(diagnostic_msgs.msg.DiagnosticStatus.WARN, "Too high")

    #$B%(%i!<>pJs$rDI2C(B
    stat.add("Top-Side Margin", 10 - temperature)
    return stat


if __name__=='__main__':
    rospy.init_node("diagnostic_updater_example2")

    # Updater$B$N%*%V%8%'%/%H$r:n@.(B
    updater = diagnostic_updater.Updater()

    # $B%O!<%I%&%'%"(BID$B$r@_Dj(B
    updater.setHardwareID("Sensor1")

    # $B%O!<%I%(%i!<%A%'%C%/5!G=$NDI2C(B
    updater.add("upper-temperature",check_temprature)

    while not rospy.is_shutdown():
        
        temperature+=0.1
        if temperature>=20:
            temperature=0

        print temperature

        #Topic publish
        updater.update()
        rospy.sleep(0.1)

@@ -192,24 +192,13 @@
    #
-%1B$B%25(%25i!%3CH=Dj%1B(B
+%E3%82%A8%E3%83%A9%E3%83%BC%E5%88%A4%E5%AE%9A
 %0A   
@@ -395,30 +395,16 @@
    #
-%1B$B%25(%25i!%3C%3EpJs$rDI2C%1B(B
+%E3%82%A8%E3%83%A9%E3%83%BC%E6%83%85%E5%A0%B1%E3%82%92%E8%BF%BD%E5%8A%A0
 %0A   
@@ -562,34 +562,18 @@
 ater
-%1B$B$N%25*%25V%258%25'%25/%25H$r:n@.%1B(B
+%E3%81%AE%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%82%92%E4%BD%9C%E6%88%90
 %0A   
@@ -623,40 +623,19 @@
   # 
-%1B$B%25O!%3C%25I%25&%25'%25%22%1B(BID%1B$B$r@_Dj%1B(B
+%E3%83%8F%E3%83%BC%E3%83%89%E3%82%A6%E3%82%A7%E3%82%A2ID%E3%82%92%E8%A8%AD%E5%AE%9A
 %0A   
@@ -679,44 +679,23 @@
   # 
-%1B$B%25O!%3C%25I%25(%25i!%3C%25A%25'%25C%25/5!G=$NDI2C%1B(B
+%E3%83%8F%E3%83%BC%E3%83%89%E3%82%A8%E3%83%A9%E3%83%BC%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E6%A9%9F%E8%83%BD%E3%81%AE%E8%BF%BD%E5%8A%A0
 %0A   

change unicode