Commit e0aa98cb authored by oscar's avatar oscar

提交多线程运行http连接。

parent ca8a2f7b
......@@ -241,7 +241,22 @@ int EventsRos::Start()
#if defined(_ROS_XISHAN_) || defined(_ROS_HEFEI_R_) || defined(_ROS_HEFEI_L_)
SendRosEvents(outs);
#else
SendEventsCb(outs);
//SendEventsCb(outs);
std::thread tmp(&EventsRos::SendEventsCb, this, outs);
tmp.detach();
static int countCb = 0;
countCb++;
static uint64_t countBeginCb = 0;
if (countBeginCb == 0)
countBeginCb = GetCurTime();
if (GetCurTime() - countBeginCb > 3000 * 1000)
{
SDK_LOG(SDK_INFO, "SendEventsCb count = %d, average rate = %f",
countCb, (float)countCb / 3);
//SDK_LOG(SDK_INFO, "recv camera msg count = %d, average rate = %f", countC, (float)countC / 3);
countBeginCb = GetCurTime();
countCb = 0;
}
#endif
});
......@@ -394,7 +409,7 @@ void EventsRos::SendRosEvents(TrkObjsPtr& outs)
}
void EventsRos::SendEventsCb(TrkObjsPtr& outs)
void EventsRos::SendEventsCb(TrkObjsPtr outs)
{
for (auto& iter : outs->objs)
{
......
......@@ -46,7 +46,7 @@ public:
int Start();
void SendEventsCb(TrkObjsPtr& outs);//发送event事件的函数
void SendEventsCb(TrkObjsPtr outs);//发送event事件的函数
void SendRosEvents(TrkObjsPtr& outs);//发送event事件的函数
JfxEvents m_jfx_events;//event处理对象
......
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