Files
ROS2_WS/Node_ws/cppNode/launch/cpp_node.launch.py
2026-02-12 20:56:30 +08:00

16 lines
542 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 导入必要的库
# LaunchDescription用于描述整个launch文件的内容Node用于定义要启动的ROS2节点
from launch import LaunchDescription
# 导入Node类用于定义要启动的ROS2节点
from launch_ros.actions import Node
def generate_launch_description():
return LaunchDescription([
Node(
package='cpp_node', # 包名
executable='cpp_node', # 可执行文件名
name='cpp_node', # 节点名称
output='screen' # 输出日志到屏幕
)
])