編譯rbx1時遇到錯誤

2020-09-27 09:00:40

環境 Ubuntu 16.04 ,ROS kinetic
問題1:

/home/acl/rbx1/build/rbx1_nav/setup_custom_pythonpath.sh: 5: exec: /home/acl/rbx1/src/rbx1_nav/cfg/CalibrateAngular.cfg: Permission denied
/home/acl/rbx1/build/rbx1_nav/setup_custom_pythonpath.sh: 5: exec: /home/acl/rbx1/src/rbx1_nav/cfg/CalibrateLinear.cfg: Permission denied
rbx1_nav/CMakeFiles/rbx1_nav_gencfg.dir/build.make:65: recipe for target '/home/acl/rbx1/devel/include/rbx1_nav/CalibrateAngularConfig.h' failed
make[2]: *** [/home/acl/rbx1/devel/include/rbx1_nav/CalibrateAngularConfig.h] Error 126
make[2]: *** 正在等待未完成的任務....
rbx1_nav/CMakeFiles/rbx1_nav_gencfg.dir/build.make:83: recipe for target '/home/acl/rbx1/devel/include/rbx1_nav/CalibrateLinearConfig.h' failed
make[2]: *** [/home/acl/rbx1/devel/include/rbx1_nav/CalibrateLinearConfig.h] Error 126
CMakeFiles/Makefile2:851: recipe for target 'rbx1_nav/CMakeFiles/rbx1_nav_gencfg.dir/all' failed
make[1]: *** [rbx1_nav/CMakeFiles/rbx1_nav_gencfg.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

在這裡插入圖片描述
解決:
賦予cfg資料夾可執行許可權。首先找到你的cfd資料夾的路徑(比如我的路徑是/home/acl/rbx1/src/rbx1_nav/cfg),然後執行以下指令:

chmod -R +x /home/acl/rbx1/src/rbx1_nav/cfg

問題2:
編譯通過後,按照以下指令啟動可執行檔案時報錯:

rosrun rbx1_nav calibrate_linear.py

報錯;

[rosrun] Couldn't find executable named calibrate_linear.py below /home/acl/rbx1/src/rbx1_nav
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun]   /home/acl/rbx1/src/rbx1_nav/nodes/calibrate_linear.py

在這裡插入圖片描述
原因:
calibrate_linear.py檔案沒有可執行許可權。
解決:
按照報錯的路徑找到calibrate_linear.py,右鍵屬性->許可權,勾選上「允許作為程式可執行檔案(E)」,如下圖紅框中所示:
在這裡插入圖片描述
再次執行以下指令即可成功執行該檔案啟動機器人。

rosrun rbx1_nav calibrate_linear.py