File tree 2 files changed +10
-11
lines changed
2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,14 @@ class Predictor {
38
38
void process (Data::ConstPtr data_ptr, std::function<void (Data::ConstPtr, Data::ConstPtr)> func_predict = nullptr) {
39
39
if (!data_ptr) return ;
40
40
41
- if (!push_data (data_ptr)) return ;
42
-
43
- if (func_predict != nullptr )
44
- func_predict (last_data_ptr_, data_ptr);
45
- else
46
- predict (last_data_ptr_, data_ptr);
41
+ if (!inited_)
42
+ push_data (data_ptr);
43
+ else {
44
+ if (func_predict != nullptr )
45
+ func_predict (last_data_ptr_, data_ptr);
46
+ else
47
+ predict (last_data_ptr_, data_ptr);
48
+ }
47
49
48
50
last_data_ptr_ = data_ptr;
49
51
}
Original file line number Diff line number Diff line change @@ -60,11 +60,8 @@ class IMU : public Predictor {
60
60
last_am = imu_ptr->acc ;
61
61
}
62
62
63
- if (!inited_) {
64
- imu_buf_.push_back (imu_ptr);
65
- if (imu_buf_.size () > kImuBufSize ) imu_buf_.pop_front ();
66
- return false ;
67
- }
63
+ imu_buf_.push_back (imu_ptr);
64
+ if (imu_buf_.size () > kImuBufSize ) imu_buf_.pop_front ();
68
65
69
66
return true ;
70
67
}
You can’t perform that action at this time.
0 commit comments