已解决:No module named warehouse_ros

问题:No module named warehouse_ros

环境:
ubuntu16.04 + ros kinetic

源由:make a nav ROS android App一直是wait map list
发现问题:没有打开world_canvas_server功能包
安装功能包之后,运行world_canvas_server节点,出现下面问题
问题1:No module named uniqued_id
sudo apt-get install ros-kinetic-uniqued-id
再运行world_canvas_server节点,出现下面问题

错误详细内容:

-------------------------------------------------------------------------------------
$ roslaunch world_canvas_server world_canvas_server.launch debug:=true --screen
... logging to /home/ruffsl/.ros/log/35a221f2-a7a7-11e6-82a1-2c56dc38be90/roslaunch-cog-1-4257.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://cog-1:40164/

SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.5
 * /world_canvas_server/auto_save_map: False
 * /world_canvas_server/start_map_manager: True

NODES
  /
    world_canvas_server (world_canvas_server/world_canvas_server)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[world_canvas_server-1]: started with pid [4275]
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/world_canvas_server/world_canvas_server", line 6, in <module>
    import world_canvas_server
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/world_canvas_server/__init__.py", line 1, in <module>
    from .annotations_server import *
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/world_canvas_server/annotations_server.py", line 40, in <module>
    import warehouse_ros as wr
ImportError: No module named warehouse_ros
[world_canvas_server-1] process has died [pid 4275, exit code 1, cmd /opt/ros/kinetic/lib/world_canvas_server/world_canvas_server true __name:=world_canvas_server __log:=/home/ruffsl/.ros/log/35a221f2-a7a7-11e6-82a1-2c56dc38be90/world_canvas_server-1.log].
log file: /home/ruffsl/.ros/log/35a221f2-a7a7-11e6-82a1-2c56dc38be90/world_canvas_server-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done
-------------------------------------------------------------------------------------

解决方法:

依次在终端中执行下面命令,catkin工作空间若不同(catkin_ws),自行对应更改
下面的命令不能省略,warehouse_ros和warehouse_ros_mongo都要源码安装

cd catkin_ws/src

git clone https://github.com/ros-planning/warehouse_ros.git

git clone https://github.com/ros-planning/warehouse_ros_mongo.git

cd

git clone -b 26compat https://github.com/mongodb/mongo-cxx-driver.git

sudo apt-get install scons

cd mongo-cxx-driver

sudo scons --prefix=/usr/local/ --full --use-system-boost --disable-warnings-as-errors

cd 

cd catkin_ws

catkin_make

编译成功之后,按照之前错误提示:File “/opt/ros/kinetic/lib/python2.7/dist-packages/world_canvas_server/annotations_server.py”, line 40, in
import warehouse_ros as wr
将/opt/ros/kinetic/lib/python2.7/dist-packages/world_canvas_server/目录下文件中,所有的warehouse_ros更改为warehouse_ros_mongo,在annotations_server.py、map_manager.py、yaml_database.py中,一共三处
修改完成之后,再次执行world_canvas_server功能节点,如果还有提示错误,依然将对应文件中的warehouse_ros更改为warehouse_ros_mongo

至此,完美解决

参考:
https://github.com/ros-planning/warehouse_ros
https://github.com/ros-planning/warehouse_ros_mongo
https://github.com/corot/world_canvas/issues/48
https://answers.ros.org/question/264471/how-to-install-mongodb-for-ros-kinetic/
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/zhao_ke_xue/article/details/107081543