Commit c86b66b7 authored by wangdawei's avatar wangdawei

test

parent 7f4d0bef
...@@ -69,7 +69,6 @@ void AdjustPPK::ReadBag(const string &bagPath) ...@@ -69,7 +69,6 @@ void AdjustPPK::ReadBag(const string &bagPath)
if(convert_->processScan(m.instantiate<pandar_msgs::PandarScan>(), cloud)){ if(convert_->processScan(m.instantiate<pandar_msgs::PandarScan>(), cloud)){
OnReceivedCloud(cloud); OnReceivedCloud(cloud);
} }
exit(0);
} }
} }
...@@ -104,13 +103,13 @@ void AdjustPPK::OnReceivedCloud(const PPointCloud &cloud) ...@@ -104,13 +103,13 @@ void AdjustPPK::OnReceivedCloud(const PPointCloud &cloud)
<< " cloud.size(): " << cloud.size() << " cloud.size(): " << cloud.size()
<< " frontPTime: " << cloud.front().timestamp << " frontPTime: " << cloud.front().timestamp
<< " backPTime: " << cloud.back().timestamp; << " backPTime: " << cloud.back().timestamp;
// if(cloudPacket.timestamp < 1683806268.0){ if(cloudPacket.timestamp < 1683806268.0){
// return; return;
// } }
// if(cloudPacket.timestamp > 1683806270.0){ if(cloudPacket.timestamp > 1683806270.0){
// exit(0); exit(0);
// } }
pcl::io::savePCDFileBinary(ieBaseDir_ + "/" + to_string(cloudPacket.timestamp) + ".pcd", cloud); // pcl::io::savePCDFileBinary(ieBaseDir_ + "/" + to_string(cloudPacket.timestamp) + ".pcd", cloud);
for(const auto &p : cloud){ for(const auto &p : cloud){
PointInter point; PointInter point;
point.x = p.x; point.x = p.x;
......
...@@ -125,7 +125,7 @@ Convert::Convert(const std::string &firetimeFile, const std::string &correctionF ...@@ -125,7 +125,7 @@ Convert::Convert(const std::string &firetimeFile, const std::string &correctionF
m_iFirstAzimuthIndex = 0; m_iFirstAzimuthIndex = 0;
m_iLastAzimuthIndex = 0; m_iLastAzimuthIndex = 0;
m_iTotalPointsNum = 0; m_iTotalPointsNum = 0;
m_bClockwise = true; m_bClockwise = false;
hasGps = 0; hasGps = 0;
// subscribe to PandarScan packets // subscribe to PandarScan packets
...@@ -212,22 +212,23 @@ bool Convert::processScan( ...@@ -212,22 +212,23 @@ bool Convert::processScan(
if(!inited){ if(!inited){
init(scanMsg->packets[0]); init(scanMsg->packets[0]);
uint16_t frontAzimuth = *(uint16_t*)(&(scanMsg->packets[0].data[0]) + m_iFirstAzimuthIndex); // uint16_t frontAzimuth = *(uint16_t*)(&(scanMsg->packets[0].data[0]) + m_iFirstAzimuthIndex);
uint16_t backAzimuth = *(uint16_t*)(&(scanMsg->packets[1].data[0]) + m_iFirstAzimuthIndex); // uint16_t backAzimuth = *(uint16_t*)(&(scanMsg->packets[1].data[0]) + m_iFirstAzimuthIndex);
if(((frontAzimuth < backAzimuth) && ((backAzimuth - frontAzimuth) < m_iAngleSize * 10)) // if(((frontAzimuth < backAzimuth) && ((backAzimuth - frontAzimuth) < m_iAngleSize * 10))
|| // ||
((frontAzimuth > backAzimuth) && (frontAzimuth - backAzimuth) > m_iAngleSize * 10)) // ((frontAzimuth > backAzimuth) && (frontAzimuth - backAzimuth) > m_iAngleSize * 10))
{ // {
m_bClockwise = true; //Clockwise // 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; inited = true;
} }
m_OutMsgArray[0]->clear(); m_OutMsgArray[0]->clear();
...@@ -1201,7 +1202,8 @@ void Convert::calcPointXYZIT(const pandar_msgs::PandarPacket &packet, int cursor ...@@ -1201,7 +1202,8 @@ void Convert::calcPointXYZIT(const pandar_msgs::PandarPacket &packet, int cursor
index += PANDAR128_HEAD_SIZE; index += PANDAR128_HEAD_SIZE;
for (int blockid = 0; blockid < header->u8BlockNum; blockid++) { for (int blockid = 0; blockid < header->u8BlockNum; blockid++) {
uint16_t u16Azimuth = *(uint16_t*)(&packet.data[0] + index); uint16_t u16Azimuth = *(uint16_t*)(&packet.data[0] + index);
LOG(INFO) << "u16Azimuth: " << u16Azimuth; // LOG(INFO) << "u16Azimuth: " << u16Azimuth;
// ROS_WARN("#####block.fAzimuth[%u]",u16Azimuth); // ROS_WARN("#####block.fAzimuth[%u]",u16Azimuth);
index += PANDAR128_AZIMUTH_SIZE; index += PANDAR128_AZIMUTH_SIZE;
...@@ -1252,8 +1254,8 @@ void Convert::calcPointXYZIT(const pandar_msgs::PandarPacket &packet, int cursor ...@@ -1252,8 +1254,8 @@ void Convert::calcPointXYZIT(const pandar_msgs::PandarPacket &packet, int cursor
} else if (azimuthIdx < 0) { } else if (azimuthIdx < 0) {
azimuthIdx += CIRCLE; azimuthIdx += CIRCLE;
} }
LOG_EVERY_N(INFO, 256) << "azimuthIdx: " << azimuthIdx // LOG_EVERY_N(INFO, 256) << "azimuthIdx: " << azimuthIdx
<< " m_fSinAllAngle[azimuthIdx]" << m_fSinAllAngle[azimuthIdx]; // << " m_fSinAllAngle[azimuthIdx]" << m_fSinAllAngle[azimuthIdx];
point.x = xyDistance * m_fSinAllAngle[azimuthIdx]; point.x = xyDistance * m_fSinAllAngle[azimuthIdx];
point.y = xyDistance * m_fCosAllAngle[azimuthIdx]; point.y = xyDistance * m_fCosAllAngle[azimuthIdx];
......
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