Deep Grasp部署调试

X86结构移植

系统环境

OS:Ubuntu20.04

ROS:noetic apt安装

PCL部分

因为gpd用到了pcl_gpu,因此需要针对pcl进行源码定制编译,这里记录遇到的问题和解决方案。使用cmake-gui配置pcl的cmakelists,如图,打开WITH部分,选中WITH GPU和WITH CUDA。

编译是遇到了问题,说compute_30不支持了,这个时候如下图,在CUDA里面把CUDA_ARCH_BIN中的不支持的版本去掉即可。

由于我电脑安装了cuda11、cuda11.4、gcc8、gcc9等多个版本,编译提示

1、/usr/include/crt/host_config.h:138:2: error: #error -- unsupported GNU version! gcc versions later than 8 are not supported!

  138 | #error -- unsupported GNU version! gcc versions later than 8 are not supported!

这个问题是由于nvcc版本不对导致的,手动选择指定版本目录的nvcc即可,如下图

2、gcc未找到c11plusplus类似的错误,是因为gcc和g++版本不对应导致的,参考下图配置

GPD部分

正确编译pcl后未遇到问题,一次性编译通过。

Dex-Net部分

1、github下载慢或者404问题,尝试gitee 导入项目,替换github的地址clone,即可。

2、python setup.py develop异常,没有继续 调试,后续有时间再搞;使用ros方式编译,sudo sh install.sh(sh文件中已经替换github到gitee)

3、dexnet中引用的包,autolab_core等python版本为2,请切换至3(我的电脑为ubuntu20.04)

否则会报错,下图为其中之一

4、配置realsense2的perception的launch,启动后报错如下图,解决办法,

5、所有项目在python3下支持不友好,print格式不对、import路径不对,需要一一修改

6、meshpy编译错误,

/home/song/turtlebot_ros/grasp_ws/src/dex_net/meshpy/meshpy/meshrender.cpp:3:10: fatal error: boost/python/numeric.hpp: 没有那个文件或目录

    3 | #include "boost/python/numeric.hpp"

没解决,最后通过pip install meshpy解决。

    8 | #include "GL/osmesa.h"

安装:sudo apt-get install libosmesa6-dev

moveit deep grasp部分

moveit deep grasp处在测试阶段,并没有完善的代码,遇到的坑比较多,后面调试过程中在下面一一列出解决办法。

前言:

moveit deep grasp 依赖图,moveit task contructor是框架,融合了moveit和gpd等算法,实现抓取。

问题:

编译moveit task constructor问题

