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

map_saver: fix saved raw image being too dark #4712

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nav2_map_server/src/map_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ void tryWriteMapToFile(
if (map_cell < 0 || 100 < map_cell) {
q = MaxRGB;
} else {
q = map_cell / 255.0 * MaxRGB;
q = map_cell / 100.0 * MaxRGB;
Copy link
Member

Choose a reason for hiding this comment

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

Similar to the other PR, the ROS 1 version seems to use 255 (see negate) which has been in use for 10+ years. This seems OK on face value, but I'm a little weary

https://github.com/ros-planning/navigation/blob/noetic-devel/map_server/src/image_loader.cpp#L130-L136

Copy link
Member

@SteveMacenski SteveMacenski Oct 7, 2024

Choose a reason for hiding this comment

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

Though, the MapMode::Scale seems to agree with you, so I'm leaning towards merging this. Lets continue to chat in the other PR you submitted and we'll handle these as a pair since they seems tied together

Thanks!

}
pixel = Magick::Color(q, q, q);
break;
Expand Down
Loading