Ubuntu16.04在安装librealsense(D435i),在执行cmake ../和cmake ../ -DBUILD_EXAMPLES=true编译时报错,报错信息如下:
-- Building with TM2
CMake Error at third-party/libtm/fw/CMakeLists.txt:22 (file):
file DOWNLOAD HASH mismatch
for file: [/home/user/librealsense/build/third-party/libtm/fw/target-0.0.18.6100.mvcmd]
expected hash: [858b786215ff66cf8cf93fa85393ca6268dedee4]
actual hash: [da39a3ee5e6b4b0d3255bfef95601890afd80709]
status: [7;"Couldn't connect to server"]
Call Stack (most recent call first):
third-party/libtm/fw/CMakeLists.txt:47 (target_binary)
CMake Error at third-party/libtm/fw/CMakeLists.txt:22 (file):
file DOWNLOAD HASH mismatch
for file: [/home/user/librealsense/build/third-party/libtm/fw/central_app-2.0.19.271.bin]
expected hash: [cab0011e9e18edc8bcca20afb2f944399ac8b81c]
actual hash: [da39a3ee5e6b4b0d3255bfef95601890afd80709]
status: [7;"Couldn't connect to server"]
Call Stack (most recent call first):
third-party/libtm/fw/CMakeLists.txt:48 (target_binary)
CMake Error at third-party/libtm/fw/CMakeLists.txt:22 (file):
file DOWNLOAD HASH mismatch
for file: [/home/user/librealsense/build/third-party/libtm/fw/central_bl-1.0.1.112.bin]
expected hash: [d8fb5ba6f7029a3c950bf6b1ef5715efd880ef66]
actual hash: [da39a3ee5e6b4b0d3255bfef95601890afd80709]
status: [7;"Couldn't connect to server"]
Call Stack (most recent call first):
third-party/libtm/fw/CMakeLists.txt:49 (target_binary)
-- Fetching recommended firmwares:
-- D4XX_FW_VERSION: 5.11.6.250
-- SR3XX_FW_VERSION: 3.26.1.0
执行到此处,停在这里不再继续....
问题原因分析:
根据上述错误信息提示,打开CMakeLists.txt,定位到12~14行:
set( FW_URL "http://realsense-hw-public.s3.amazonaws.com/Releases/TM2/FW/target")
set(APP_URL "http://realsense-hw-public.s3.amazonaws.com/Releases/TM2/FW/app")
set( BL_URL "http://realsense-hw-public.s3.amazonaws.com/Releases/TM2/FW/bl")
及47~49行:
target_binary( "${FW_URL}" "${FW_VERSION}" "${FW_SHA1}" target .mvcmd)
target_binary("${APP_URL}" "${APP_VERSION}" "${APP_SHA1}" central_app .bin)
target_binary( "${BL_URL}" "${BL_VERSION}" "${BL_SHA1}" central_bl .bin)
发现应该是http://realsense-hw-public.s3.amazonaws.com/Releases无法访问导致的。
经过多次打开和关闭上述网址的链接测试,发现确认如此。
正确执行步骤:
1) sudo apt update
2) mkdir build && cd build
3) 确定可以链接至http://realsense-hw-public.s3.amazonaws.com/Releases
4) 执行cmake ../和cmake ../ -DBUILD_EXAMPLES=true
一次执行成功!
执行成功后的信息如下:
-- Building with TM2
-- Download TM2 firmware 0;"No error" for target-0.0.18.6100.mvcmd
-- Download TM2 firmware 0;"No error" for central_app-2.0.19.271.bin
-- Download TM2 firmware 0;"No error" for central_bl-1.0.1.112.bin
-- Fetching recommended firmwares:
-- D4XX_FW_VERSION: 5.11.6.250
-- SR3XX_FW_VERSION: 3.26.1.0
-- Download firmware 0;"No error" for D4XX_FW_Image-5.11.6.250.bin
-- Download firmware 0;"No error" for SR3XX_FW_Image-3.26.1.0.bin
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/librealsense/build
注意上述解决办法只有在可以链接至http://realsense-hw-public.s3.amazonaws.com/Releases时才有效,如果无法链接s3.amazonaws.com则此方法无效。