Commit bd2e078f authored by wanghailong's avatar wanghailong

2D跟踪

parent d5cf283a
This diff is collapsed.
#pragma once
#include <vector>
#include <mutex>
#include "BaseTracker.h"
#include "Track2D.h"
#ifdef _QICHECHENG_
#include "jfxrosperceiver/det_tracking_array.h"
#include "jfxrosperceiver/InferReses.h"
#define jfx_common_msgs jfxrosperceiver
#else
#include "jfx_common_msgs/det_tracking_array.h"
#endif
#include "SafeQueue.hpp"
//#include "TrackingMsg.h"
#include "ros/ros.h"
#include "coordinate_convert.h"
#include "TimeQueueObj.h"
using objTrackListPtr = std::shared_ptr<jfx_common_msgs::det_tracking_array>;
class TrackingRos
{
public:
// Constructor
TrackingRos() {}
~TrackingRos();
void TrackingCallBackFunc(const jfx_common_msgs::det_tracking_arrayConstPtr& msg);//接受ros发过来的消息
void TrackingCameraCallBackFunc(const jfx_common_msgs::InferResesConstPtr& msg);//接受camera发过来的消息
void Init(ros::NodeHandle& nh);
void ThreadTrackingProcess();
objTrackListPtr GetNearestCloudMsg(unsigned long long timestamp);
public:
SafeQueue<objTrackListPtr> m_objsQueue;
std::mutex m_mtx;
std::vector<objTrackListPtr> m_objsCloudQueue;
BaseTracker<Track2D> m_tracker;
bool m_isTrackingRun = false;//记录是否在运行
std::thread m_trackingThread;//运行事件线程
ros::Publisher m_pub;//发送所有物体信息的publisher
ros::Publisher m_pubCloud;//发送点云数据
ros::Publisher m_pubBoundingBoxes;//发送3D框信息
ros::Publisher m_pubMarker;//发送marker信息
ros::Publisher m_pubCameraFront;//发送前相机的图
ros::Publisher m_pubCameraRight;//发送右相机的图
ros::Publisher m_pubCameraLeft;//发送左相机的图
std::vector<std::vector<double>> m_trans;
std::vector<std::vector<double>> m_kitti2origin;
int m_frameNum = 0;
float m_lidar_x_angle = 0.0f;//修改rot_y的参数,从配置里读取
int m_recvMsgBit = 0b1111;//处理消息的类型
int m_detectCameraCarSize = 150;//处理相机汽车边长的最小限制
float m_lidar_camera_msg_iou = 0.01;//相机和雷达消息过滤用iou值
int m_camera_one_center_type = 0;//计算中心点坐标的配置,0是原来的配置,1,使用比例获取x值,2是比例取值并且用中心点坐标
int m_camera_cloud_merge_type = 0;//0是使用距离判断,1是使用iou判断
int m_camera_debug_type = 0;//调试相机类型是否修改为7,0是正常,1是调试为7
int m_right_left_camera_len = 15;//左右相机的显示距离米数
int m_right_left_camera_y_len = 7;//左右相机的过滤宽度米数
int m_front_camera_len = 0;//-前相机过滤的距离米数,0是不过滤,70就是过滤70米,但不过滤行人和机动车
int m_send_camera_image = 0;//是否发送相机图像,0是不发送,1是发送
float m_high_low_score = 0.5f;//high和low划分的置信度数值
void TimeQueueProcess(std::vector< TimeQueueDataPtr>& outs);
TimeQueueObj m_timeQueue;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment