Skip to content

Commit 876226c

Browse files
committed
Change system launch file to python launch description
1 parent 9fe7bc2 commit 876226c

20 files changed

Lines changed: 32 additions & 26 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ To use **PCT planner** instead of FAR planner, run directly via launch and set `
207207

208208
```bash
209209
source install/setup.bash
210-
ros2 launch vehicle_simulator system_simulation_with_route_planner.launch use_pct_planner:=true
210+
ros2 launch vehicle_simulator system_simulation_with_route_planner.launch.py use_pct_planner:=true
211211
```
212212

213213
#### With exploration planner (simulation)
@@ -271,7 +271,7 @@ To use **PCT planner** instead of FAR planner:
271271

272272
```bash
273273
source install/setup.bash
274-
ros2 launch vehicle_simulator system_real_robot_with_route_planner.launch use_pct_planner:=true
274+
ros2 launch vehicle_simulator system_real_robot_with_route_planner.launch.py use_pct_planner:=true
275275
```
276276

277277

src/base_autonomy/vehicle_simulator/launch/system_bagfile.launch renamed to src/base_autonomy/vehicle_simulator/launch/system_bagfile.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from ament_index_python.packages import get_package_share_directory
44
from launch import LaunchDescription
55
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, TimerAction
6-
from launch.launch_description_sources import PythonLaunchDescriptionSource, FrontendLaunchDescriptionSource
6+
from launch.launch_description_sources import FrontendLaunchDescriptionSource, PythonLaunchDescriptionSource
77
from launch_ros.actions import Node
88
from launch.substitutions import LaunchConfiguration
99

src/base_autonomy/vehicle_simulator/launch/system_bagfile_with_exploration_planner.launch renamed to src/base_autonomy/vehicle_simulator/launch/system_bagfile_with_exploration_planner.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from ament_index_python.packages import get_package_share_directory
44
from launch import LaunchDescription
55
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, TimerAction
6-
from launch.launch_description_sources import PythonLaunchDescriptionSource, FrontendLaunchDescriptionSource
6+
from launch.launch_description_sources import FrontendLaunchDescriptionSource, PythonLaunchDescriptionSource
77
from launch_ros.actions import Node
88
from launch.substitutions import LaunchConfiguration
99

src/base_autonomy/vehicle_simulator/launch/system_bagfile_with_route_planner.launch renamed to src/base_autonomy/vehicle_simulator/launch/system_bagfile_with_route_planner.launch.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
from ament_index_python.packages import get_package_share_directory
44
from launch import LaunchDescription
55
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, TimerAction
6-
from launch.launch_description_sources import PythonLaunchDescriptionSource, FrontendLaunchDescriptionSource
6+
from launch.launch_description_sources import FrontendLaunchDescriptionSource, PythonLaunchDescriptionSource
77
from launch_ros.actions import Node
8-
from launch.substitutions import LaunchConfiguration
8+
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
99
from launch.conditions import IfCondition, UnlessCondition
10+
from launch_ros.substitutions import FindPackageShare
1011

1112
def generate_launch_description():
1213
use_pct_planner = LaunchConfiguration('use_pct_planner')
@@ -108,7 +109,8 @@ def generate_launch_description():
108109
# PCT Planner (alternative)
109110
start_pct_planner = IncludeLaunchDescription(
110111
PythonLaunchDescriptionSource(
111-
[get_package_share_directory('pct_planner'), '/launch/pct_planner.launch.py']),
112+
PathJoinSubstitution([FindPackageShare('pct_planner'), 'launch', 'pct_planner.launch.py'])
113+
),
112114
condition=IfCondition(use_pct_planner)
113115
)
114116

src/base_autonomy/vehicle_simulator/launch/system_real_robot.launch renamed to src/base_autonomy/vehicle_simulator/launch/system_real_robot.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from ament_index_python.packages import get_package_share_directory
44
from launch import LaunchDescription
55
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, TimerAction
6-
from launch.launch_description_sources import PythonLaunchDescriptionSource, FrontendLaunchDescriptionSource
6+
from launch.launch_description_sources import FrontendLaunchDescriptionSource, PythonLaunchDescriptionSource
77
from launch_ros.actions import Node
88
from launch.substitutions import LaunchConfiguration
99

src/base_autonomy/vehicle_simulator/launch/system_real_robot_with_exploration_planner.launch renamed to src/base_autonomy/vehicle_simulator/launch/system_real_robot_with_exploration_planner.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from ament_index_python.packages import get_package_share_directory
44
from launch import LaunchDescription
55
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, TimerAction
6-
from launch.launch_description_sources import PythonLaunchDescriptionSource, FrontendLaunchDescriptionSource
6+
from launch.launch_description_sources import FrontendLaunchDescriptionSource, PythonLaunchDescriptionSource
77
from launch_ros.actions import Node
88
from launch.substitutions import LaunchConfiguration
99

src/base_autonomy/vehicle_simulator/launch/system_real_robot_with_route_planner.launch renamed to src/base_autonomy/vehicle_simulator/launch/system_real_robot_with_route_planner.launch.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
from ament_index_python.packages import get_package_share_directory
44
from launch import LaunchDescription
55
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, TimerAction
6-
from launch.launch_description_sources import PythonLaunchDescriptionSource, FrontendLaunchDescriptionSource
6+
from launch.launch_description_sources import FrontendLaunchDescriptionSource, PythonLaunchDescriptionSource
77
from launch_ros.actions import Node
8-
from launch.substitutions import LaunchConfiguration
8+
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
99
from launch.conditions import IfCondition, UnlessCondition
10+
from launch_ros.substitutions import FindPackageShare
1011

1112
def generate_launch_description():
1213
use_pct_planner = LaunchConfiguration('use_pct_planner')
@@ -108,7 +109,8 @@ def generate_launch_description():
108109
# PCT Planner (alternative)
109110
start_pct_planner = IncludeLaunchDescription(
110111
PythonLaunchDescriptionSource(
111-
[get_package_share_directory('pct_planner'), '/launch/pct_planner.launch.py']),
112+
PathJoinSubstitution([FindPackageShare('pct_planner'), 'launch', 'pct_planner.launch.py'])
113+
),
112114
condition=IfCondition(use_pct_planner)
113115
)
114116

src/base_autonomy/vehicle_simulator/launch/system_real_slam_only.launch renamed to src/base_autonomy/vehicle_simulator/launch/system_real_slam_only.launch.py

File renamed without changes.

src/base_autonomy/vehicle_simulator/launch/system_simulation.launch renamed to src/base_autonomy/vehicle_simulator/launch/system_simulation.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from ament_index_python.packages import get_package_share_directory
44
from launch import LaunchDescription
55
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, TimerAction
6-
from launch.launch_description_sources import PythonLaunchDescriptionSource, FrontendLaunchDescriptionSource
6+
from launch.launch_description_sources import FrontendLaunchDescriptionSource, PythonLaunchDescriptionSource
77
from launch_ros.actions import Node
88
from launch.substitutions import LaunchConfiguration
99

src/base_autonomy/vehicle_simulator/launch/system_simulation_with_exploration_planner.launch renamed to src/base_autonomy/vehicle_simulator/launch/system_simulation_with_exploration_planner.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from ament_index_python.packages import get_package_share_directory
44
from launch import LaunchDescription
55
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, TimerAction
6-
from launch.launch_description_sources import PythonLaunchDescriptionSource, FrontendLaunchDescriptionSource
6+
from launch.launch_description_sources import FrontendLaunchDescriptionSource, PythonLaunchDescriptionSource
77
from launch_ros.actions import Node
88
from launch.substitutions import LaunchConfiguration
99

0 commit comments

Comments
 (0)