rosrun命令运行Python找不到可执行文件
写了一个Python程序,在程序当前目录下打开终端,用rosrun命令提示有错误。
Usage: rosrun [--prefix cmd] [--debug] PACKAGE EXECUTABLE [ARGS]
rosrun will locate PACKAGE and try to find
an executable named EXECUTABLE in the PACKAGE tree.
If it finds it, it will run it with ARGS.
解决办法:
1.确认Python的可执行权限,选中右击属性,找到权限那一栏,确保文件为允许作为程序执行文件。
2.rosrun命令需要后边加功能包的名字,然后再跟Python程序文件名字。
以运行在功能包my_ros_helloworld功能包下的talker.py程序为例。
rosrun my_ros_helloworld talker.py
参考链接:
https://answers.ros.org/question/305778/unable-to-run-ros-package-executable/