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

喜欢ヅ旅行 2023-01-15 03:51 237阅读 0赞

问题描述

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

  1. rosrun beginner_tutorials control.py

错误提示如下:

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

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

解决方法

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

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

    1. chmod a+x xx.py

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

  2. 重新运行即可。

发表评论

表情:
评论列表 (有 0 条评论,237人围观)

还没有评论,来说两句吧...

相关阅读