获取r3live_config.yaml中相机逆矩阵参数,
先要条件,livox时间对齐到系统时间,使用ptp软件同步
sudo apt install ptpd
sudo ptpd -M -i wlan0 -C
启动命令开机自启 修改/etc/rc.local
把开机要执行的命令放到exit0 前
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
ptpd -M -i eno1 &
#或者:
#ptp4l -i eno1 -l 6 &
#其中 & 是ubuntu命令后台运行; -C是前台运行, 可以根据ptpd -h来查看
exit 0
输出:Now in state: PTP_MASTER, Best master说明同步成功。
验证是否时间同步成功:
网络时间Unix 时间戳https://shijianchuo.net/
订阅livox/imu显示时间进行对比
或者
在livox viewer上位机中查看sync state
如果有硬件时钟最好还是使用硬件时钟
查看是否支持硬件时钟
ethtool -Y eth0
得到如下则正常,需要PTP Hardware Clock处有0 or 1
使用港科大标定方式
GitHub - hku-mars/livox_camera_calib
标定过程 录包→转pcd→标定
录包
roslaunch realsense2_camere rs_camera.launch
roslaunch livox_ros_driver2 rviz_MID360.launch
rosbag recorde /livox/lidar /camera/color/image_raw
rqt_image_view 保存标定用的图片
转pcd
roslaunch livox_camera_calib bag_to_pcd.launch
用到的launch文件 bag_to_pcd.launch ,需要修改bag路径 转换成的pcd路径
标定
需要修改参数文件 calib.yaml中相机内参矩阵和畸变系数以及调用照片、pcd路径
查看相机内参矩阵和畸变系数
rostopic echo /camera/color/camera_info
修改config_indoor.yaml内的话题名称
修改launch文件内调用的yaml文件开始标定
roslaunch livox_camera_calib calib.launch
开始标定,有点慢,要等一下,然后会自动跳出很多个窗口。
标定完成后会生成extrinsic.txt文件。对标定结果进行求逆
在线矩阵求逆
求逆结果放入r3live_bag.launch中。左上角3X3放在 camera_ext_R,第四列1X4的前三行放在camera_ext_t。注意修改相机内参,以及畸变参数。
修改完成可以运行r3live
参考
https://blog.csdn.net/weixin_42088912/article/details/116502203
https://blog.csdn.net/weixin_42803820/article/details/124174073