33 from __future__
import with_statement, print_function
44 :param initial_listen_duration: how many secs to listen to tf initially.
66 :param force_refresh: if False, may return same dotcode as last time
73 'dotcode_factory': dotcode_factory,
78 selection_changed =
False
80 selection_changed =
True
89 if force_refresh
or self.
dotcode is None or selection_changed:
95 yaml_data = tf2_frame_srv().frame_yaml
96 data = yaml_parser.safe_load(yaml_data)
107 if data
is None or len(data) == 0:
111 for frame_dict
in data:
112 tf_frame_values = data[frame_dict]
113 if not tf_frame_values[
'parent']
in data:
114 root = tf_frame_values[
'parent']
116 str(tf_frame_values[
'parent']),
119 graph, frame_dict, shape=
'ellipse')
121 edge_label =
'"Broadcaster: %s\\n' % str(tf_frame_values[
'broadcaster'])
122 edge_label +=
'Average rate: %s\\n' % str(tf_frame_values[
'rate'])
123 edge_label +=
'Buffer length: %s\\n' % str(tf_frame_values[
'buffer_length'])
124 edge_label +=
'Most recent transform: %s\\n' % str(tf_frame_values[
'most_recent_transform'])
125 edge_label +=
'Oldest transform: %s"' % str(tf_frame_values[
'oldest_transform'])
127 str(tf_frame_values[
'parent']),
132 legend_label =
'"Recorded at time: %s"' % str(timestamp)