Commit 1a1a66a0 authored by oscar's avatar oscar

添加配置文件里加入路口编号的配置。

parent b3be51a2
......@@ -49,7 +49,10 @@ int EventsRos::loadConfig(ros::NodeHandle& nh)
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);
int cross_id = 17;
if(m_config["road_cross_index"])
cross_id = m_config["road_cross_index"].as<int32_t>();
m_jfx_events.Init(map_path,map_dir,map_cfg,cross_csv,cross_id);
SDK_LOG(SDK_INFO, "EventsRos::loadConfig-InitMap end");
//map init end
EventsConfig& config = m_jfx_events.m_cfg;
......
......@@ -48,7 +48,7 @@ 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,std::string cross_csv)
void JfxEvents::Init(std::string map_path, std::string map_dir,std::string map_cfg,std::string cross_csv,int cross_id)
{
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());
......@@ -66,6 +66,7 @@ void JfxEvents::Init(std::string map_path, std::string map_dir,std::string map_c
SDK_LOG(SDK_INFO, "dir = %s, cfg = %s,csv = %s", dir.c_str(), map_cfg.c_str(),csv.c_str());
m_OfflineMap.Init(dir,map_cfg,csv);
m_isMapCsv = 1;
m_cross_id = cross_id;
#endif
}
//m_OfflineMap.reset(new jf::MapInterface());
......@@ -232,7 +233,7 @@ int JfxEvents::CalculateMap(ObjInfoAll& objAll, TrkObj& sendObj)
#ifdef _USING_NEW_JFXMAP_
jf::RoadInfo roadInfo = {};
int64_t lCrossId = 17;
int64_t lCrossId = m_cross_id;
#endif
//ROS_INFO("begin call jfxmap");
//bool result = m_OfflineMap->GetMapData(ptInLoc, dCarAngle, lOutRaodId, vctlOutPreRoadId, vctlOutNxtRoadId,
......
......@@ -198,7 +198,7 @@ public:
JfxEvents();
~JfxEvents();
void Init(std::string map_path, std::string map_dir,std::string map_cfg,std::string cross_csv);
void Init(std::string map_path, std::string map_dir,std::string map_cfg,std::string cross_csv,int cross_id);
void PushEventInfos(TrkObjsPtr& inputs);
......@@ -276,4 +276,6 @@ public:
//无路口车道,记录总的数量
TrafficJam m_totelTrafficJam;
int m_cross_id = 0;//路口id
};
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