Commit abf8c4ff authored by oscar's avatar oscar

提交数据结构变动

parent 1064a249
......@@ -14,19 +14,10 @@ enum class QueueDataEnum //数据类型的枚举
struct TimeQueueData
{
TimeQueueData()
{
}
~TimeQueueData()
{
}
uint64_t timestamp = 0;//排序的时间
QueueDataEnum dataType = QueueDataEnum::QD_NONE;//数据类型
union UserData{
jfx_common_msgs::det_tracking_array detArray;
jfx_common_msgs::InferReses infRes;
};
UserData data;
std::shared_ptr<jfx_common_msgs::det_tracking_array> detArray = nullptr;
std::shared_ptr<jfx_common_msgs::InferReses> infReses = nullptr;
};
......@@ -400,15 +400,15 @@ void TrackingRos::Init(ros::NodeHandle& nh)
}
void TrackingRos::TimeQueueProcess(std::vector< TimeQueueDataPtr>& outs)
{
jfx_common_msgs::det_tracking_array* cloudPtr = nullptr;
jfx_common_msgs::InferReses* msg = nullptr;
objTrackListPtr cloudPtr = nullptr;
std::shared_ptr <jfx_common_msgs::InferReses> msg = nullptr;
uint64_t timestamp = 0;
for (auto iter : outs)
{
if (iter->dataType == QueueDataEnum::QD_DET_TRACKING_ARRAY)
cloudPtr = &(iter->data.detArray);
cloudPtr = iter->detArray;
if (iter->dataType == QueueDataEnum::QD_INFERRESES)
msg = &(iter->data.infRes);
msg = iter->infReses;
}
if (cloudPtr)
{
......@@ -647,13 +647,15 @@ void TrackingRos::TimeQueueProcess(std::vector< TimeQueueDataPtr>& outs)
void TrackingRos::TrackingCallBackFunc(const jfx_common_msgs::det_tracking_arrayConstPtr& msg)//接受ros发过来的消息
{
objTrackListPtr objsPtr = std::make_shared<jfx_common_msgs::det_tracking_array>();
objsPtr->array = msg->array;
objsPtr->cloud = msg->cloud;
TimeQueueDataPtr tqdPtr = std::make_shared<TimeQueueData>();
//objTrackListPtr objsPtr = std::make_shared<jfx_common_msgs::det_tracking_array>();
tqdPtr->dataType = QueueDataEnum::QD_DET_TRACKING_ARRAY;
tqdPtr->data.detArray.array = msg->array;
tqdPtr->data.detArray.cloud = msg->cloud;
tqdPtr->detArray = objsPtr;
tqdPtr->timestamp = (unsigned long long)msg->cloud.header.stamp.sec * 1000000 + (unsigned long long)msg->cloud.header.stamp.nsec * 1e-3;
tqdPtr->timestamp = (unsigned long long)msg->cloud.header.stamp.sec * 1000000 + (unsigned long long)msg->cloud.header.stamp.nsec * 1e-3 + 100;
//SDK_LOG(SDK_INFO, "TrackingCallBackFunc msg->header.stamp.sec = %d,msg->header.stamp.nsec = %d time = %llu", msg->cloud.header.stamp.sec, msg->cloud.header.stamp.nsec, timestamp);
m_timeQueue.PushQueueData(tqdPtr);
......@@ -696,10 +698,13 @@ void TrackingRos::TrackingCameraCallBackFunc(const jfx_common_msgs::InferResesCo
countBeginC = GetCurTime();
countC = 0;
}
std::shared_ptr<jfx_common_msgs::InferReses> msgPtr = std::make_shared<jfx_common_msgs::InferReses>();
*msgPtr = *msg;
TimeQueueDataPtr tqdPtr = std::make_shared<TimeQueueData>();
tqdPtr->dataType = QueueDataEnum::QD_INFERRESES;
tqdPtr->timestamp = (unsigned long long)msg->header.stamp.sec * 1000 + (unsigned long long)msg->header.stamp.nsec * 1e-6;
tqdPtr->data.infRes = *msg;
tqdPtr->infReses = msgPtr;
m_timeQueue.PushQueueData(tqdPtr);
//SDK_LOG(SDK_INFO, "msg msg->header.stamp.sec = %d,msg->header.stamp.nsec = %d time = %llu", msg->header.stamp.sec, msg->header.stamp.nsec, timestamp);
......
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