문제 설명
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
또한 소스 다음에 rosrun Beginner_tutorials를 입력하고 탭 키를 누르면 자동으로 .py 파일이 프롬프트되지 않습니다.
해결책
이 문제는 주로 .py 파일에 권한이 부족하여 발생합니다. 해결 방법은 다음과 같습니다.
-
.py 파일이 있는 명령창을 열고 명령창에 입력하세요.
chmod a+x xx.py
여기서 xx는 .py 파일의 이름입니다.
-
다시 실행해 보세요.