Commit fe14b68f authored by haoshuang's avatar haoshuang

初始化地图防到最前面

parent b89ab227
......@@ -41,7 +41,14 @@ int EventsRos::loadConfig(ros::NodeHandle& nh)
nh.param<std::string>("unittest_yaml", config_yaml, "");
m_config = YAML::LoadFile(config_yaml);
}
//map init
SDK_LOG(SDK_INFO, "EventsRos::loadConfig-InitMap");
string map_path = m_root_dir;
string map_dir = m_config["pro_dir"].as<std::string>();
string map_cfg = m_config["map_cfg"].as<std::string>();
m_jfx_events.Init(map_path,map_dir,map_cfg);
SDK_LOG(SDK_INFO, "EventsRos::loadConfig-InitMap end");
//map init end
EventsConfig& config = m_jfx_events.m_cfg;
m_devNo = m_config["devNo"].as<std::string>();
//nh.param<std::string>("devNo", m_devNo, "none");
......@@ -305,8 +312,8 @@ int EventsRos::Start()
}
#endif
});
m_jfx_events.Init();
//stop !!!
//m_jfx_events.Init();
return 0;
}
......
......@@ -48,11 +48,14 @@ void JfxEvents::SetEventsCallback(SendEventProcessCallback cb)
std::lock_guard<std::mutex> lock(m_sendMtx);
m_sendCb = cb;
}
void JfxEvents::Init()
void JfxEvents::Init(std::string map_path, std::string map_dir,std::string map_cfg)
{
std::string dir = m_cfg.pro_path + m_cfg.pro_dir;
SDK_LOG(SDK_INFO, "m_cfg.pro_dir = %s, m_cfg.map_cfg- = %s", dir.c_str(), m_cfg.map_cfg.c_str());
m_OfflineMap.reset(new jf::MapInterface(dir, m_cfg.map_cfg));
//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(dir, map_cfg));
m_Queue.set_max_num_items(1);
m_sendQueue.set_max_num_items(10);
......
......@@ -198,7 +198,7 @@ public:
JfxEvents();
~JfxEvents();
void Init();
void Init(std::string map_path, std::string map_dir,std::string map_cfg);
void PushEventInfos(TrkObjsPtr& inputs);
......@@ -273,4 +273,4 @@ public:
//无路口车道,记录总的数量
TrafficJam m_totelTrafficJam;
};
\ No newline at end of file
};
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