環境
報錯
- 按照教程中執行
rosrun warehouse_ros mongo_wrapper_ros.py
報錯如下:
[rosrun] Couldn't find executable named mongo_wrapper_ros.py below /opt/ros/melodic/share/warehouse_ros
- warehouse_ros包位於/opt/ros/melodic/share/warehouse_ros,可以看到包中並沒有mongo_wrapper_ros.py
- 找到了warehouse_ros的melodic版本的源碼,其中源碼中包含了mongo_wrapper_ros.py
- 將mongo_wrapper_ros.py拷貝到/opt/ros/melodic/share/warehouse_ros中,並使用
sudo chmod 755 mongo_wrapper_ros.py
將權限改爲755
- 重新運行
rosrun warehouse_ros mongo_wrapper_ros.py
,報如下錯誤:
- 使用
sudo apt-get install mongodb-server
命令安裝一下mongodb
- 重新運行
rosrun warehouse_ros mongo_wrapper_ros.py
,報如下錯誤:
- 使用ps命令查看已經啓動了一個mongodb,所以kill掉並重新運行
rosrun warehouse_ros mongo_wrapper_ros.py
後正常啓動:
- melodic版本的源碼下載之後就是一個ros的package,編譯之後是一個動態庫,可以鏈接到自己的程序中調用。
- 一臺新機器上,編譯報錯,原因是未安裝mongo c++ drivers,在melodic版本的源碼的readme中,有編譯方法
sudo apt-get install scons
cd mongo-cxx-driver
sudo scons --prefix=/usr/local/ --full --use-system-boost --disable-warnings-as-errors