Skip to content

Fix launching with no color when not configured for a color tif file#41

Merged
Jaeyoung-Lim merged 1 commit into
ethz-asl:ros2from
Ryanf55:support-launch-without-color
Jan 14, 2024
Merged

Fix launching with no color when not configured for a color tif file#41
Jaeyoung-Lim merged 1 commit into
ethz-asl:ros2from
Ryanf55:support-launch-without-color

Conversation

@Ryanf55

@Ryanf55 Ryanf55 commented Jan 14, 2024

Copy link
Copy Markdown
Collaborator

Purpose

The default param for the color_path on test_tif_loader is "." ( a period). That said, the logic in grid_map_geo.cpp is checking for empty string to determine whether to load the color data.

Thus, if a user wants to load just an elevation map with no color data, they would have to change the default to empty string in their launch file, which is not that intuitive.

This PR is a trivial fix for the issue that can be merged before #38.

Demo

$ ros2 run grid_map_geo test_tif_loader --ros-args -p tif_path:=/home/ryan/Dev/ros2_ws/src/grid_map_geo/install/grid_map_geo/share/grid_map_geo/resources/sargans.tif
[INFO] [1705212505.372827098] [map_publisher]: file_path /home/ryan/Dev/ros2_ws/src/grid_map_geo/install/grid_map_geo/share/grid_map_geo/resources/sargans.tif
[INFO] [1705212505.372887373] [map_publisher]: color_path 

Loading GeoTIFF file for gridmap

Wkt ProjectionRef: PROJCS["CH1903 / LV03",GEOGCS["CH1903",DATUM["CH1903",SPHEROID["Bessel 1841",6377397.155,299.1528128,AUTHORITY["EPSG","7004"]],AUTHORITY["EPSG","6149"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4149"]],PROJECTION["Hotine_Oblique_Mercator_Azimuth_Center"],PARAMETER["latitude_of_center",46.9524055555556],PARAMETER["longitude_of_center",7.43958333333333],PARAMETER["azimuth",90],PARAMETER["rectified_grid_angle",90],PARAMETER["scale_factor",1],PARAMETER["false_easting",600000],PARAMETER["false_northing",200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","21781"]]
Width: 748 Height: 1220 Resolution: 10

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>

@Jaeyoung-Lim Jaeyoung-Lim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@Jaeyoung-Lim Jaeyoung-Lim merged commit 21675ac into ethz-asl:ros2 Jan 14, 2024
@Ryanf55 Ryanf55 deleted the support-launch-without-color branch January 14, 2024 15:02
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