Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
localize_for_ppk
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
wangdawei
localize_for_ppk
Commits
c86b66b7
Commit
c86b66b7
authored
May 29, 2023
by
wangdawei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
7f4d0bef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
27 deletions
+28
-27
adjust_ppk.cpp
libs/locate_system/adjust_ppk_by_locate/adjust_ppk.cpp
+7
-8
convert.cc
libs/locate_system/adjust_ppk_by_locate/convert.cc
+21
-19
No files found.
libs/locate_system/adjust_ppk_by_locate/adjust_ppk.cpp
View file @
c86b66b7
...
...
@@ -69,7 +69,6 @@ void AdjustPPK::ReadBag(const string &bagPath)
if
(
convert_
->
processScan
(
m
.
instantiate
<
pandar_msgs
::
PandarScan
>
(),
cloud
)){
OnReceivedCloud
(
cloud
);
}
exit
(
0
);
}
}
...
...
@@ -104,13 +103,13 @@ void AdjustPPK::OnReceivedCloud(const PPointCloud &cloud)
<<
" cloud.size(): "
<<
cloud
.
size
()
<<
" frontPTime: "
<<
cloud
.
front
().
timestamp
<<
" backPTime: "
<<
cloud
.
back
().
timestamp
;
//
if(cloudPacket.timestamp < 1683806268.0){
//
return;
//
}
//
if(cloudPacket.timestamp > 1683806270.0){
//
exit(0);
//
}
pcl
::
io
::
savePCDFileBinary
(
ieBaseDir_
+
"/"
+
to_string
(
cloudPacket
.
timestamp
)
+
".pcd"
,
cloud
);
if
(
cloudPacket
.
timestamp
<
1683806268.0
){
return
;
}
if
(
cloudPacket
.
timestamp
>
1683806270.0
){
exit
(
0
);
}
//
pcl::io::savePCDFileBinary(ieBaseDir_ + "/" + to_string(cloudPacket.timestamp) + ".pcd", cloud);
for
(
const
auto
&
p
:
cloud
){
PointInter
point
;
point
.
x
=
p
.
x
;
...
...
libs/locate_system/adjust_ppk_by_locate/convert.cc
View file @
c86b66b7
...
...
@@ -125,7 +125,7 @@ Convert::Convert(const std::string &firetimeFile, const std::string &correctionF
m_iFirstAzimuthIndex
=
0
;
m_iLastAzimuthIndex
=
0
;
m_iTotalPointsNum
=
0
;
m_bClockwise
=
tru
e
;
m_bClockwise
=
fals
e
;
hasGps
=
0
;
// subscribe to PandarScan packets
...
...
@@ -212,22 +212,23 @@ bool Convert::processScan(
if
(
!
inited
){
init
(
scanMsg
->
packets
[
0
]);
uint16_t
frontAzimuth
=
*
(
uint16_t
*
)(
&
(
scanMsg
->
packets
[
0
].
data
[
0
])
+
m_iFirstAzimuthIndex
);
uint16_t
backAzimuth
=
*
(
uint16_t
*
)(
&
(
scanMsg
->
packets
[
1
].
data
[
0
])
+
m_iFirstAzimuthIndex
);
if
(((
frontAzimuth
<
backAzimuth
)
&&
((
backAzimuth
-
frontAzimuth
)
<
m_iAngleSize
*
10
))
||
((
frontAzimuth
>
backAzimuth
)
&&
(
frontAzimuth
-
backAzimuth
)
>
m_iAngleSize
*
10
))
{
m_bClockwise
=
true
;
//Clockwise
}
// uint16_t frontAzimuth = *(uint16_t*)(&(scanMsg->packets[0].data[0]) + m_iFirstAzimuthIndex);
// uint16_t backAzimuth = *(uint16_t*)(&(scanMsg->packets[1].data[0]) + m_iFirstAzimuthIndex);
// if(((frontAzimuth < backAzimuth) && ((backAzimuth - frontAzimuth) < m_iAngleSize * 10))
// ||
// ((frontAzimuth > backAzimuth) && (frontAzimuth - backAzimuth) > m_iAngleSize * 10))
// {
// m_bClockwise = true; //Clockwise
// }
// if(((frontAzimuth > backAzimuth) && ((frontAzimuth - backAzimuth) < m_iAngleSize * 10))
// ||
// ((frontAzimuth < backAzimuth) && (backAzimuth - frontAzimuth) > m_iAngleSize * 10))
// {
// m_bClockwise = false; //countClockwise
// }
// LOG(INFO) << "m_bClockwise: " << m_bClockwise;
if
(((
frontAzimuth
>
backAzimuth
)
&&
((
frontAzimuth
-
backAzimuth
)
<
m_iAngleSize
*
10
))
||
((
frontAzimuth
<
backAzimuth
)
&&
(
backAzimuth
-
frontAzimuth
)
>
m_iAngleSize
*
10
))
{
m_bClockwise
=
false
;
//countClockwise
}
LOG
(
INFO
)
<<
"m_bClockwise: "
<<
m_bClockwise
;
inited
=
true
;
}
m_OutMsgArray
[
0
]
->
clear
();
...
...
@@ -1201,7 +1202,8 @@ void Convert::calcPointXYZIT(const pandar_msgs::PandarPacket &packet, int cursor
index
+=
PANDAR128_HEAD_SIZE
;
for
(
int
blockid
=
0
;
blockid
<
header
->
u8BlockNum
;
blockid
++
)
{
uint16_t
u16Azimuth
=
*
(
uint16_t
*
)(
&
packet
.
data
[
0
]
+
index
);
LOG
(
INFO
)
<<
"u16Azimuth: "
<<
u16Azimuth
;
// LOG(INFO) << "u16Azimuth: " << u16Azimuth;
// ROS_WARN("#####block.fAzimuth[%u]",u16Azimuth);
index
+=
PANDAR128_AZIMUTH_SIZE
;
...
...
@@ -1252,8 +1254,8 @@ void Convert::calcPointXYZIT(const pandar_msgs::PandarPacket &packet, int cursor
}
else
if
(
azimuthIdx
<
0
)
{
azimuthIdx
+=
CIRCLE
;
}
LOG_EVERY_N
(
INFO
,
256
)
<<
"azimuthIdx: "
<<
azimuthIdx
<<
" m_fSinAllAngle[azimuthIdx]"
<<
m_fSinAllAngle
[
azimuthIdx
];
//
LOG_EVERY_N(INFO, 256) << "azimuthIdx: " << azimuthIdx
//
<< " m_fSinAllAngle[azimuthIdx]" << m_fSinAllAngle[azimuthIdx];
point
.
x
=
xyDistance
*
m_fSinAllAngle
[
azimuthIdx
];
point
.
y
=
xyDistance
*
m_fCosAllAngle
[
azimuthIdx
];
...
...
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