Skip to content

Commit

Permalink
Fix bug when load an one-node pose graph. (SteveMacenski#495)
Browse files Browse the repository at this point in the history
Co-authored-by: Kehan Xue <[email protected]>
  • Loading branch information
kehanXue and Kehan Xue authored May 27, 2022
1 parent 3010d46 commit 2ae75af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion solvers/ceres_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ void CeresSolver::Compute()
}

// populate contraint for static initial pose
if (!was_constant_set_ && first_node_ != nodes_->end()) {
if (!was_constant_set_ && first_node_ != nodes_->end() &&
problem_->HasParameterBlock(&first_node_->second(0)) &&
problem_->HasParameterBlock(&first_node_->second(1)) &&
problem_->HasParameterBlock(&first_node_->second(2))) {
RCLCPP_DEBUG(node_->get_logger(),
"CeresSolver: Setting first node as a constant pose:"
"%0.2f, %0.2f, %0.2f.", first_node_->second(0),
Expand Down

0 comments on commit 2ae75af

Please sign in to comment.