1、undefined reference to `GOMP_loop_nonmonotonic_dynamic_start@GOMP_4.5'

原因:缺少gomp.so链接导致的

解决方案:

set(EXT_LIBS libgomp.so)

target_link_libraries(point_cloud_server
${catkin_LIBRARIES}
${PROJECT_NAME}
${PCL_LIBRARIES}
${EXT_LIBS}
)

2、/usr/bin/ld: /opt/ros/noetic/lib/libresource_retriever.so: undefined reference to `curl_global_init@CURL_OPENSSL_4'
/usr/bin/ld: /opt/ros/noetic/lib/libresource_retriever.so: undefined reference to `curl_easy_perform@CURL_OPENSSL_4'
/usr/bin/ld: /opt/ros/noetic/lib/libresource_retriever.so: undefined reference to `curl_easy_setopt@CURL_OPENSSL_4'
/usr/bin/ld: /opt/ros/noetic/lib/libresource_retriever.so: undefined reference to `curl_easy_init@CURL_OPENSSL_4'
/usr/bin/ld: /opt/ros/noetic/lib/libresource_retriever.so: undefined reference to `curl_easy_cleanup@CURL_OPENSSL_4'
/usr/bin/ld: /opt/ros/noetic/lib/libresource_retriever.so: undefined reference to `curl_global_cleanup@CURL_OPENSSL_4'

第一眼看到原因应该和上个问题一样,重新编译curl并且支持OpenSSL4,猜测是这个原因。

git clone songyb/curl

编译后并没有解决,最终发现因为anaconda导致环境变换引起的,卸载后上述两个现象都解决了。

3、发现一个moveit源码BUG,

/**
* \def MOVEIT_STRUCT_FORWARD
* Like MOVEIT_CLASS_FORWARD, but forward declares the type as a struct
* instead of a class.
*/
#define MOVEIT_STRUCT_FORWARD(C) \
struct C; \
MOVEIT_DECLARE_PTR(C, C) 缺少一个";" noetic版本和master分支缺少,老版本(melodic,kinetic)等有。

编译通过。

MoveIT和gpd联合规划仿真遇到的问题

1、内存溢出, ,gdb调试后发现moveit官方代码中chomp planner 报错,因此尝试更换planner到ompl规划算法;deep grasp

2、更换ompl后,第一个问题没复现,出现新的问题,

terminate called after throwing an instance of 'std::runtime_error'

  what():  Property 'group': undefined

stage 'close hand': declared, but undefined

问题出现在源码BUG,https://github.com/ros-planning/moveit_task_constructor/issues/204#

替换所有的stage->properties().configureInitFrom(Stage::PARENT, { "group" });
到stage→setGroup(arm_group_name_);

可以解决。

Arm架构移植

背景

由于x86代码在台式机器上,远程点云等数据传输延时,不方便调试,因此,尝试把gpd代码移植到agx上去。

系统环境

OS:Ubuntu 18.04

ROS: melodic apt安装

PCL部分

和x86架构类似,没遇到问题,就是编译时间比较长,

OpenVino

参考安装手册

Install Intel® Distribution of OpenVINO™ toolkit for Linux* Using APT Repository — OpenVINO™ documentation

问题:xavier的处理器架构不支持,因此放弃。后面尝试采用和部署caffe

Caffe

参考安装

Caffe installation on Xavier - Jetson & Embedded Systems / Jetson AGX Xavier - NVIDIA Developer Forums

问题1: Could NOT find LMDB (missing: LMDB_INCLUDE_DIR LMDB_LIBRARIES)

解决方法:sudo apt-get install liblmdb-dev libleveldb-dev libsnappy-dev libatlas-base-dev doxygen

问题2: Found cuDNN: ver. ??? found (include: /usr/include, library: /usr/lib/aarch64-linux-gnu/libcudnn.so)
CMake Error at cmake/Cuda.cmake:227 (message):
  cuDNN version >3 is required.

说明,已经安装cudnn,但是没找到版本号,手动添加版本号,#define CUDNN_MAJOR 5到文件,/usr/include/cudnn.h

问题3:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cublas_device_LIBRARY (ADVANCED)
    linked by target "caffe" in directory /media/sd/soft/caffe/src/caffe

解决办法:

升级Cmake版本可以解决。

CUDA_cublas_device_LIBRARY-NOTFOUND · Issue #22 · weigao95/surfelwarp (github.com)

升级途径:https://cmake.org/files/v3.22/cmake-3.22.1-linux-aarch64.sh

问题4:Caffe installation on Xavier - Jetson & Embedded Systems / Jetson AGX Xavier - NVIDIA Developer Forums

makefile.config 配置,参考上面链接

## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!

# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1

# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1

# uncomment to disable IO dependencies and corresponding data layers
# USE_OPENCV := 0
# USE_LEVELDB := 0
# USE_LMDB := 0
# This code is taken from https://github.com/sh1r0/caffe-android-lib
# USE_HDF5 := 0

# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
#	You should not set this flag if you will be reading LMDBs with any
#	possibility of simultaneous read and write
# ALLOW_LMDB_NOLOCK := 1

# Uncomment if you're using OpenCV 3
 OPENCV_VERSION := 3

# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++

# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr

# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
# For CUDA >= 9.0, comment the *_20 and *_21 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_72,code=sm_72 \
               -gencode arch=compute_72,code=compute_72

# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := atlas
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas

# Homebrew puts openblas in a directory that is not on the standard search path
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
# BLAS_LIB := $(shell brew --prefix openblas)/lib

# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
# MATLAB_DIR := /usr/local
# MATLAB_DIR := /Applications/MATLAB_R2012b.app

# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
		/usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
# ANACONDA_HOME := $(HOME)/anaconda
# PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
		# $(ANACONDA_HOME)/include/python2.7 \
		# $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include

# Uncomment to use Python 3 (default is Python 2)
# PYTHON_LIBRARIES := boost_python3 python3.5m
# PYTHON_INCLUDE := /usr/include/python3.5m \
#                 /usr/lib/python3.5/dist-packages/numpy/core/include

# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib
# PYTHON_LIB := $(ANACONDA_HOME)/lib

# Homebrew installs numpy in a non standard path (keg only)
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib

# Uncomment to support layers written in Python (will link against Python libs)
# WITH_PYTHON_LAYER := 1

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib

# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
# INCLUDE_DIRS += $(shell brew --prefix)/include
# LIBRARY_DIRS += $(shell brew --prefix)/lib

# NCCL acceleration switch (uncomment to build with NCCL)
# https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0)
# USE_NCCL := 1

# Uncomment to use `pkg-config` to specify OpenCV library paths.
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
# USE_PKG_CONFIG := 1

# N.B. both build and distribute dirs are cleared on `make clean`
BUILD_DIR := build
DISTRIBUTE_DIR := distribute

# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1

# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0

# enable pretty build (comment to see full commands)
Q ?= @

问题5:error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope    int cv_read_flag = (is_color ? CV_LOA

.原来是说,旧版的声明已经没了,但是我可以在constants_c.h 这个头文件中获得,那么根据他的操作来吧。
同样,在使用了CV_LOAD_IMAGE_COLOR这个定义的c文件下,添加头文件:

#include "opencv2/imgcodecs/legacy/constants_c.h"
————————————————
版权声明:本文为CSDN博主「wx_polish」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:SLAM十四讲,第七章程序ch7报错, error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope_XXX的博客-CSDN博客_cv_load_image_color

GPD部分

问题1:c++: error: unrecognized command line option ‘-msse4.2’

解决办法cmake将

you have to disable -msse option in Cmake configuration. ARM processor of JETSON does not support SSE instructions.

问题2:不支持sse编译

c++ - using cmake to make a library without sse support (windows version) - Stack Overflow

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值