163 {
164 while (!raw_motion_queue_.empty() &&
165 vehicledata->time_ts < raw_motion_queue_.back().time_ts) {
166 raw_motion_queue_.pop_back();
167 ADEBUG <<
"pop ts : back ts" << vehicledata->time_ts <<
" "
168 << raw_motion_queue_.back().time_ts << " "
169 << raw_motion_queue_.size();
170 }
171
172 if (motion_operation_flag !=
RESET) {
173 generate_motion_matrix(vehicledata);
174 raw_motion_queue_.push_back(*vehicledata);
175 if (static_cast<int>(raw_motion_queue_.size()) > buffer_size_ * 10) {
176 AWARN <<
"MotionQueue is too large, try sync motion/image timestep";
177 }
178
179 switch (motion_operation_flag) {
181
182 break;
184 accumulate_motion(pre_image_timestamp, image_timestamp);
185 update_motion_buffer(*vehicledata, pre_image_timestamp,
186 image_timestamp);
187 break;
188 default:
189 AERROR <<
"motion operation flag:wrong type";
190 return;
191 }
192 } else {
193 mot_buffer_->clear();
194 vehicledata->time_d = 0;
195 vehicledata->time_ts = image_timestamp;
196 vehicledata->motion = base::MotionType::Identity();
197 mot_buffer_->push_back(*vehicledata);
198 ADEBUG <<
"pop and rest raw_buffer, mot_buffer: "
199 << raw_motion_queue_.size();
200 }
201}