@@ -98,7 +98,10 @@ mod tests {
9898 use linear_algebra:: Isometry3 ;
9999 use projection:: camera_matrix:: CameraMatrix ;
100100 use ros_z:: time:: Time ;
101- use types:: visual_localization:: VisualLocalizationFrame as FieldMarkAssociations ;
101+ use types:: {
102+ object_detection:: { Object , RobocupObjectLabel } ,
103+ visual_localization:: VisualLocalizationFrame as FieldMarkAssociations ,
104+ } ;
102105
103106 use super :: * ;
104107 use crate :: state:: { MAX_NEAREST_SAMPLE_DISTANCE , ViewerState } ;
@@ -111,6 +114,13 @@ mod tests {
111114 }
112115 }
113116
117+ fn empty_detected_objects ( time : Time ) -> TimeWrapper < Vec < Object < RobocupObjectLabel > > > {
118+ TimeWrapper {
119+ time,
120+ inner : Vec :: new ( ) ,
121+ }
122+ }
123+
114124 #[ test]
115125 fn high_rate_alignment_streams_retain_delayed_render_samples ( ) {
116126 let mut state = ViewerState :: default ( ) ;
@@ -149,7 +159,7 @@ mod tests {
149159 state. push_camera_frame ( association_time, CameraFrame :: default ( ) ) ;
150160 state. push_camera_frame ( detection_time, CameraFrame :: default ( ) ) ;
151161 state. push_field_mark_associations ( association_time, empty_associations ( ) ) ;
152- state. push_detected_objects ( detection_time , Vec :: new ( ) ) ;
162+ state. push_detected_objects ( empty_detected_objects ( detection_time ) ) ;
153163
154164 let aligned = state. aligned_snapshot ( ) ;
155165
@@ -235,7 +245,7 @@ mod tests {
235245 state. push_camera_frame ( displayed_time, CameraFrame :: default ( ) ) ;
236246 assert_eq ! ( state. aligned_snapshot( ) . anchor_time, Some ( displayed_time) ) ;
237247
238- state. push_detected_objects ( displayed_time , Vec :: new ( ) ) ;
248+ state. push_detected_objects ( empty_detected_objects ( displayed_time ) ) ;
239249 state. push_camera_frame ( latest_camera_time, CameraFrame :: default ( ) ) ;
240250 let aligned = state. aligned_snapshot ( ) ;
241251
@@ -255,7 +265,7 @@ mod tests {
255265
256266 state. objects_status . update_publishers ( 1 ) ;
257267 state. push_camera_frame ( first_time, CameraFrame :: default ( ) ) ;
258- state. push_detected_objects ( first_time , Vec :: new ( ) ) ;
268+ state. push_detected_objects ( empty_detected_objects ( first_time ) ) ;
259269 assert_eq ! ( state. aligned_snapshot( ) . anchor_time, Some ( first_time) ) ;
260270
261271 state. push_camera_frame ( second_time, CameraFrame :: default ( ) ) ;
@@ -264,7 +274,7 @@ mod tests {
264274 assert_eq ! ( aligned. anchor_time, Some ( first_time) ) ;
265275 assert ! ( aligned. detected_objects. is_some( ) ) ;
266276
267- state. push_detected_objects ( second_time , Vec :: new ( ) ) ;
277+ state. push_detected_objects ( empty_detected_objects ( second_time ) ) ;
268278 let aligned = state. aligned_snapshot ( ) ;
269279
270280 assert_eq ! ( aligned. anchor_time, Some ( second_time) ) ;
0 commit comments