Skip to content

Commit

Permalink
switch to pathlib instead os.path
Browse files Browse the repository at this point in the history
  • Loading branch information
pulak-gautam authored and Ryanf55 committed Feb 6, 2024
1 parent f49f444 commit 89f9797
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions ardupilot_gz_bringup/launch/iris_maze.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# limitations under the License.

"""Launch an iris quadcopter in Gazebo and Rviz."""
import os
from pathlib import Path

from ament_index_python.packages import get_package_share_directory

Expand Down Expand Up @@ -71,17 +71,17 @@ def generate_launch_description():
# Gazebo.
gz_sim_server = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ros_gz_sim, "launch", "gz_sim.launch.py")
f'{Path(pkg_ros_gz_sim) / "launch" / "gz_sim.launch.py"}'
),
launch_arguments={
"gz_args": "-v4 -s -r "
+ os.path.join(pkg_project_gazebo, "worlds", "iris_maze.sdf")
+ f'{Path(pkg_project_gazebo) / "worlds" / "iris_maze.sdf"}'
}.items(),
)

gz_sim_gui = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ros_gz_sim, "launch", "gz_sim.launch.py")
f'{Path(pkg_ros_gz_sim) / "launch" / "gz_sim.launch.py"}'
),
launch_arguments={"gz_args": "-v4 -g"}.items(),
)
Expand All @@ -92,7 +92,7 @@ def generate_launch_description():
executable="rviz2",
arguments=[
"-d",
os.path.join(pkg_project_bringup, "rviz", "iris_with_lidar.rviz"),
f'{Path(pkg_project_bringup) / "rviz" / "iris_with_lidar.rviz"}',
],
condition=IfCondition(LaunchConfiguration("rviz")),
)
Expand Down
10 changes: 5 additions & 5 deletions ardupilot_gz_bringup/launch/iris_runway.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# limitations under the License.

"""Launch an iris quadcopter in Gazebo and Rviz."""
import os
from pathlib import Path

from ament_index_python.packages import get_package_share_directory

Expand Down Expand Up @@ -71,17 +71,17 @@ def generate_launch_description():
# Gazebo.
gz_sim_server = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ros_gz_sim, "launch", "gz_sim.launch.py")
f'{Path(pkg_ros_gz_sim) / "launch" / "gz_sim.launch.py"}'
),
launch_arguments={
"gz_args": "-v4 -s -r "
+ os.path.join(pkg_project_gazebo, "worlds", "iris_runway.sdf")
f'{Path(pkg_project_gazebo) / "worlds" / "iris_runway.sdf"}'
}.items(),
)

gz_sim_gui = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ros_gz_sim, "launch", "gz_sim.launch.py")
f'{Path(pkg_ros_gz_sim) / "launch" / "gz_sim.launch.py"}'
),
launch_arguments={"gz_args": "-v4 -g"}.items(),
)
Expand All @@ -90,7 +90,7 @@ def generate_launch_description():
rviz = Node(
package="rviz2",
executable="rviz2",
arguments=["-d", os.path.join(pkg_project_bringup, "rviz", "iris.rviz")],
arguments=["-d", f'{Path(pkg_project_bringup) / "rviz" / "iris.rviz"}'],
condition=IfCondition(LaunchConfiguration("rviz")),
)

Expand Down
10 changes: 5 additions & 5 deletions ardupilot_gz_bringup/launch/wildthumper_playpen.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# limitations under the License.

"""Launch a wildthumper rover in the playpen world."""
import os
from pathlib import Path

from ament_index_python.packages import get_package_share_directory

Expand Down Expand Up @@ -71,17 +71,17 @@ def generate_launch_description():
# Gazebo.
gz_sim_server = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ros_gz_sim, "launch", "gz_sim.launch.py")
f'{Path(pkg_ros_gz_sim) / "launch" / "gz_sim.launch.py"}'
),
launch_arguments={
"gz_args": "-v4 -s -r "
+ os.path.join(pkg_project_gazebo, "worlds", "wildthumper_playpen.sdf")
f'{Path(pkg_project_gazebo) / "worlds" / "wildthumper_playpen.sdf"}'
}.items(),
)

gz_sim_gui = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ros_gz_sim, "launch", "gz_sim.launch.py")
f'{Path(pkg_ros_gz_sim) / "launch" / "gz_sim.launch.py"}'
),
launch_arguments={"gz_args": "-v4 -g"}.items(),
)
Expand All @@ -90,7 +90,7 @@ def generate_launch_description():
rviz = Node(
package="rviz2",
executable="rviz2",
arguments=["-d", os.path.join(pkg_project_bringup, "rviz", "wildthumper.rviz")],
arguments=["-d", f'{Path(pkg_project_bringup) / "rviz" / "wildthumper.rviz"}'],
condition=IfCondition(LaunchConfiguration("rviz")),
)

Expand Down

0 comments on commit 89f9797

Please sign in to comment.