4.10.2 radar2lidar标定

4.10.2 radar2lidar标定

欢迎关注我的B站:https://space.bilibili.com/379384819

欢迎交流学习,vx:18074116692

参考教程:

AbangLZU/SensorsCalibration: OpenCalib: A Multi-sensor Calibration Toolbox for Autonomous Driving (github.com)

1. 查看系统环境

要运行本仿真程序,需要保证当前环境为ubuntu20.04+ros-noetic-desktop-full

查看ubuntu版本:

rosnoetic@rosnoetic-VirtualBox:~$ lsb_release -a

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal

可知,当前ubuntu版本满足20.04

查看ros版本:

rosnoetic@rosnoetic-VirtualBox:~$ rosversion -d

noetic

可知,当前ros版本满足noetic

2. 安装radar2lidar校准

2.1 安装Pangolin

ctrl+alt+T打开终端,安装依赖

rosnoetic@rosnoetic-VirtualBox:~$ sudo apt-get install libglew-dev

Pangolin-0.6.zip移动到主目录下

点击Pangolin-0.6.zip,右键,选择“提取到此处

cmake编译:

rosnoetic@rosnoetic-VirtualBox:~$ cd Pangolin-0.6/

rosnoetic@rosnoetic-VirtualBox:~/Pangolin-0.6$ mkdir build

rosnoetic@rosnoetic-VirtualBox:~/Pangolin-0.6$ cd build/

rosnoetic@rosnoetic-VirtualBox:~/Pangolin-0.6/build$ cmake ..

  • cmake ..

rosnoetic@rosnoetic-VirtualBox:~/Pangolin-0.6/build$ make -j4

  • make -j4

rosnoetic@rosnoetic-VirtualBox:~/Pangolin-0.6/build$ sudo make install

  • sudo make install

2.2 安装源码

ctrl+alt+T安装json库,并链接到/usr/include/json路径:

rosnoetic@rosnoetic-VirtualBox:~$ sudo apt-get install libjsoncpp-dev 

rosnoetic@rosnoetic-VirtualBox:~$ sudo ln -s /usr/include/jsoncpp/json/ /usr/include/json

ctrl+alt+T打开终端,执行如下指令下载源码:

rosnoetic@rosnoetic-VirtualBox:~$ git clone https://github.com/AbangLZU/SensorsCalibration.git

修改SensorsCalibration/radar2lidar/manual_calib/CMakeLists.txt,添加代码:set( CMAKE_CXX_STANDARD 14)

cmake_minimum_required(VERSION 2.8.3)
project(RadarToLidar)
set(CMAKE_CXX_FLAGS "-std=c++11 -g -Wall")

set( CMAKE_CXX_STANDARD 14)

find_package(Pangolin REQUIRED)
include_directories(${Pangolin_INCLUDE_DIRS})
link_directories(${Pangolin_LIBRARY_DIRS})

find_package(PCL REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${OpenCV_LIBRARY_DIRS})

find_package(Boost REQUIRED system)
find_package(OpenCV REQUIRED)

include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(${EIGEN_ROOT})
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${PROJECT_SOURCE_DIR}/src)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)

file(GLOB_RECURSE PARSER_PATH src/*.cpp)
add_library(${PROJECT_NAME} STATIC ${PARSER_PATH})
target_link_libraries(${PROJECT_NAME} libjsoncpp.a ${OpenCV_LIBS} ${Boost_SYSTEM_LIBRARY})

add_executable(run_radar2lidar src/run_radar2lidar.cpp)
target_link_libraries(run_radar2lidar ${PROJECT_NAME})
target_link_libraries(run_radar2lidar ${PCL_LIBRARIES})
target_link_libraries(run_radar2lidar ${Pangolin_LIBRARIES})

cmake编译:

rosnoetic@rosnoetic-VirtualBox:~$ cd SensorsCalibration/radar2lidar/manual_calib/

rosnoetic@rosnoetic-VirtualBox:~/SensorsCalibration/radar2lidar/manual_calib$ mkdir build

rosnoetic@rosnoetic-VirtualBox:~/SensorsCalibration/radar2lidar/manual_calib$ cd build/

rosnoetic@rosnoetic-VirtualBox:~/SensorsCalibration/radar2lidar/manual_calib/build$ cmake ..

  • cmake ..

rosnoetic@rosnoetic-VirtualBox:~/SensorsCalibration/radar2lidar/manual_calib/build$ make

  • make

3. 运行

ctrl+alt+T打开终端,执行如下指令:

rosnoetic@rosnoetic-VirtualBox:~$ cd SensorsCalibration/radar2lidar/manual_calib/

rosnoetic@rosnoetic-VirtualBox:~/SensorsCalibration/radar2lidar/manual_calib$ ./bin/run_radar2lidar data/lidar.pcd data/front_radar.csv data/front_radar-to-top_center_lidar-extrinsic.json 

点击左侧的按钮,即可调整相应的参数,点击Save Image保存参数

保存的参数将在manual_calib文件夹下。

posted on 2024-07-31 22:04  守望者与托养者  阅读(18)  评论(0编辑  收藏  举报