world_canvas的ros项目安装部署

                  world_canvas_server安装部署

系统ubuntu20.04

ros:noetic

克隆代码:

cd /home/sukai/workspace/roskaiyuanweb/catkin_ws_work_canvas/src
git clone https://github.com/corot/world_canvas.git
git clone https://github.com/corot/world_canvas_libs.git
git clone https://github.com/corot/world_canvas_msgs.git
git clone https://github.com/corot/world_canvas_tools.git
git clone https://github.com/turtlebot/turtlebot_simulator.git
git clone https://github.com/yujinrobot/yujin_ocs.git
git clone https://github.com/yujinrobot/yocs_msgs.git
git clone https://github.com/ros-planning/warehouse_ros.git
git clone  https://github.com/ros-perception/ar_track_alvar.git
ar_track_alvar 项目需要 check noetic-devel 分支

安装其它库: 

#sudo apt-get install ros-noetic-warehouse-ros
sudo apt-get install python3-pymongo
sudo apt-get install python3-rospkg

或者
安装依赖项:根据每个软件包的要求,使用ROS的包管理器 rosdep 来安装依赖项。运行以下命令:
cd ~/workspace/roskaiyuanweb/catkin_ws_work_canvas
rosdep install --from-paths src --ignore-src -r -y

git上 world_canvas 只有一个版本,看他使用的是python2.7,预测这个项目是noetic之后的版本;

我手上笔记本是noetic的版本,花4小时尝试跑一下;

world_canvas 项目使用的是qt4,而我是qt5,需要改动下cmakelist.txt使它兼容qt5
qt4 update qt5 
cd ~/roskaiyuanweb/catkin_ws_work_canvas/src/world_canvas_tools/world_canvas_editor/CMakeLists.txt
#find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED)
find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport Network SerialPort Sql WebSockets WebChannel  REQUIRED)
qt5_wrap_cpp(MOC_FILES
#qt4_wrap_cpp(MOC_FILES
include/world_canvas_editor/annotations.hpp
include/world_canvas_editor/worlds_list.hpp
include/world_canvas_editor/editor_panel.hpp
)
#qt4_wrap_ui(UIC_FILES
qt5_wrap_ui(UIC_FILES
src/ui/editor_panel.ui
)
#sukai gai
#include(${QT_USE_FILE})
include_directories(
include
${CMAKE_CURRENT_BINARY_DIR}
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${Qt5SerialPort_INCLUDE_DIRS}
${Qt5Sql_INCLUDE_DIRS}
${Qt5WebSockets_INCLUDE_DIRS}
${Qt5WebChannel_INCLUDE_DIRS}


)

 改:map_loader.hpp

cd ~/workspace/roskaiyuanweb/catkin_ws_work_canvas/src/world_canvas_tools/world_canvas_editor/include/world_canvas_editor/map_loader.hpp
//map_server::loadMapFromFile(&map_resp_, mapfname.c_str(), res, negate, occ_th, free_th, origin, trinary); //sukai
MapMode trinaryMapMode = TRINARY;
map_server::loadMapFromFile(&map_resp_, mapfname.c_str(), res, negate, occ_th, free_th, origin, trinaryMapMode);


/**

地图模式(MapMode)可以有三种取值:TRINARY、SCALE 和 RAW。每种模式对应不同的地图值的解释和处理方式。

    TRINARY 模式是默认模式,其中:
        如果地图值(value)大于等于 occ_th(占用阈值),则被认为是占用(Occupied),对应值为 100。
        如果地图值小于等于 free_th(空闲阈值),则被认为是空闲(Free),对应值为 0。
        否则被认为是未知(Unknown)。

    SCALE 模式中:
        如果地图值小于 1.0,被视为未知(Unknown)。
        如果地图值大于等于 occ_th,被视为占用(Occupied),对应值为 100。
        如果地图值小于等于 free_th,被视为空闲(Free),对应值为 0。
        否则,使用线性映射将阈值之间的值线性映射到 0 到 100 之间。

    RAW 模式中,地图值直接使用,不进行特殊处理。

枚举定义中的 MapMode 声明了这些模式作为枚举值,可以在代码中使用这些枚举值来表示和处理不同的地图模式。

根据您之前的问题,您需要将 TRINARY_VALUE 替换为 TRINARY,因为 TRINARY 是枚举类型 MapMode 的一个有效取值。


*/

改 world_canvas 中的所有py文件中的python改python3

#!/usr/bin/env python
改
#!/usr/bin/env python3

所有 print 加上括号 

print "..."

改:
print ("...")

编译运行:

roslaunch world_canvas_server world_canvas_server.launch --screen

 File "/home/sukai/workspace/roskaiyuanweb/catkin_ws_work_canvas/src/world_canvas/world_canvas_server/src/world_canvas_server/annotations_server.py", line 40, in <module>
    import warehouse_ros as wr
ModuleNotFoundError: No module named 'warehouse_ros'

应该是版本不兼容,到此为止,不想在下功夫了,时间太宝贵!

我没跑起来,不知道这个项目是什么样的,没看到任何功能和界面。

World Canvas Server的指导说明文档:

关于如何使用World Canvas Server的指导说明。下面是使用World Canvas Server的步骤:

1.安装: 使用提供的 world_canvas.rosinstall 文件创建一个World Canvas工作空间,并安装依赖项。运行以下命令安装依赖项:

rosdep install --from-paths -i src

2.运行: 首先,启动注释服务器:

roslaunch world_canvas_server world_canvas_server.launch debug:=true --screen

3.填充数据库: 使用提供的脚本 save_xxxx.py 和数据文件(位于world_canvas_server软件包的 test/annotations 目录下)将一些注释保存到数据库中。例如:

> rosrun world_canvas_server save_markers.py _world:='What a wonderful world' _file:=`rospack find world_canvas_server`/test/annotations/ar_list.yaml
> rosrun world_canvas_server save_walls.py _world:='What a wonderful world' _file:=`rospack find world_canvas_server`/test/annotations/wall_list.yaml

4.查找注释: 使用提供的脚本 get_any.py 从数据库中查找注释。可以根据需要修改参数进行搜索。例如:

> rosrun world_canvas_server get_any.py  _world:='What a wonderful world' _ids:=[] _types:=['ar_track_alvar_msgs/AlvarMarker'] _keywords:=[] _relationships=[] _topic_type:=ar_track_alvar_msgs/AlvarMarker _topic_name:=ar_markers _pub_as_list:=False
> rosrun world_canvas_server get_any.py  _world:='What a wonderful world' _ids:=[] _types:=['yocs_msgs/Wall'] _keywords:=[] _relationships=[] _topic_type:=yocs_msgs/WallList _topic_name:=wall_pose_list _pub_as_list:=True

5.导入/导出数据库: 使用提供的脚本 import.pyexport.py 可以将数据库内容导入到YAML文件或将YAML文件导出到数据库中。例如:

rosrun world_canvas_server import.py _file:=`rospack find world_canvas_server`/test/annotations/full_db.yaml
rosrun world_canvas_server export.py _file:=`rospack find world_canvas_server`/test/annotations/export_db.yaml

6.实际场景测试: 可以使用虚拟传感器在Stage仿真环境中模拟Turtlebot,并从World Canvas Server获取2D地图。首先更新工作空间,然后填充WC数据库,并准备好运行以下命令:

roslaunch world_canvas_server world_canvas_server.launch --screen
roslaunch turtlebot_stage populate_world.launch --screen
roslaunch turtlebot_stage world_canvas_demo.launch --screen

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

_无往而不胜_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值