18 from diagnostic_msgs.msg
import DiagnosticArray
25 JOINT_NAMES = [
"FFJ0",
"FFJ3",
"FFJ4",
26 "MFJ0",
"MFJ3",
"MFJ4",
27 "RFJ0",
"RFJ3",
"RFJ4",
28 "LFJ0",
"LFJ3",
"LFJ4",
29 "THJ1",
"THJ2",
"THJ3",
"THJ4",
"THJ5",
54 self.
screen.addstr(self.
y + 1, self.
x + 6,
"X", curses.color_pair(4))
80 curses.init_pair(4, curses.COLOR_WHITE, curses.COLOR_BLACK)
81 curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_GREEN)
82 curses.init_pair(2, curses.COLOR_BLACK, curses.COLOR_YELLOW)
83 curses.init_pair(3, curses.COLOR_BLACK, curses.COLOR_RED)
85 for index, joint_name
in enumerate(JOINT_NAMES):
87 begin_y = CASE_HEIGHT*index
95 event = self.
pad.getch()
98 elif event == curses.KEY_RESIZE:
101 elif event == ord(
"s"):
104 elif event == ord(
"w"):
107 elif event == ord(
"a"):
110 elif event == ord(
"d"):
115 for status
in msg.status:
116 for joint
in JOINT_NAMES:
117 if joint
in status.name:
118 for value
in status.values:
119 if value.key ==
"Temperature":
120 self.
joint_monitors[joint].set_temperature(round(float(value.value), 1))
131 y, x = self.
screen.getmaxyx()
140 if __name__ ==
'__main__':
141 rospy.init_node(
"temperature_monitor", anonymous=
True)
143 curses.wrapper(TemperatureMonitor)
145 traceback.print_exc()
def __init__(self, screen, joint_name, x, y)
def __init__(self, screen=None)
def set_temperature(self, temperature)