Commit 84cae0ae authored by oscar's avatar oscar

提交地图获取信息传递出去。

parent abc3c580
......@@ -364,6 +364,11 @@ void EventsRos::SendRosEvents(TrkObjsPtr& outs)
msg.is_turn = iter.is_turn == 0 ? false : true;
msg.acc_x = iter.acc_x;
msg.acc_y = iter.acc_y;
msg.nodeId = iter.nodeId;
msg.linkName = iter.linkName;
msg.upstreamNodeId = iter.upstreamNodeId;
msg.sectionId = iter.sectionId;
msg.laneId = iter._laneId;
for(auto _its : iter.points)
{
jfx_common_msgs::Point64 loc = {};
......
......@@ -65,6 +65,7 @@ void JfxEvents::Init(std::string map_path, std::string map_dir,std::string map_c
// 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_isMapCsv = 1;
#endif
}
//m_OfflineMap.reset(new jf::MapInterface());
......@@ -228,12 +229,29 @@ int JfxEvents::CalculateMap(ObjInfoAll& objAll, TrkObj& sendObj)
std::vector<long> vctlOutPreRoadId;
std::vector<long> vctlOutNxtRoadId;
#ifdef _USING_NEW_JFXMAP_
jf::RoadInfo roadInfo = {};
int64_t lCrossId = 17;
#endif
//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,
nLaneCnt, nOutLaneNum, nOutLaneType,
nOutLeftEdgeCrossType, nOutRightEdgeCrossType,
nOutSpeedLimit, dOutLaneAngle, ptOutFoot);
bool result = false;
if(m_isMapCsv == 0)
{
result = m_OfflineMap.GetMapData(ptInLoc, dCarAngle, lOutRaodId, vctlOutPreRoadId, vctlOutNxtRoadId,
nLaneCnt, nOutLaneNum, nOutLaneType,
nOutLeftEdgeCrossType, nOutRightEdgeCrossType,
nOutSpeedLimit, dOutLaneAngle, ptOutFoot);
}
else
{
#ifdef _USING_NEW_JFXMAP_
result = m_OfflineMap.GetMapData(ptInLoc, dCarAngle, lOutRaodId, vctlOutPreRoadId, vctlOutNxtRoadId,
nLaneCnt, nOutLaneNum, nOutLaneType,
nOutLeftEdgeCrossType, nOutRightEdgeCrossType,
nOutSpeedLimit, dOutLaneAngle, ptOutFoot,roadInfo,lCrossId);
#endif
}
ObjInfoAll& obj = objAll;
if (result)
{
......@@ -291,6 +309,13 @@ int JfxEvents::CalculateMap(ObjInfoAll& objAll, TrkObj& sendObj)
sendObj.laneAngle = dOutLaneAngle;//车道方向
sendObj.footLon = ptOutFoot.dLon;//垂足lon
sendObj.footLat = ptOutFoot.dLat;//垂足lat
#ifdef _USING_NEW_JFXMAP_
sendObj.nodeId = roadInfo.lNodeId;
sendObj.linkName = roadInfo.strCrossName;
sendObj.upstreamNodeId = roadInfo.lUpstreamNodeId;
sendObj.sectionId = roadInfo.nSectionId;
sendObj._laneId = roadInfo.nLaneId;
#endif
obj.obj = sendObj;//更新存储的信息
//记录地图信息
......
......@@ -241,6 +241,8 @@ public:
//std::unique_ptr<jf::MapInterface> m_OfflineMap;
static jf::MapInterface m_OfflineMap;
int m_isMapCsv = 0;//是否使用csv文件,0不使用,1使用
std::mutex m_sendMtx;
SendEventProcessCallback m_sendCb = nullptr;
......
......@@ -92,6 +92,11 @@ typedef struct _TrkObj {
double footLat = 0.0f;//垂足lat
double acc_x = 0.0f;//x轴加速度
double acc_y = 0.0f;//y轴加速度
uint32_t nodeId = 0; // 所在交叉路口id
std::string linkName; // 所在路段,路段名称
uint32_t upstreamNodeId = 0; //所在路段的上游节点id
uint32_t sectionId = 0; // 所在的分段路段
uint32_t _laneId = 0; // 所在的车道
std::vector<Point64> points;//8个顶点的经纬高
std::vector<eventInfo> eventList; // 由于一辆车同时可能有多个违章,所以需要加入事件类型列表,参考TrackResultType类型
} TrkObj;
......@@ -136,6 +141,11 @@ AJSON(TrkObj,
footLat,
acc_x,
acc_y,
nodeId,
linkName,
upstreamNodeId,
sectionId,
_laneId,
points,
eventList
)
......
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