Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR shows the impact of a loss function into the constraint cost in the rviz display plugin for the graph.
There are two commits because the first one implements a different visualization approach I explain later. The second commit implements the final approach, that is explained below.
The error line brightness is scaled by the quotient of the constraint cost with and without loss, as it's explained in the code). This way, a dark error line means the cost is reduced significantly by the loss function, which is the expected behaviour when we get outliers, as shown in the screenshot below:
The alternative visualization approach consisted on splitting the error line in two, using the aforementioned quotient to scaled the length of the line that belong to the loss and the rest. In this case, we'd get something like this:
I used a different width in order to distinguish one segment from the other. They're highlighted in the next image:
I'm open to suggestion and comments regarding the two approaches and whether you think the one I'm going with at the end is better or worse than the previous one (last one explained here). Or maybe I should combine them, but I'm quite happy with the end result for now.