添加了全套任务的包
This commit is contained in:
47
src/racing_control/launch/racing_control.launch.py
Normal file
47
src/racing_control/launch/racing_control.launch.py
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Launch the racing_control orchestration node."""
|
||||
|
||||
import os
|
||||
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import Node
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
pkg_dir = get_package_share_directory("racing_control")
|
||||
default_params = os.path.join(pkg_dir, "config", "racing_control.yaml")
|
||||
|
||||
params_file = LaunchConfiguration("params_file")
|
||||
auto_start = LaunchConfiguration("auto_start")
|
||||
|
||||
racing_control = Node(
|
||||
package="racing_control",
|
||||
executable="racing_control",
|
||||
name="racing_control",
|
||||
output="screen",
|
||||
parameters=[
|
||||
params_file,
|
||||
{
|
||||
"auto_start": auto_start,
|
||||
},
|
||||
],
|
||||
)
|
||||
|
||||
return LaunchDescription(
|
||||
[
|
||||
DeclareLaunchArgument(
|
||||
"params_file",
|
||||
default_value=default_params,
|
||||
description="YAML parameter file for the racing_control node",
|
||||
),
|
||||
DeclareLaunchArgument(
|
||||
"auto_start",
|
||||
default_value="false",
|
||||
description="Start the race immediately instead of waiting for SPACE",
|
||||
),
|
||||
racing_control,
|
||||
]
|
||||
)
|
||||
Reference in New Issue
Block a user