1、下载velocam_gazebo /calibration 项目源码
github网址:
https://github.com/beltransen/velo2cam_gazebo
https://github.com/beltransen/velo2cam_calibration/issues
速度慢或者访问异常,推荐国内gitee、gitcode 镜像;
2、编译平台及要求
ros notic opencv 3.4.15 opencv_contrib(3.4.15) opencv_app
推荐源码编译安装
catkin_ws/src 下编译启用;
3、编译异常处理:
1)、velo2cam_gazebo :
math::Pose pose; GitHub - beltransen/velo2cam_gazebo: Repository including Gazebo models, plugins and worlds to test calibration algorithms for Lidar-camera setups.中的issues#13,修改为#include <ignition/math/Vector3.hh>
ignition::math::Pose3d pose;和pose.Pos().X()
2)、编译后加载仿真模型:
roslaunch velo2cam_gazebo mono_hdl64_p1_real.launch gui:=true
模型强面、地板不正常,雷达及相机未找到;
(1)、github下载 .gazebo model;(2)、所有_spawn.urdf.xacro 模型文件中添加xacro:作用域符
<xacro:blackflys parent="base_footprint" name="$(arg cam_name)" hfov="$(arg hfov)" hz="$(arg hz)" noise="$(arg noise)">
<origin xyz="$(arg xyz)" rpy="$(arg rpy)"/>
<resolution>
<width>2048</width>
<height>1536</height>
</resolution>
</xacro:blackflys>
blackflys.urdf.xacro 文件中一样:
<xacro:monocular_sensor name="${name}" hfov="${hfov}" hz="${hz}" noise="${noise}">
<xacro:insert_block name="resolution" />
</xacro:monocular_sensor>
<gazebo reference="${name}_link">
<static>true</static>
<turnGravityOff>false</turnGravityOff>
</gazebo>
</xacro:macro>
其他velodyne_HDL64...等模型一样操作;
3)、velo2cam_calibration cmakelsit 设置C++17 编译标准
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -w ");
4)、PCL 1.12, 防止雷达点云分割失败;
5)、命令行
roslaunch velo2cam_calibration registration.launch sensor1_type:=mono sensor2_type:=lidar
roslaunch velo2cam_calibration mono_pattern.launch camera_name:=/blackflys image_topic:=image_raw frame_name:=blackflys
roslaunch velo2cam_calibration lidar_pattern.launch cloud_topic:=/hdl64_points
先让相机找到4个二维码maker,估算标定板圆心;
再调整雷达点云图 rosrun rqt_reconfigure rqt_reconfigure
使得雷达点云,只有标定板以及透过板映射在强上的四个圆;
6)、反复调整第5)步中,步骤,直至roslaunch velo2cam_calibration registration.launch sensor1_type:=mono sensor2_type:=lidar 命令行窗口启动标定;