Skip to content

Commit 9738ba8

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 f6599d1 commit 9738ba8

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
@@ -54,3 +54,22 @@ ros2 launch grid_map_geo load_vrt_launch.xml
5454

5555
**Note:** `grid_map_geo` uses asserts to catch coding errors; they are enabled by default when
5656
building in debug mode, and removed from release mode.
57+
58+
## Mixing data from different datums, resolutions, and raster sizes
59+
60+
`grid_map_geo` does not yet support automatically overlaying color data over elevation data from
61+
different sources. Currently, color data must be the same datum, resolution and size for both the
62+
DEM raster and the color raster.
63+
64+
As an example, `sertig_color.tif` color data can be requested loaded on the SRTM1 DEM at sertig:
65+
66+
```bash
67+
ros2 launch grid_map_geo load_tif.launch.py params_file:=config/sargans_color_over_srtm1.yaml
68+
# OR
69+
ros2 run --prefix 'gdb -ex run --args' grid_map_geo map_publisher --ros-args --params-file config/sargans_color_over_srtm1.yaml
70+
```
71+
72+
These datasets are different sizes, different resultions, and use different datums.
73+
74+
Either of these ways of launching cause a floating point crash in `grid_map::getIndexFromLinearIndex`.
75+
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
@@ -77,8 +90,22 @@ def generate_launch_description():
7790
),
7891
description="Full path to the elevation texture file.",
7992
),
93+
DeclareLaunchArgument(
94+
"gdal_dataset_color_path",
95+
default_value=os.path.join(
96+
pkg_grid_map_geo, "resources", default_gdal_color_dataset
97+
),
98+
description="Full path to the elevation texture file.",
99+
),
100+
DeclareLaunchArgument(
101+
"params_file",
102+
default_value="",
103+
description="YAML parameter file path.",
104+
),
105+
80106
static_transform_publisher,
81107
map_publisher,
108+
map_publisher_with_param_file,
82109
rviz,
83110
]
84111
)

0 commit comments

Comments
 (0)