启动流程总结 - wuyaxiezitai/OpenPTrack-notebook GitHub Wiki

内部校准

cd ~/workspace/ros/catkin/devel/lib/kinect2_bridge
sudo ./kinect2_bridge

创建存储图像的临时文件夹

mkdir ~/tmp

在终端运行

roslaunch kinect2_bridge kinect2_bridge.launch publish_frame:=true sensor_name:=kinect2

捕获彩色图像:

rosrun kinect2_calibration kinect2_calibration chess6x5x0.12 record color -path ~/tmp/

在传感器前不断移动棋盘的位置和角度,按空格键捕获帧。

校准内在函数:

rosrun kinect2_calibration kinect2_calibration chess6x5x0.12 calibrate color -path ~/tmp/

按同样的方法捕获红外和同步图像:

rosrun kinect2_calibration kinect2_calibration chess6x5x0.12 record ir -path ~/tmp/
rosrun kinect2_calibration kinect2_calibration chess6x5x0.12 calibrate ir -path ~/tmp/
rosrun kinect2_calibration kinect2_calibration chess6x5x0.12 record sync -path ~/tmp/
rosrun kinect2_calibration kinect2_calibration chess6x5x0.12 calibrate sync -path ~/tmp/

创建一个文件夹来保存数据:

roscd kinect2_bridge mkdir -p data/<serial>

进入新创建的目录,将文件从tmp文件夹中复制到新创建的文件夹中:

cp ~/tmp/calib_color.yaml ~/tmp/calib_ir.yaml ~/tmp/calib_pose.yaml

相机网络校准

在主控上运行:

roslaunch opt_calibration calibration_initializer.launch

并在每台主机(包括主控)上运行:

roslaunch opt_calibration listener.launch

执行多传感器校准,在主控上运行

roslaunch opt_calibration opt_calibration_master.launch

然后在每个主机(包括主控)上运行:

roslaunch opt_calibration sensor_<sensor_id>.launch 将棋盘放到地面上,要求至少又一个传感器能看到棋盘,运行以下命令保存所有校准数据:

rostopic pub /opt_calibration/action std_msgs/String "save" -1

然后运行:

roslaunch opt_calibration opt_calibration_master.launch

出现 ~/open_ptrack/opt_calibration/conf/camera_poses.yaml created! 这条语句是表示保存完成。

用Ctrl+c中止 roslaunch opt_calibration detection_initializer.launch 的进程。 用Ctrl+c中止所有主机上的 roslaunch opt_calibration listener.launch 进程。 将每台主机上的 detection/launch/camera_poses.txt 文件复制到 detection/launch 文件夹下,运行:

roslaunch opt_calibration detection_initializer.launch 

在每台主机(包括主控)上运行:

roslaunch opt_calibration listener.launch

人员跟踪

在单个摄像机上运行人员跟踪模块:

roslaunch tracking single_camera_tracking_node.launch enable_people_tracking:=true enable_object:=false enable_pose:=false sensor_type:=kinect2

命令运行之后,将自动打开Rviz窗口。单击Rviz左下方的添加按钮可以添加主题。具体操作详见<指南>

进行多传感器人员跟踪

在主控上运行:

roslaunch tracking tracking_node.launch enable_pose:=false enable_object:=false enable_people_tracking:=true

在每台主机上运行下面代码来存储当前的启动文件 detection_node_<sensor_id>.launch:

roslaunch detection detection_node_<sensor>.launch enable_pose:=false enable_object:=false enable_people_tracking:=true

运行跟踪节点后,将打开Rviz,在全局参考系中绘制人员的位置并显示摄像机参考系。

如果你想通过动态重新调整成像仪参数,运行:

rosrun rqt_reconfigure rqt_reconfigure  

成像仪参数的具体意义可以参考这里 GUI中的更改不会保存,必须在每个主机和传感器的相应文件中手动更新。部分文件地址如下:

ROSHOME/open_ptrack/detection/conf/ground_based_people_detector*.yaml
haar_disp_ada_detector.yaml.
⚠️ **GitHub.com Fallback** ⚠️