Ubuntu运行Realsense--rs-trajectory示例

说明

本实例需要Intel T265,Ubuntu下安装Librealsense。

安装OpenGL开发环境

## 编译工具gcc
sudo apt-get install build-essential
## OpenGL基本库
sudo apt-get install libglfw3-dev
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libglu1-mesa-dev

## 或者执行合并安装命令
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev

运行rs-trajectory示例程序

  • 安装OpenGL开发环境
  • 修改CMakeLists.txt如下:
cmake_minimum_required(VERSION 3.1.0)

project(RealsenseExamplesTrajectory)

find_package(OpenGL REQUIRED)
set(DEPENDENCIES realsense2 glfw ${OPENGL_LIBRARIES})
set(BUILD_GRAPHICAL_EXAMPLES True)
set(LZ4_DIR "../../third-party/realsense-file/lz4")

if(BUILD_GRAPHICAL_EXAMPLES)
    add_executable(rs-trajectory rs-trajectory.cpp ../example.hpp ../../common/res/t265.h ${LZ4_DIR}/lz4.c)
    set_property(TARGET rs-trajectory PROPERTY CXX_STANDARD 11)
    target_link_libraries(rs-trajectory ${DEPENDENCIES})
    include_directories(../ ../../common/res ${LZ4_DIR})
    # set_target_properties (rs-trajectory PROPERTIES FOLDER Examples)
    # install(TARGETS rs-trajectory RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

  • 编译
# 在示例文件下
mkdir build && cd build
cmake ..
make
./rs-trajectory

你可能感兴趣的:(Ubuntu运行Realsense--rs-trajectory示例)