ROS——工程中运行.py文件报错

问题描述

运行ROS包内的程序时,提示文件不是可执行文件

rosrun beginner_tutorials control.py

错误提示如下:

[rosrun] Couldn't find executable named controller.py below ...
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun] .../scripts/controller.py

除此之外,在source之后,输入rosrun beginner_tutorials 按tab键也不会自动提示.py文件

解决方法

这种问题的出现主要是.py文件权限不够,解决方法如下:

  1. 打开命令窗口,在.py文件所在的位置,在命令窗口中输入

    chmod a+x xx.py
    

    其中xx是你的.py文件的名字。

  2. 重新运行即可。

猜你喜欢

转载自blog.csdn.net/qq_16775293/article/details/115958545