diff --git a/owlps-positioner/src/autocalibration.cc b/owlps-positioner/src/autocalibration.cc index 3a9e413..dff62f5 100644 --- a/owlps-positioner/src/autocalibration.cc +++ b/owlps-positioner/src/autocalibration.cc @@ -115,6 +115,9 @@ void Autocalibration::sort_reference_aps() { const Point3D &rx_coord = rx->second.get_coordinates() ; + sorted_negative_angles.clear() ; + sorted_positive_angles.clear() ; + for (unordered_map::const_iterator ref = Stock::aps.begin() ; ref != Stock::aps.end() ; ++ref) { @@ -165,6 +168,7 @@ void Autocalibration::sort_reference_aps() void Autocalibration::weight_aps() { /* Retrieve the reference APs & angles */ + ref_aps.clear() ; map::const_iterator> > ::const_iterator s ; @@ -181,8 +185,12 @@ void Autocalibration::weight_aps() else if (ref_aps.size() == 2) weight_2_aps() ; else - throw autocalibration_error( - "We should not be here... error when sorting the reference APs?") ; + { + ostringstream oss ; + oss << "We should not be here... error when sorting the reference" + << " APs? (" << ref_aps.size() << " APs sorted)" ; + throw autocalibration_error(oss.str()) ; + } }