ros2 launch 常见问题

关于运行launch,(输入时没法自动补全手打)

ros2 launch oryxbot_joy oryxbot2_joy.launch.py

会报错

file 'oryxbot2_joy.launch.py' was not found in the share directory of package 
'oryxbot_joy' which is at '/home/ln/ros2_ws/install/oryxbot_joy/share/oryxbot_joy'

怎么也找不到为啥,谁知道ros2不仅将launch文件从xml改成了Python文件,还要把他安装在cmake文件里添加

# Install launch files.
install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}/
)
#	看到	ROS2-IN-5-DAYS-e-book.pdf	94页

这样就可以运行了

然后就碰到了

[ERROR] [launch]: Caught exception in launch
(see debug for traceback): launch file at
'/home/ln/ros2_ws/install/oryxbot2_base/share/oryxbot2_base/launch/oryxbot2_base.launch.py'
does not contain the required function
'generate_launch_description()'

这个问题
原来需要加 -d

ln@ln-pctogo:~$ ros2 launch -d oryxbot2_base oryxbot2_base_launch.py

然后又碰到了一堆错误
ros2 launch 常见问题_第1张图片
再见

你可能感兴趣的:(ros2爬坑记录)