在运行这个例程的时候终端中出现:
[rosrun] Couldn't find executable named cv_bridge_test.py below /home/wyw/catkin_ws/src/robot_vision
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun] /home/wyw/catkin_ws/src/robot_vision/scripts/cv_bridge_test.py
而当我们去找这个文件的时候却能够找到文件,其实是文件的访问权限出了问题,找到文件的所在目录,打开终端,输入命令:
chmod +x cv_bridge_test.py
问题解决
但是我在使用的时候终端报出几个错误:
第一:
File "/home/wyw/catkin_ws/src/robot_vision/scripts/cv_bridge_test.py", line 21
print e
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(e)?
这时我们将cv_bridge_test.py文件打开,将其中的print e 改成print (e)
注:()为英文的
第二
:<pre> File "/home/wyw/catkin_ws/src/robot_vision/scripts/cv_bridge_test.py", line 46
print "Shutting down cv_bridge_test node."
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Shutting down cv_bridge_test node.")?
</pre>
将cv_bridge_test.py文件打开,将其中的46行改为:
print ("Shutting down cv_bridge_test node.")
至此问题解决。