1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

R3liveの実行手順②(キャリブレーション編)

Last updated at Posted at 2024-08-20

この記事ではR3liveを実行する前に行うLiDARとカメラのキャリブレーションを行う方法について記載する。

使用するパッケージ

使用機器と対応するrosドライバー

・Livox Avia=Livox_ros_driver
・Blackfly S USB3=Spinnaker_camera_driver

今回の組み合わせの場合、上のパッケージが必要なので先にインストールを行う。

インストールに必要な各種パッケージのインストール

ROSの追加パッケージ

sudo apt-get install ros-XXX-cv-bridge ros-xxx-pcl-conversions

Ceres Solverのインストール

vasion 2.1.0推奨→コードが最新版に対応していない

ここからダウンロードできる
http://ceres-solver.org/version_history.html

sudo apt-get install cmake
sudo apt-get install libgoogle-glog-dev libgflags-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libsuitesparse-dev
#ダウンロードしたファイルを解凍する
cd (解凍したファイル)
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver-2.1.0
make -j3
make test
make install

Eigenのインストール

sudo apt install libeigen3-dev

PCLのインストール

以下のサイト等を参照する
https://qiita.com/tewi_r/items/941acb2af690f8f184a1

packageが揃ったのでビルド

cd ~/catkin_ws/src
git clone https://github.com/hku-mars/livox_camera_calib.git
cd ../
catkin_make
source ~/catkin_ws/devel/setup.bash

ビルドができたら次に画像ファイルと点群ファイルを用意する。
画像ファイル→jpeg,png形式など
点群ファイル→PCD形式
※livox社のLiDARの場合lvx形式で出力されるのでファイル拡張子の変換を行う必要がある。

キャリブレーションパラメータの設定

キャリブレーションを行うために

# データのパスを変更する
common:
    image_file: "/home/ycj/data/calib/image/0.png" 
    pcd_file: "/home/ycj/data/calib/pcd/0.pcd" 
    result_file: "/home/ycj/data/calib/extrinsic.txt"
    

# Camera Parameters. Adjust them!
#カメラのマトリックスパラメータを変更する
 勉強不足でよくわからない。。
 livox aviaの場合はr3liveの設定ファイルのものに合わせれば良い
camera:
    camera_matrix: [1364.45, 0.0,      958.327,
                0.0,     1366.46,  535.074,
                0.0,     0.0,      1.0     ]
    dist_coeffs: [0.0958277, -0.198233, -0.000147133, -0.000430056, 0.000000]

# Calibration Parameters.!
calib:
    calib_config_file: "/home/ycj/catkin_ws/src/livox_camera_calib/config/config_outdoor.yaml"
    use_rough_calib: true # set true if your initial_extrinsic is bad

キャリブレーションの実行

source ~/catkin_ws/devel/setup.bash
roslaunch livox_camera_calib calib.launch

結果が指定のファイル名、ファイルパスに出力される。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?