manage moving window saves copies of images

This commit is contained in:
Raphael Maenle 2019-04-10 19:10:31 +02:00
parent b0dca3b15c
commit a6af82a269
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.12) cmake_minimum_required(VERSION 2.8.12)
project(msckf) project(msckf_vio)
add_compile_options(-std=c++11) add_compile_options(-std=c++11)

View File

@ -259,7 +259,6 @@ void MsckfVio::imageCallback (
const sensor_msgs::ImageConstPtr& cam1_img, const sensor_msgs::ImageConstPtr& cam1_img,
const CameraMeasurementConstPtr& feature_msg) const CameraMeasurementConstPtr& feature_msg)
{ {
ROS_INFO("In Callback");
// Return if the gravity vector has not been set. // Return if the gravity vector has not been set.
if (!is_gravity_set) return; if (!is_gravity_set) return;
@ -357,9 +356,11 @@ void MsckfVio::manageMovingWindow(
const cv_bridge::CvImageConstPtr& cam1_image_ptr, const cv_bridge::CvImageConstPtr& cam1_image_ptr,
const CameraMeasurementConstPtr& feature_msg) { const CameraMeasurementConstPtr& feature_msg) {
cam0_moving_window[state_server.imu_state.id] = cam0_image_ptr->image; cam0_moving_window[state_server.imu_state.id] = cam0_image_ptr->image.clone();
cam1_moving_window[state_server.imu_state.id] = cam1_image_ptr->image; cam1_moving_window[state_server.imu_state.id] = cam1_image_ptr->image.clone();
std::cout << cam0_moving_window.begin()->second << std::endl;
//TODO handle massive overflow correctly (should be pruned, before this ever triggers)
while(cam0_moving_window.size() > 100) while(cam0_moving_window.size() > 100)
{ {
cam1_moving_window.erase(cam1_moving_window.begin()); cam1_moving_window.erase(cam1_moving_window.begin());