Use fixed thresholds for Trinary yaml (backport #5278) #5284
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.
Basic Info
Description of contribution in a few bullet points
Supersedes #5138
This PR uses fixed values for the threshold saved to the yaml file, in Trinary mode. Similarly to ROS 1.
With this change, Trinary maps loaded created and loaded with the map_server, will now load correctly. This is because the pixel values saved in this mode are constants, so when loading the map the thresholds must lie between the pixel values for correct loading. The thresholds supplied by the user are still used for thresholding the input map before saving (to reduce noise)
Description of documentation updates required from your changes
None
Description of how this change was tested
ros2 run nav2_map_server map_saver_cliwith various arguments. The threshold saved should be fixed to 0.65 and 0.196 in Trinary mode. Other modes should not be affected.Future work that may be required in bullet points
For Maintainers:
This is an automatic backport of pull request #5278 done by [Mergify](https://mergify.com).