ROS2 launch文件找不的file ‘multisim.launch.py‘ was not found in the share directory of package ‘msg_pkg2‘

1.问题描述

在ROS2的功能包的src中创建文件目录launch并在launch创建multisim.launch.py的launch文件.运行时报出如下错误

file 'multisim.launch.py' was not found in the share directory of package 'msg_pkg2' which is at '/home/unitree/opject/ros2_ws/install/msg_pkg2/share/msg_pkg2'

其主要原因是在CMakeLists.txt中没有对lauunch的进install

2 解决

在CMakeLists.txt中添加如下代码即可

install(DIRECTORY launch
  DESTINATION share/${PROJECT_NAME})

猜你喜欢

转载自blog.csdn.net/u011573853/article/details/131947511