三维重建&&路径规划(二)
一、Fast planner在Ubuntu20.04(ROS noetic)上的实现
二、Ubuntu18.04(ros-melocdic )驱动 Azure Kinect DK 相机
安装步骤
1.源码下载
git clone https://github.com/microsoft/Azure-Kinect-Sensor-SDK
2.编译过程
cd Azure-Kinect-Sensor-SDK/
mkdir build && cd build
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/ubuntu/18.04/prod
sudo apt-get update
sudo apt install libk4a1.4
sudo apt install libk4a1.4-dev
sudo apt install k4a-tools
cmake .. -GNinja
此时可能会出现如下错误:
-- Setting build type to 'RelWithDebInfo' as none was specified.
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/j/Azure-Kinect-Sensor-SDK/build/CMakeFiles/CMakeOutput.log".
这个是因为没有安装ninja导致的。安装ninjia
sudo apt install ninja-build
继续编译:
cmake .. -GNinja
ninja
出错:
ninja: error: 'LIBSOUNDIO_LIB-NOTFOUND', needed by 'bin/k4aviewer', missing and no known rule to make it
看错误是因为缺少libsoundio-dev库,所以安装库:
sudo apt install libsoundio-dev
重新编译继续安装:
cmake .. -GNinja
ninja
还有错误:
./extern/libusb/src/libusb/os/linux_udev.c:40:10: fatal error: libudev.h: 没有那个文件或目录
#include <libudev.h>
^~~~~~~~~~~
compilation terminated.
[252/467] Building C object extern/lib...bUSB.dir/src/libusb/os/linux_usbfs.c.o
../extern/libusb/src/libusb/os/linux_usbfs.c: In function ‘linux_get_parent_info’:
../extern/libusb/src/libusb/os/linux_usbfs.c:1081:9: warning: implicit declaration of function ‘asprintf’; did you mean ‘vsprintf’? [-Wimplicit-function-declaration]
ret = asprintf (&parent_sysfs_dir, "usb%s", tmp);
^~~~~~~~
vsprintf
[256/467] Building CXX object tests/Un...iles/depthmcu_ut.dir/depthmcu_ut.cpp.o
ninja: build stopped: subcommand failed.
还是因为缺少库文件,继续装库:
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libudev-dev
继续编译:
ninja
看到了这一行,说明编译成功了
[467/467] Linking CXX executable bin/k4aviewer
这个时候连接相机,输入命令进入SDK:
sudo ./bin/k4aviewer
可能会出现如下错误和情况:
if you unplugged the device,you must close and reopen the device
新开一个终端输入:
cd /usr/lib/x86_64-linux-gnu/libk4a1.4
sudo cp libdepthengine.so.2.0 /usr/lib/x86_64-linux-gnu
然后在原来的终端中重新输入:
./bin/k4aviewer
问题解决