Commit ac10d6e4 authored by oscar's avatar oscar

修改地图加载时传入csv文件,没有就用原来的接口。

parent 30bc2a31
......@@ -46,7 +46,10 @@ int EventsRos::loadConfig(ros::NodeHandle& nh)
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);
string cross_csv;
if(m_config["road_cross_csv"])
cross_csv = m_config["road_cross_csv"].as<std::string>();
m_jfx_events.Init(map_path,map_dir,map_cfg,cross_csv);
SDK_LOG(SDK_INFO, "EventsRos::loadConfig-InitMap end");
//map init end
EventsConfig& config = m_jfx_events.m_cfg;
......
......@@ -48,16 +48,25 @@ void JfxEvents::SetEventsCallback(SendEventProcessCallback cb)
std::lock_guard<std::mutex> lock(m_sendMtx);
m_sendCb = cb;
}
void JfxEvents::Init(std::string map_path, std::string map_dir,std::string map_cfg)
void JfxEvents::Init(std::string map_path, std::string map_dir,std::string map_cfg,std::string cross_csv)
{
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));
dir = map_path + map_dir;
SDK_LOG(SDK_INFO, "dir = %s, cfg = %s", dir.c_str(), map_cfg.c_str());
if(cross_csv.empty())
{
SDK_LOG(SDK_INFO, "dir = %s, cfg = %s", dir.c_str(), map_cfg.c_str());
m_OfflineMap.Init(dir,map_cfg);
}
else
{
// std::string csv = map_path + cross_csv;
SDK_LOG(SDK_INFO, "dir = %s, cfg = %s,csv = %s", dir.c_str(), map_cfg.c_str(),cross_csv.c_str());
m_OfflineMap.Init(dir,map_cfg,cross_csv);
}
//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);
......
......@@ -198,7 +198,7 @@ public:
JfxEvents();
~JfxEvents();
void Init(std::string map_path, std::string map_dir,std::string map_cfg);
void Init(std::string map_path, std::string map_dir,std::string map_cfg,std::string cross_csv);
void PushEventInfos(TrkObjsPtr& inputs);
......
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