NVIDIA-ISAAC-ROS / isaac_ros_visual_slam

Visual SLAM/odometry package based on NVIDIA-accelerated cuVSLAM
https://developer.nvidia.com/isaac-ros-gems
Apache License 2.0
819 stars 127 forks source link

Installation on x86_64 #26

Closed ShuoYangRobotics closed 2 years ago

ShuoYangRobotics commented 2 years ago

Hi I am trying to install the software on a x86_64 machine. But I encountered compilation errors

--- stderr: isaac_ros_image_proc      
In file included from /home/ubuntu/isaac_perception_ws/src/isaac_ros_image_pipeline/isaac_ros_image_proc/src/image_format_converter_node.cpp:33:
/home/ubuntu/isaac_perception_ws/src/isaac_ros_image_pipeline/isaac_ros_image_proc/src/image_format_converter_node.cpp: In function ‘cv::Mat {anonymous}::GetConvertedMat(VPIImageImpl*&, VPIImageImpl*&, VPIStreamImpl*&, const cv::Mat&, uint32_t, std::string, std::string)’:
/home/ubuntu/isaac_perception_ws/src/isaac_ros_image_pipeline/isaac_ros_image_proc/src/image_format_converter_node.cpp:68:5: error: ‘vpiImageCreateOpenCVMatWrapper’ was not declared in this scope; did you mean ‘vpiImageCreateWrapper’?
   68 |     vpiImageCreateOpenCVMatWrapper(
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/isaac_perception_ws/install/isaac_ros_common/include/isaac_ros_common/vpi_utilities.hpp:20:25: note: in definition of macro ‘CHECK_STATUS’
   20 |     VPIStatus status = (STMT); \
      |                         ^~~~
/home/ubuntu/isaac_perception_ws/src/isaac_ros_image_pipeline/isaac_ros_image_proc/src/image_format_converter_node.cpp:81:61: error: too many arguments to function ‘VPIStatus vpiImageLock(VPIImage, VPILockMode)’
   81 |   CHECK_STATUS(vpiImageLock(output, VPI_LOCK_READ, &out_data));
      |                                                             ^
/home/ubuntu/isaac_perception_ws/install/isaac_ros_common/include/isaac_ros_common/vpi_utilities.hpp:20:25: note: in definition of macro ‘CHECK_STATUS’
   20 |     VPIStatus status = (STMT); \
      |                         ^~~~
In file included from /home/ubuntu/isaac_perception_ws/src/isaac_ros_image_pipeline/isaac_ros_image_proc/src/image_format_converter_node.cpp:28:
/opt/nvidia/vpi2/include/vpi/Image.h:556:22: note: declared here
  556 | VPI_PUBLIC VPIStatus vpiImageLock(VPIImage img, VPILockMode mode);
      |                      ^~~~~~~~~~~~
/home/ubuntu/isaac_perception_ws/src/isaac_ros_image_pipeline/isaac_ros_image_proc/src/image_format_converter_node.cpp:82:31: error: ‘VPIImageData’ {aka ‘struct VPIImageDataRec’} has no member named ‘planes’
   82 |   cv::Mat output_mat{out_data.planes[0].height, out_data.planes[0].width,
      |                               ^~~~~~
/home/ubuntu/isaac_perception_ws/src/isaac_ros_image_pipeline/isaac_ros_image_proc/src/image_format_converter_node.cpp:82:58: error: ‘VPIImageData’ {aka ‘struct VPIImageDataRec’} has no member named ‘planes’
   82 |   cv::Mat output_mat{out_data.planes[0].height, out_data.planes[0].width,
      |                                                          ^~~~~~
/home/ubuntu/isaac_perception_ws/src/isaac_ros_image_pipeline/isaac_ros_image_proc/src/image_format_converter_node.cpp:83:54: error: ‘VPIImageData’ {aka ‘struct VPIImageDataRec’} has no member named ‘planes’
   83 |     g_str_to_channels.at(encoding_desired), out_data.planes[0].data,
      |                                                      ^~~~~~
/home/ubuntu/isaac_perception_ws/src/isaac_ros_image_pipeline/isaac_ros_image_proc/src/image_format_converter_node.cpp:84:34: error: ‘VPIImageData’ {aka ‘struct VPIImageDataRec’} has no member named ‘planes’
   84 |     static_cast<size_t>(out_data.planes[0].pitchBytes)};
      |                                  ^~~~~~
/home/ubuntu/isaac_perception_ws/src/isaac_ros_image_pipeline/isaac_ros_image_proc/src/image_format_converter_node.cpp:84:55: error: no matching function for call to ‘cv::Mat::Mat(<brace-enclosed initializer list>)’
   84 |     static_cast<size_t>(out_data.planes[0].pitchBytes)};
      |                                                       ^
In file included from /usr/include/opencv4/opencv2/core/mat.hpp:3724,
                 from /usr/include/opencv4/opencv2/core.hpp:59,
                 from /usr/include/opencv4/opencv2/core/core.hpp:48,
                 from /opt/ros/foxy/include/cv_bridge/cv_bridge.h:43,
                 from /home/ubuntu/isaac_perception_ws/src/isaac_ros_image_pipeline/isaac_ros_image_proc/src/image_format_converter_node.cpp:20:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:1380:1: note: candidate: ‘cv::Mat::Mat(cv::Mat&&)’
 1380 | Mat::Mat(Mat&& m)
      | ^~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp:1380:1: note:   candidate expects 1 argument, 5 provided

It seems this software depends on a specific VPI version. Could you tell me what is a proper way to setup installation environment?

Currently I am using a Dockerfile based on nvidia/cuda:11.4.0-devel-ubuntu20.04 and install VPI libraries following https://docs.nvidia.com/vpi/installation.html

RUN apt-get update && apt-get install -y software-properties-common gnupg  && \
    apt-key adv --fetch-key https://repo.download.nvidia.com/jetson/jetson-ota-public.asc 
RUN add-apt-repository 'deb https://repo.download.nvidia.com/jetson/x86_64/focal r34.1 main' && \
    apt update && \
    apt-get install -y libnvvpi2 vpi2-dev vpi2-samples git-lfs

My Nvidia driver version is 510 but I think this issue is not related to GPU driver.

hemalshahNV commented 2 years ago

The error messages with VPI indicate you've install VPI2 and not VPI1.1 (the signatures for vpiImageCreateOpenCVMatWrapper has changes, etc.). You'll want to install the older VPI 1.1 which is what Isaac ROS packages are compatible with as of Early Access 3 (EA3).

hemalshahNV commented 2 years ago

In the Dockerfile.x86_64.base you'll find the correct vpi installation commands which use the VPI Debians packaged with isaac_ros_common itself.