@@ -85,7 +85,7 @@ def capture_window_times(self, time):
85
85
if not self .window_times_captured :
86
86
self .time_window_lims [0 ] = time + 1.0
87
87
self .time_window_lims [1 ] += self .time_window_lims [0 ]
88
- print 'Capturing Time from {} to {}' .format (self .time_window_lims [0 ], self .time_window_lims [1 ])
88
+ print ( 'Capturing Time from {} to {}' .format (self .time_window_lims [0 ], self .time_window_lims [1 ]) )
89
89
self .window_times_captured = True
90
90
91
91
def obj_state_cb (self , data ):
@@ -97,9 +97,9 @@ def obj_state_cb(self, data):
97
97
if self .is_first_run :
98
98
self .capture_window_times (data .wall_time )
99
99
self .initial_time_offset = ambf_sim_wall_time - data .wall_time
100
- print 'ROS & AMBF Clock Offset in C++ Server: ' , self .initial_time_offset
101
- print 'AMBF Wall Time after offset : ' , ambf_sim_wall_time - self .initial_time_offset
102
- print 'Cur Process Wall Time after offset : ' , process_wall_time - self .initial_time_offset
100
+ print ( 'ROS & AMBF Clock Offset in C++ Server: ' , self .initial_time_offset )
101
+ print ( 'AMBF Wall Time after offset : ' , ambf_sim_wall_time - self .initial_time_offset )
102
+ print ( 'Cur Process Wall Time after offset : ' , process_wall_time - self .initial_time_offset )
103
103
self .is_first_run = False
104
104
105
105
self .ambf_process_wall_time .append (ambf_sim_wall_time - self .initial_time_offset )
@@ -117,15 +117,15 @@ def obj_state_cb(self, data):
117
117
118
118
def compute_mean_latency (self ):
119
119
self .mean_latency = sum (self .latency_list ) / len (self .latency_list )
120
- print 'Mean Latency= ' , self .mean_latency , ' | Itrs= ' , len (self .latency_list ), ' | Counter=' , self .cb_counter
120
+ print ( 'Mean Latency= ' , self .mean_latency , ' | Itrs= ' , len (self .latency_list ), ' | Counter=' , self .cb_counter )
121
121
122
122
total_packets = (self .msg_counter_num [- 1 ] + 1 ) - self .msg_counter_num [0 ]
123
123
total_packets_rcvd = len (self .msg_counter_num )
124
124
percent_packets_rcvd = (total_packets_rcvd * 1.0 ) / (total_packets * 1.0 )
125
125
126
- print 'Total packets sent by C++ Server: ' , total_packets
127
- print 'Total packets received by Client: ' , total_packets_rcvd
128
- print 'Percentage of packets received : {}%' .format (100 * percent_packets_rcvd )
126
+ print ( 'Total packets sent by C++ Server: ' , total_packets )
127
+ print ( 'Total packets received by Client: ' , total_packets_rcvd )
128
+ print ( 'Percentage of packets received : {}%' .format (100 * percent_packets_rcvd ) )
129
129
130
130
def calculate_packets_dt (self , list ):
131
131
new_list = []
@@ -137,7 +137,7 @@ def run(self):
137
137
rospy .init_node ('message_latency_inspector' )
138
138
sub = rospy .Subscriber ('/ambf/env/World/State' , WorldState , self .obj_state_cb , queue_size = self .queue_size )
139
139
140
- print 'X Axis = ' , self .x_axis_dict [self .x_axis_type ][0 ]
140
+ print ( 'X Axis = ' , self .x_axis_dict [self .x_axis_type ][0 ])
141
141
x_axis_indx = self .x_axis_dict [self .x_axis_type ][1 ]
142
142
143
143
while not rospy .is_shutdown () and not self .done :
0 commit comments