Commit 30bc2a31 authored by haoshuang's avatar haoshuang

定义地图为static对象

parent 820494d5
......@@ -14,7 +14,7 @@ lon 现实1mi大概是lon的0.0000038337=3.8e-6
const double lat_dt = 5e-6;
const double lon_dt = 5e-6;
jf::MapInterface JfxEvents::m_OfflineMap;
JfxEvents::JfxEvents()
{
}
......@@ -55,8 +55,9 @@ void JfxEvents::Init(std::string map_path, std::string map_dir,std::string map_c
//m_OfflineMap.reset(new jf::MapInterface(dir, m_cfg.map_cfg));
dir = map_path + map_dir;
SDK_LOG(SDK_INFO, "dir = %s, cfg = %s", dir.c_str(), map_cfg.c_str());
m_OfflineMap.reset(new jf::MapInterface());
m_OfflineMap->Init(dir,map_cfg);
//m_OfflineMap.reset(new jf::MapInterface());
//m_OfflineMap->Init(dir,map_cfg);
m_OfflineMap.Init(dir,map_cfg);
m_Queue.set_max_num_items(1);
m_sendQueue.set_max_num_items(10);
......@@ -217,7 +218,8 @@ int JfxEvents::CalculateMap(ObjInfoAll& objAll, TrkObj& sendObj)
std::vector<long> vctlOutNxtRoadId;
//ROS_INFO("begin call jfxmap");
bool result = m_OfflineMap->GetMapData(ptInLoc, dCarAngle, lOutRaodId, vctlOutPreRoadId, vctlOutNxtRoadId,
//bool result = m_OfflineMap->GetMapData(ptInLoc, dCarAngle, lOutRaodId, vctlOutPreRoadId, vctlOutNxtRoadId,
bool result = m_OfflineMap.GetMapData(ptInLoc, dCarAngle, lOutRaodId, vctlOutPreRoadId, vctlOutNxtRoadId,
nLaneCnt, nOutLaneNum, nOutLaneType,
nOutLeftEdgeCrossType, nOutRightEdgeCrossType,
nOutSpeedLimit, dOutLaneAngle, ptOutFoot);
......
......@@ -238,7 +238,8 @@ public:
int m_frameNum = 0;
uint64_t m_curTime = 0;//记录当前帧的时间
std::unique_ptr<jf::MapInterface> m_OfflineMap;
//std::unique_ptr<jf::MapInterface> m_OfflineMap;
static jf::MapInterface m_OfflineMap;
std::mutex m_sendMtx;
SendEventProcessCallback m_sendCb = nullptr;
......
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