File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -223,20 +223,26 @@ void FixedLagSmoother::optimizationLoop()
223223 // Optimize the entire graph
224224 summary_ = graph_->optimize (params_.solver_options );
225225
226- // Optimization is complete. Notify all the things about the graph changes.
227- const auto new_transaction_stamp = new_transaction->stamp ();
228- notify (std::move (new_transaction), graph_->clone ());
229-
230226 // Abort if optimization failed. Not converging is not a failure because the solution found is usable.
231227 if (!summary_.IsSolutionUsable ())
232228 {
229+ std::ostringstream oss;
230+ oss << " Graph:\n " ;
231+ graph_->print (oss);
232+ oss << " \n Transaction:\n " ;
233+ new_transaction->print (oss);
234+
233235 ROS_FATAL_STREAM (" Optimization failed after updating the graph with the transaction with timestamp "
234- << new_transaction_stamp << " . Leaving optimization loop and requesting node shutdown..." );
236+ << new_transaction->stamp () << " . Leaving optimization loop and requesting node shutdown...\n "
237+ << oss.str ());
235238 ROS_INFO_STREAM (summary_.FullReport ());
236239 ros::requestShutdown ();
237240 break ;
238241 }
239242
243+ // Optimization is complete and succeeded. Notify all the things about the graph changes.
244+ notify (std::move (new_transaction), graph_->clone ());
245+
240246 // Compute a transaction that marginalizes out those variables.
241247 lag_expiration_ = computeLagExpirationTime ();
242248 marginal_transaction_ = fuse_constraints::marginalizeVariables (
You can’t perform that action at this time.
0 commit comments