Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added loop_closure_enabled_, to enable/disable loop closure constrains #36

Open
wants to merge 1 commit into
base: feature/temporal_window
Choose a base branch
from

Conversation

mikexyl
Copy link

@mikexyl mikexyl commented Aug 31, 2020

No description provided.

Copy link
Member

@victorreijgwart victorreijgwart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for implementing this and opening a PR.
Aside from some small comments, it'd be ready to merge.

loop_closure_constraints_enabled_);
ROS_INFO_STREAM_COND(
verbose_,
"Loop Closure registration constraints: "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking, the loop closures are added to the pose graph as relative pose constraints. Registration constraints are added automatically for all overlapping submaps, so implicitly loop closures will also lead to registration constraints - but only if they cause submaps to overlap.
Could you change this INFO message to something like "Loop closure constraints: "? Just to reduce the change of other users getting confused.

pose_graph_interface_.addLoopClosureMeasurement(submap_id_A, submap_id_B,
T_AB);

// Check if loop closure constraints is enabled
Copy link
Member

@victorreijgwart victorreijgwart Aug 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the suggested implementation of this callback, the loop closure constraints would be shown in Rviz despite not being used in the optimization.
This could be confusing to other users. It'd be cleaner if the first block of code at the top of this method was:

if (!loop_closure_constraints_enabled_) {
    ROS_WARN_THROTTLE(1.0, "Received loop closure constraint, but loop_closure_constraints_enabled is set to false. Constraint will be ignored.");
    return;
}

So that if loop closures are disabled, they're ignored entirely - such that the visuals and optimization stay consistent.

Alternatively, you could start the method with:

if (!loop_closure_constraints_enabled_) {
    ROS_WARN_THROTTLE(1.0, "Received loop closure constraint, but loop_closure_constraints_enabled is set to false. Constraint will be ignored by the optimization but still shown in Rviz.");
}

But there'd still be a high chance that people don't see the warning message (e.g. when running it on a robot, or when there are many other messages being published to the same log), so unless there's a strong reason not to, I'd rather go with the first option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants