Commit d5cf283a authored by wanghailong's avatar wanghailong

2D跟踪

parent 8fb40966
......@@ -836,13 +836,13 @@ void TrackingRos::ThreadTrackingProcess()
if (updateHId.find(iter.first) != updateHId.end() || updateLId.find(iter.first) != updateLId.end())
{
if(updateHId.find(iter.first) != updateHId.end())
obj = objsPtr->array[indexH[updateHId[iter.first]]];
obj = objsPtr->array[indexH[updateHId[iter.first]]]; //从检测结果里得到初始高分obj
if(updateLId.find(iter.first) != updateLId.end())
obj = objsPtr->array[indexL[updateLId[iter.first]]];
obj = objsPtr->array[indexL[updateLId[iter.first]]]; //从检测结果里得到初始低分obj
input_obj = obj;
obj.obj_id = iter.first;
std::vector<float> data;
if (iter.second->IsValid() && iter.second->GetStateData(data) == 0)
if (iter.second->IsValid() && iter.second->GetStateData(data) == 0) //初始obj更新跟踪的推理结果
{
is_need_send = 1;//需要发送
obj.x = data[0];
......@@ -866,16 +866,16 @@ void TrackingRos::ThreadTrackingProcess()
//obj.Long = pos[1];
//SDK_LOG(SDK_INFO, "lat = %.10f, lon = %.10f",obj.Lat,obj.Long);
}
if(iter.second->m_obj)
last_type = iter.second->m_obj->type;
iter.second->m_obj = std::make_shared<jfx_common_msgs::det_tracking>(obj);
// if(iter.second->m_obj)
// last_type = iter.second->m_obj->type;
iter.second->m_obj = std::make_shared<jfx_common_msgs::det_tracking>(obj); //不仅状态变量还有类型时间戳的m_obj数据更新(Tracker3D.h的智能指针)
}
else
else //未匹配但跟踪链未被删除
{
if(iter.second->m_obj)
obj = *(iter.second->m_obj);
std::vector<float> data;
if (iter.second->IsValid() && iter.second->GetStateData(data) == 0)
if (iter.second->IsValid() && iter.second->GetStateData(data) == 0) //跟踪链有效且获取到预测结果,初始obj更新跟踪的推理结果
{
is_need_send = 1;//需要发送
obj.x = data[0];
......
......@@ -10,7 +10,7 @@
#include "jfx_log.h"
#include "LogBase.h"
#include "TrackingRosEx.h"
//#include "TrackingRosEx_2D.h"
//using namespace jfx_vision;
//std::unique_ptr<VisionConfig> jfx_vision::g_visionConfig;
......
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