@@ -198,6 +198,10 @@ void RT_API::insert_or_assign_edge_RT(Node &n, uint64_t to, const std::vector<fl
198198 auto tr_pack = tr_pack_o.value_or (std::vector<float > (BLOCK_SIZE * HISTORY_SIZE, 0 .f ));
199199 auto rot_pack = rot_pack_o.value_or (std::vector<float > (BLOCK_SIZE * HISTORY_SIZE, 0 .f ));
200200
201+ if (time_stamps.size () < BLOCK_SIZE * HISTORY_SIZE) time_stamps.resize (BLOCK_SIZE);
202+ if (tr_pack.size () < BLOCK_SIZE * HISTORY_SIZE) tr_pack.resize (BLOCK_SIZE * HISTORY_SIZE);
203+ if (rot_pack.size () < BLOCK_SIZE * HISTORY_SIZE) rot_pack.resize (BLOCK_SIZE * HISTORY_SIZE);
204+
201205 auto timestamp_index = 0 ;
202206 int index = 0 ;
203207 bool update_index = true ;
@@ -388,6 +392,10 @@ void RT_API::insert_or_assign_edge_RT(Node &n, uint64_t to, std::vector<float> &
388392 auto tr_pack = tr_pack_o.value_or (std::vector<float > (BLOCK_SIZE * HISTORY_SIZE, 0 .f ));
389393 auto rot_pack = rot_pack_o.value_or (std::vector<float > (BLOCK_SIZE * HISTORY_SIZE, 0 .f ));
390394
395+ if (time_stamps.size () < BLOCK_SIZE * HISTORY_SIZE) time_stamps.resize (BLOCK_SIZE);
396+ if (tr_pack.size () < BLOCK_SIZE * HISTORY_SIZE) tr_pack.resize (BLOCK_SIZE * HISTORY_SIZE);
397+ if (rot_pack.size () < BLOCK_SIZE * HISTORY_SIZE) rot_pack.resize (BLOCK_SIZE * HISTORY_SIZE);
398+
391399 auto timestamp_index = 0 ;
392400 int index = 0 ;
393401 bool update_index = true ;
@@ -411,8 +419,9 @@ void RT_API::insert_or_assign_edge_RT(Node &n, uint64_t to, std::vector<float> &
411419 if (pos == timestamp_index && *timestamp < time_stamps[pos]) {return ;}
412420 if (pos > timestamp_index) {
413421 pos = timestamp_index;
414- update_index= false ;
422+ update_index = false ;
415423 }
424+
416425 time_stamps.erase (time_stamps.begin () + timestamp_index);
417426 tr_pack.erase (tr_pack.begin () + index, tr_pack.begin () + index + 3 );
418427 rot_pack.erase (rot_pack.begin () + index, rot_pack.begin () + index + 3 );
0 commit comments