Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
E
event_src
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
oscar
event_src
Commits
84cae0ae
Commit
84cae0ae
authored
Feb 16, 2023
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交地图获取信息传递出去。
parent
abc3c580
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
4 deletions
+46
-4
EventsRos.cpp
EventsRos.cpp
+5
-0
JfxEvents.cpp
events/JfxEvents.cpp
+29
-4
JfxEvents.h
events/JfxEvents.h
+2
-0
EventInfo.h
msg/EventInfo.h
+10
-0
No files found.
EventsRos.cpp
View file @
84cae0ae
...
...
@@ -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
=
{};
...
...
events/JfxEvents.cpp
View file @
84cae0ae
...
...
@@ -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
;
//更新存储的信息
//记录地图信息
...
...
events/JfxEvents.h
View file @
84cae0ae
...
...
@@ -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
;
...
...
msg/EventInfo.h
View file @
84cae0ae
...
...
@@ -92,6 +92,11 @@ typedef struct _TrkObj {
double
footLat
=
0
.
0
f
;
//垂足lat
double
acc_x
=
0
.
0
f
;
//x轴加速度
double
acc_y
=
0
.
0
f
;
//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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment