Allow continuing after running a "final" optimization. (#109)

And a tiny cleanup of the submap visualization query.
master
Wolfgang Hess 2016-10-27 15:25:57 +02:00 committed by GitHub
parent a33bddd4cd
commit a5b81ff159
7 changed files with 15 additions and 11 deletions

View File

@ -34,15 +34,12 @@ message SubmapList {
message SubmapQuery { message SubmapQuery {
message Request { message Request {
// Index into 'SubmapList.trajectory(trajectory_id).submap'. // Index into 'SubmapList.trajectory(trajectory_id).submap'.
optional int32 submap_id = 1; optional int32 submap_index = 1;
// Index into 'TrajectoryList.trajectory'. // Index into 'TrajectoryList.trajectory'.
optional int32 trajectory_id = 2; optional int32 trajectory_id = 2;
} }
message Response { message Response {
// ID of the Submap.
optional int32 submap_id = 1;
// Version of the given submap, higher means newer. // Version of the given submap, higher means newer.
optional int32 submap_version = 2; optional int32 submap_version = 2;

View File

@ -310,6 +310,10 @@ void SparsePoseGraph::RunFinalOptimization() {
optimization_problem_.SetMaxNumIterations( optimization_problem_.SetMaxNumIterations(
options_.max_num_final_iterations()); options_.max_num_final_iterations());
RunOptimization(); RunOptimization();
optimization_problem_.SetMaxNumIterations(
options_.optimization_problem_options()
.ceres_solver_options()
.max_num_iterations());
} }
void SparsePoseGraph::RunOptimization() { void SparsePoseGraph::RunOptimization() {

View File

@ -311,6 +311,10 @@ void SparsePoseGraph::RunFinalOptimization() {
optimization_problem_.SetMaxNumIterations( optimization_problem_.SetMaxNumIterations(
options_.max_num_final_iterations()); options_.max_num_final_iterations());
RunOptimization(); RunOptimization();
optimization_problem_.SetMaxNumIterations(
options_.optimization_problem_options()
.ceres_solver_options()
.max_num_iterations());
} }
void SparsePoseGraph::RunOptimization() { void SparsePoseGraph::RunOptimization() {

View File

@ -75,9 +75,7 @@ class Collator {
// Dispatches all queued sensor packets. May only be called once. // Dispatches all queued sensor packets. May only be called once.
// AddSensorData may not be called after Flush. // AddSensorData may not be called after Flush.
void Flush() { void Flush() { queue_.Flush(); }
queue_.Flush();
}
private: private:
// Queue keys are a pair of trajectory ID and sensor identifier. // Queue keys are a pair of trajectory ID and sensor identifier.

View File

@ -50,8 +50,10 @@ inline std::ostream& operator<<(std::ostream& out, const QueueKey& key) {
} }
// Maintains multiple queues of sorted sensor data and dispatches it in merge // Maintains multiple queues of sorted sensor data and dispatches it in merge
// sorted order. It will wait to see at least one value for each unfinished queue before // sorted order. It will wait to see at least one value for each unfinished
// dispatching the next time ordered value across all queues. This class is thread-compatible. // queue before dispatching the next time ordered value across all queues.
//
// This class is thread-compatible.
class OrderedMultiQueue { class OrderedMultiQueue {
public: public:
using Callback = std::function<void(std::unique_ptr<Data>)>; using Callback = std::function<void(std::unique_ptr<Data>)>;

View File

@ -79,5 +79,5 @@ SPARSE_POSE_GRAPH = {
}, },
}, },
max_num_final_iterations = 200, max_num_final_iterations = 200,
global_sampling_ratio = 0.01, global_sampling_ratio = 0.003,
} }

View File

@ -14,7 +14,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
"""A dumb CMakeLists.txt generator that relies on source name conventions.""" """A dumb CMakeLists.txt generator that relies on source name conventions."""
from os import path from os import path