Skip to content

Commit b0080bc

Browse files
committed
Switch to pathlib
1 parent 7155cb4 commit b0080bc

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

launch/load_tif.launch.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os
1+
from pathlib import Path
22

33
from ament_index_python.packages import get_package_share_directory
44

@@ -46,7 +46,7 @@ def generate_launch_description():
4646
rviz = Node(
4747
package="rviz2",
4848
executable="rviz2",
49-
arguments=["-d", os.path.join(pkg_grid_map_geo, "rviz", "config.rviz")],
49+
arguments=["-d", f'{Path(pkg_grid_map_geo) / "rviz" / "config.rviz"}'],
5050
condition=IfCondition(LaunchConfiguration("rviz")),
5151
)
5252

@@ -65,16 +65,12 @@ def generate_launch_description():
6565
),
6666
DeclareLaunchArgument(
6767
"tif_path",
68-
default_value=os.path.join(
69-
pkg_grid_map_geo, "resources", default_tif_file
70-
),
68+
default_value=f'{Path(pkg_grid_map_geo) / "resources" / default_tif_file}',
7169
description="Full path to the elevation map file.",
7270
),
7371
DeclareLaunchArgument(
7472
"tif_color_path",
75-
default_value=os.path.join(
76-
pkg_grid_map_geo, "resources", default_tif_color_file
77-
),
73+
default_value=f'{Path(pkg_grid_map_geo) / "resources" / default_tif_color_file}',
7874
description="Full path to the elevation texture file.",
7975
),
8076
static_transform_publisher,

0 commit comments

Comments
 (0)