Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
thirdparty_map
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
thirdparty_map
Commits
a61eb045
Commit
a61eb045
authored
Aug 22, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交接口变动
parent
48059d99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
22 deletions
+40
-22
MapInterface.hpp
include/MapInterface.hpp
+2
-3
MapInterface.cpp
src/MapInterface.cpp
+38
-19
No files found.
include/MapInterface.hpp
View file @
a61eb045
...
...
@@ -76,8 +76,8 @@ namespace jf {
bool
GetMapData
(
const
Point
&
ptInLoc
,
double
dCarAngle
,
long
&
lOutRaodId
,
std
::
vector
<
long
>&
vctlOutPreRoadId
,
std
::
vector
<
long
>&
vctlOutNxtRoadId
,
int
&
nLaneCnt
,
int
&
nOutLaneNum
,
LaneType
&
nOutLaneType
,
EdgeCrossType
&
nOutLeftEdgeCrossType
,
EdgeCrossType
&
nOutRightEdgeCrossType
,
int
&
nOutSpeedLimit
,
double
&
dOutLaneAngle
,
Point
&
ptOutFoot
);
bool
GetMapIDS
(
const
Point
&
ptInLoc
,
int
&
id
);
bool
GetMapIDS
(
const
Point
&
ptInLoc
,
double
dCarAngle
,
int
&
id
);
};
}
// namespace jf
#endif
\ No newline at end of file
#endif
src/MapInterface.cpp
View file @
a61eb045
...
...
@@ -48,7 +48,7 @@ namespace jf {
#endif
if
(
odr
.
size
()
==
0
)
{
printf
(
"not in map lon = %.8f, lat = %.8f
\n
"
,
ptInLoc
.
dLon
,
ptInLoc
.
dLat
);
printf
(
"not
2
in map lon = %.8f, lat = %.8f
\n
"
,
ptInLoc
.
dLon
,
ptInLoc
.
dLat
);
return
false
;
}
std
::
string
roadId
;
...
...
@@ -56,10 +56,12 @@ namespace jf {
double
angle
=
g_map
.
GetHdgByXY
(
3926.381879
,
11180.870534
,
dCarAngle
,
roadId
);
std
::
cout
<<
"GetHdgByXY comValue = "
<<
dCarAngle
<<
",return = "
<<
angle
<<
",roadId = "
<<
roadId
<<
std
::
endl
;
#else
double
angle
=
g_map
.
GetHdg
(
ptInLoc
.
dLon
,
ptInLoc
.
dLat
,
dCarAngle
,
roadId
);
double
carAngle
=
(
90
-
dCarAngle
)
/
180
*
3.1415926
;
double
angle
=
g_map
.
GetHdg
(
ptInLoc
.
dLon
,
ptInLoc
.
dLat
,
dCarAngle
,
roadId
);
#endif
dOutLaneAngle
=
angle
;
dOutLaneAngle
=
-
(
angle
*
180
/
3.1415926
-
90
);
if
(
dOutLaneAngle
<
0
)
dOutLaneAngle
+=
360
;
std
::
string
sectionId
;
std
::
string
laneId
;
for
(
auto
its
:
odr
)
...
...
@@ -75,7 +77,8 @@ namespace jf {
lOutRaodId
=
std
::
stol
(
roadId
);
int
_sectionId
=
sectionId
==
""
?
0
:
std
::
stol
(
sectionId
);
int
_laneId
=
laneId
==
""
?
0
:
std
::
stol
(
laneId
);
int
_laneId
=
laneId
==
""
?
0
:
std
::
stol
(
laneId
);
//printf("GetHdg laneId = %d, dCarAngle = %f, carAngle = %f, angle = %f, dOutLandAngle = %f,ptInLoc.dLon = %.8f, ptInLoc.dLat = %.8f\n",_laneId,dCarAngle,carAngle,angle,dOutLaneAngle,ptInLoc.dLon, ptInLoc.dLat);
#ifdef _DEBUG_API_
std
::
cout
<<
"lOutRaodId = "
<<
lOutRaodId
<<
",_sectionId = "
<<
_sectionId
<<
", _laneId = "
<<
_laneId
<<
std
::
endl
;
#endif
...
...
@@ -179,7 +182,8 @@ namespace jf {
#endif
if
(
isJunction
)
{
nOutLaneType
=
LaneType
::
JunctionLane
;
std
::
cout
<<
"bJunctionRoad is true"
<<
std
::
endl
;
nOutLaneType
=
LaneType
::
JunctionLane
;
}
#ifdef _DEBUG_API_
NearestRoadMark
mark
=
g_map
.
GetNeartestLaneRoadMarkByXY
(
ptInLoc
.
dLon
,
ptInLoc
.
dLat
);
...
...
@@ -229,22 +233,38 @@ namespace jf {
return
true
;
}
bool
MapInterface
::
GetMapIDS
(
const
Point
&
ptInLoc
,
int
&
id
)
bool
MapInterface
::
GetMapIDS
(
const
Point
&
ptInLoc
,
double
dCarAngle
,
int
&
id
)
{
id
=
0
;
char
**
vecRoad
=
nullptr
;
int
nSize
=
0
;
auto
result
=
g_map
.
GetAllJunctionRoadIDS
(
ptInLoc
.
dLon
,
ptInLoc
.
dLat
,
vecRoad
,
nSize
);
if
(
result
)
std
::
vector
<
OdrInfo
>
odr
=
g_map
.
GetOdrInfo
(
ptInLoc
.
dLon
,
ptInLoc
.
dLat
);
if
(
odr
.
size
()
==
0
)
{
if
(
nSize
==
1
)
{
std
::
string
ids
=
vecRoad
[
0
];
id
=
std
::
stol
(
ids
);
}
printf
(
"not 3 in map lon = %.8f, lat = %.8f
\n
"
,
ptInLoc
.
dLon
,
ptInLoc
.
dLat
);
return
false
;
}
//std::string roadId;
double
carAngle
=
(
90
-
dCarAngle
)
/
180
*
3.1415926
;
long
int
roadLaneId
=
0
;
bool
result
=
g_map
.
GetHdg
(
ptInLoc
.
dLon
,
ptInLoc
.
dLat
,
dCarAngle
,
roadLaneId
);
printf
(
"GetHdg result = %d, roadLaneId = %d, lon = %.8f,lat = %.8f,dCarAngle = %f
\n
"
,
result
,
roadLaneId
,
ptInLoc
.
dLon
,
ptInLoc
.
dLat
,
dCarAngle
);
if
(
result
)
id
=
roadLaneId
;
else
id
=
0
;
// id = 0;
// char** vecRoad = nullptr;
// int nSize = 0;
// auto result = g_map.GetAllJunctionRoadIDS(ptInLoc.dLon, ptInLoc.dLat, vecRoad, nSize);
// if (result)
// {
// if (nSize == 1)
// {
// std::string ids = vecRoad[0];
// id = std::stol(ids);
// }
// }
// printf("GetMapIDS result = %d, nSize = %d, id = %d,ptInLoc.dLon = %.8f, ptInLoc.dLat = %.8f\n",result,nSize,id,ptInLoc.dLon, ptInLoc.dLat);
return
true
;
}
}
// namespace jf
\ No newline at end of file
}
// namespace jf
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