Skip to content

Commit 32bb128

Browse files
committed
Attempt loading sargans color over SRTM1 DEM
* Doesn't work, documented the limitation Signed-off-by: Ryan Friedman <[email protected]>
1 parent f14b764 commit 32bb128

File tree

3 files changed

+55
-1
lines changed

3 files changed

+55
-1
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,22 @@ ros2 launch grid_map_geo load_vrt_launch.xml
9090

9191
**Note:** `grid_map_geo` uses asserts to catch coding errors; they are enabled by default when
9292
building in debug mode, and removed from release mode.
93+
94+
## Mixing data from different datums, resolutions, and raster sizes
95+
96+
`grid_map_geo` does not yet support automatically overlaying color data over elevation data from
97+
different sources. Currently, color data must be the same datum, resolution and size for both the
98+
DEM raster and the color raster.
99+
100+
As an example, `sertig_color.tif` color data can be requested loaded on the SRTM1 DEM at sertig:
101+
102+
```bash
103+
ros2 launch grid_map_geo load_tif.launch.py params_file:=config/sargans_color_over_srtm1.yaml
104+
# OR
105+
ros2 run --prefix 'gdb -ex run --args' grid_map_geo map_publisher --ros-args --params-file config/sargans_color_over_srtm1.yaml
106+
```
107+
108+
These datasets are different sizes, different resultions, and use different datums.
109+
110+
Either of these ways of launching cause a floating point crash in `grid_map::getIndexFromLinearIndex`.
111+
This limitation may be addressed in a future version.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
map_publisher:
2+
ros__parameters:
3+
gdal_dataset_path: /vsizip/vsicurl/https://terrain.ardupilot.org/SRTM1/N09E047.hgt.zip/N09E047.hgt
4+
gdal_dataset_color_path: "resources/sargans_color.tif"
5+
max_map_width: 3601
6+
max_map_height: 3601
7+
map_origin_latitude: 47.033333
8+
map_origin_longitude: 9.433333

launch/load_tif.launch.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from launch import LaunchDescription
66
from launch.actions import DeclareLaunchArgument
7-
from launch.conditions import IfCondition
7+
from launch.conditions import IfCondition, LaunchConfigurationEquals, LaunchConfigurationNotEquals
88
from launch.substitutions import LaunchConfiguration
99

1010
from launch_ros.actions import Node
@@ -40,6 +40,19 @@ def generate_launch_description():
4040
],
4141
output="screen",
4242
emulate_tty=True,
43+
condition=LaunchConfigurationEquals(LaunchConfiguration("params_file"), "")
44+
)
45+
46+
# map publisher node with params file
47+
map_publisher_with_param_file = Node(
48+
package="grid_map_geo",
49+
namespace="grid_map_geo",
50+
executable="map_publisher",
51+
name="map_publisher",
52+
parameters=[LaunchConfiguration("params_file")],
53+
output="screen",
54+
emulate_tty=True,
55+
condition=LaunchConfigurationNotEquals(LaunchConfiguration("params_file"), "")
4356
)
4457

4558
# rviz node
@@ -73,8 +86,22 @@ def generate_launch_description():
7386
default_value=f'{Path(pkg_grid_map_geo) / "resources" / default_gdal_color_dataset}',
7487
description="Full path to the elevation texture file.",
7588
),
89+
DeclareLaunchArgument(
90+
"gdal_dataset_color_path",
91+
default_value=os.path.join(
92+
pkg_grid_map_geo, "resources", default_gdal_color_dataset
93+
),
94+
description="Full path to the elevation texture file.",
95+
),
96+
DeclareLaunchArgument(
97+
"params_file",
98+
default_value="",
99+
description="YAML parameter file path.",
100+
),
101+
76102
static_transform_publisher,
77103
map_publisher,
104+
map_publisher_with_param_file,
78105
rviz,
79106
]
80107
)

0 commit comments

Comments
 (0)