launch包
This commit is contained in:
parent
d7ae466462
commit
0939e19f3b
32
src/common/launch_system/CMakeLists.txt
Normal file
32
src/common/launch_system/CMakeLists.txt
Normal file
@ -0,0 +1,32 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(launch_system)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
# find dependencies
|
||||
find_package(ament_cmake REQUIRED)
|
||||
find_package(ament_cmake_python REQUIRED)
|
||||
find_package(vehicle_params REQUIRED)
|
||||
find_package(radio_ctrl REQUIRED)
|
||||
find_package(remote_ctrl REQUIRED)
|
||||
find_package(mc REQUIRED)
|
||||
find_package(ctrl_arbiter REQUIRED)
|
||||
find_package(mqtt_report REQUIRED)
|
||||
find_package(rslidar_sdk REQUIRED)
|
||||
find_package(rtk REQUIRED)
|
||||
find_package(route REQUIRED)
|
||||
find_package(sub REQUIRED)
|
||||
find_package(task_manager REQUIRED)
|
||||
find_package(pl REQUIRED)
|
||||
find_package(fu REQUIRED)
|
||||
|
||||
# Install launch files
|
||||
install(DIRECTORY
|
||||
launch
|
||||
config
|
||||
DESTINATION share/${PROJECT_NAME}/
|
||||
)
|
||||
|
||||
ament_package()
|
||||
117
src/common/launch_system/launch/start_all.launch.py
Normal file
117
src/common/launch_system/launch/start_all.launch.py
Normal file
@ -0,0 +1,117 @@
|
||||
from launch import LaunchDescription
|
||||
from launch_ros.actions import Node
|
||||
from launch.actions import IncludeLaunchDescription
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
import os
|
||||
|
||||
def generate_launch_description():
|
||||
# 获取各包的路径
|
||||
rslidar_sdk_path = get_package_share_directory("rslidar_sdk")
|
||||
fu_path = get_package_share_directory("fu")
|
||||
|
||||
return LaunchDescription(
|
||||
[
|
||||
# 启动车辆参数节点
|
||||
Node(
|
||||
package="vehicle_params",
|
||||
executable="vehicle_params_node",
|
||||
name="vehicle_params_node",
|
||||
output="screen",
|
||||
),
|
||||
|
||||
# 启动无线电控制节点
|
||||
Node(
|
||||
package="radio_ctrl",
|
||||
executable="radio_ctrl_node",
|
||||
name="radio_ctrl_node",
|
||||
output="screen",
|
||||
),
|
||||
|
||||
# 启动远程控制节点
|
||||
Node(
|
||||
package="remote_ctrl",
|
||||
executable="remote_ctrl_node",
|
||||
name="remote_ctrl_node",
|
||||
output="screen",
|
||||
),
|
||||
|
||||
# 启动MC节点
|
||||
Node(
|
||||
package="mc",
|
||||
executable="mc_node",
|
||||
name="mc_node",
|
||||
output="screen",
|
||||
),
|
||||
|
||||
# 启动控制仲裁节点
|
||||
Node(
|
||||
package="ctrl_arbiter",
|
||||
executable="ctrl_arbiter_node",
|
||||
name="ctrl_arbiter_node",
|
||||
output="screen",
|
||||
),
|
||||
|
||||
# 启动MQTT报告节点
|
||||
Node(
|
||||
package="mqtt_report",
|
||||
executable="mqtt_report_node",
|
||||
name="mqtt_report_node",
|
||||
output="screen",
|
||||
),
|
||||
|
||||
# 启动激光雷达节点(使用现有launch文件)
|
||||
IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(rslidar_sdk_path, "launch", "start_double.launch.py")
|
||||
)
|
||||
),
|
||||
|
||||
# 启动RTK节点
|
||||
Node(
|
||||
package="rtk",
|
||||
executable="rtk_node",
|
||||
name="rtk_node",
|
||||
output="screen",
|
||||
),
|
||||
|
||||
# 启动路径节点
|
||||
Node(
|
||||
package="route",
|
||||
executable="route_node",
|
||||
name="route_node",
|
||||
output="screen",
|
||||
),
|
||||
|
||||
# 启动SUB节点
|
||||
Node(
|
||||
package="sub",
|
||||
executable="sub_node",
|
||||
name="sub_node",
|
||||
output="screen",
|
||||
),
|
||||
|
||||
# 启动任务管理器节点
|
||||
Node(
|
||||
package="task_manager",
|
||||
executable="task_manager_node",
|
||||
name="task_manager_node",
|
||||
output="screen",
|
||||
),
|
||||
|
||||
# 启动PL节点
|
||||
Node(
|
||||
package="pl",
|
||||
executable="pl_node",
|
||||
name="pl_node",
|
||||
output="screen",
|
||||
),
|
||||
|
||||
# 启动FU节点(使用现有launch文件)
|
||||
IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(fu_path, "launch", "fu.launch.py")
|
||||
)
|
||||
),
|
||||
]
|
||||
)
|
||||
33
src/common/launch_system/package.xml
Normal file
33
src/common/launch_system/package.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>launch_system</name>
|
||||
<version>0.0.0</version>
|
||||
<description>Launch system for sweeper_200</description>
|
||||
<maintainer email="user@example.com">User</maintainer>
|
||||
<license>Apache-2.0</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
<buildtool_depend>ament_cmake_python</buildtool_depend>
|
||||
|
||||
<depend>vehicle_params</depend>
|
||||
<depend>radio_ctrl</depend>
|
||||
<depend>remote_ctrl</depend>
|
||||
<depend>mc</depend>
|
||||
<depend>ctrl_arbiter</depend>
|
||||
<depend>mqtt_report</depend>
|
||||
<depend>rslidar_sdk</depend>
|
||||
<depend>rtk</depend>
|
||||
<depend>route</depend>
|
||||
<depend>sub</depend>
|
||||
<depend>task_manager</depend>
|
||||
<depend>pl</depend>
|
||||
<depend>fu</depend>
|
||||
|
||||
<test_depend>ament_lint_auto</test_depend>
|
||||
<test_depend>ament_lint_common</test_depend>
|
||||
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
||||
Loading…
Reference in New Issue
Block a user