Commit a5ca3607 authored by wangdawei's avatar wangdawei

test

parent c8e2c78b
...@@ -45,10 +45,10 @@ using namespace std; ...@@ -45,10 +45,10 @@ using namespace std;
PointCloudJ::Ptr raw_scan(new PointCloudJ); \ PointCloudJ::Ptr raw_scan(new PointCloudJ); \
PointCloudJ::Ptr scan(new PointCloudJ); \ PointCloudJ::Ptr scan(new PointCloudJ); \
PointCloudJ::Ptr result(new PointCloudJ); \ PointCloudJ::Ptr result(new PointCloudJ); \
pcl::io::loadPCDFile("/home/wdw/Downloads/pcd/1683806268.056868.pcd", *raw_scan); \ pcl::io::loadPCDFile("/home/wdw/Downloads/test/1683806268.156870.pcd", *raw_scan); \
Eigen::Isometry3d mapPose; \ Eigen::Isometry3d mapPose; \
mapPose.translation() = Eigen::Vector3d(64.7009, 372.594, 29.5076); \ mapPose.translation() = Eigen::Vector3d(64.2653, 0372.09, 29.5085); \
Eigen::Vector3d mapPoseRpy(0.00618679, 0.00999828, 00002.4279); \ Eigen::Vector3d mapPoseRpy(0.00638869, 00.0101079, 0002.42708); \
mapPose.linear() = Eigen::Matrix3d( \ mapPose.linear() = Eigen::Matrix3d( \
Eigen::AngleAxisd(mapPoseRpy[2], Eigen::Vector3d::UnitZ()) \ Eigen::AngleAxisd(mapPoseRpy[2], Eigen::Vector3d::UnitZ()) \
* Eigen::AngleAxisd(mapPoseRpy[1], Eigen::Vector3d::UnitY()) \ * Eigen::AngleAxisd(mapPoseRpy[1], Eigen::Vector3d::UnitY()) \
...@@ -146,7 +146,7 @@ void test_onemesh_voxel_map_matcher() ...@@ -146,7 +146,7 @@ void test_onemesh_voxel_map_matcher()
PointCloudJ mapCloud; PointCloudJ mapCloud;
pcl::transformPointCloud(*raw_scan, mapCloud, mapPose.cast<float>()); pcl::transformPointCloud(*raw_scan, mapCloud, mapPose.cast<float>());
pcl::io::savePCDFileBinary("/home/wdw/Downloads/pcd/mapCloud.pcd", mapCloud); pcl::io::savePCDFileBinary("/home/wdw/Downloads/test/mapCloud.pcd", mapCloud);
GuessPose guess_pose; GuessPose guess_pose;
guess_pose.use_gnss = false; guess_pose.use_gnss = false;
// guess_pose.gnss_point = init_pose; // guess_pose.gnss_point = init_pose;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
//#include "voxel_map_stub.h" //#include "voxel_map_stub.h"
#include "voxel_map/interface/voxel_map.h" #include "voxel_map/interface/voxel_map.h"
//#define VOXEL_MAP_DEBUG #define VOXEL_MAP_DEBUG
//#define VOXEL_MAP_FAST_DEBUG #define VOXEL_MAP_FAST_DEBUG
//#define VOXEL_MAP_CERES_DEBUG //#define VOXEL_MAP_CERES_DEBUG
//#define VOXEL_MAP_CERES_OUTPUT_NUM 0 //#define VOXEL_MAP_CERES_OUTPUT_NUM 0
...@@ -110,7 +110,7 @@ void AdjustPPK::OnReceivedCloud(const PPointCloud &cloud) ...@@ -110,7 +110,7 @@ void AdjustPPK::OnReceivedCloud(const PPointCloud &cloud)
if(cloudPacket.timestamp < 1683806268.156870){ if(cloudPacket.timestamp < 1683806268.156870){
return; return;
} }
if(cloudPacket.timestamp > 1683806268.156870){ if(cloudPacket.timestamp > 1683806268.356870){
exit(0); exit(0);
} }
pcl::io::savePCDFileBinary(ieBaseDir_ + "/" + to_string(cloudPacket.timestamp) + "_raw.pcd", cloud); pcl::io::savePCDFileBinary(ieBaseDir_ + "/" + to_string(cloudPacket.timestamp) + "_raw.pcd", cloud);
...@@ -289,6 +289,7 @@ bool AdjustPPK::Undisort( ...@@ -289,6 +289,7 @@ bool AdjustPPK::Undisort(
PointCloudJ mappedFrame; PointCloudJ mappedFrame;
CloudPreprocess::Instance()->Undisort( CloudPreprocess::Instance()->Undisort(
frame, undisortedFrame, &mappedFrame, backPTime, &periodPose, framePose, increasePose); frame, undisortedFrame, &mappedFrame, backPTime, &periodPose, framePose, increasePose);
pcl::io::savePCDFileBinary(ieBaseDir_ + "/baseCloud/" + to_string(cloudInfo.timestamp) + "_mapped.pcd", mappedFrame);
cloudInfo.frame = undisortedFrame; cloudInfo.frame = undisortedFrame;
cloudInfo.filterPoseInfo.increasePose = increasePose; cloudInfo.filterPoseInfo.increasePose = increasePose;
cloudInfo.timestamp = rawFrame.timestamp; cloudInfo.timestamp = rawFrame.timestamp;
...@@ -352,7 +353,7 @@ bool AdjustPPK::LocateCloud(const CloudInfoForMatch &cloudInfo) ...@@ -352,7 +353,7 @@ bool AdjustPPK::LocateCloud(const CloudInfoForMatch &cloudInfo)
Vector3f rpy= RotationQuaternionToEulerVector(q); Vector3f rpy= RotationQuaternionToEulerVector(q);
LOG(INFO) << "guessPose: " << mapPose.translation().transpose() LOG(INFO) << "guessPose: " << mapPose.translation().transpose()
<< " rpy: " << rpy.transpose(); << " rpy: " << rpy.transpose();
pcl::io::savePCDFileBinary(ieBaseDir_ + "/baseCloud/" + to_string(cloudInfo.timestamp) + ".pcd", *cloudInfo.frame); // pcl::io::savePCDFileBinary(ieBaseDir_ + "/baseCloud/" + to_string(cloudInfo.timestamp) + ".pcd", *cloudInfo.frame);
GnssPoint finalGnssPose; GnssPoint finalGnssPose;
GuessPose guessPose; GuessPose guessPose;
guessPose.map_point = mapPose.cast<double>(); guessPose.map_point = mapPose.cast<double>();
......
...@@ -197,44 +197,44 @@ public: ...@@ -197,44 +197,44 @@ public:
} }
auto ret = currMesh_->GetCellValue(type, index, length); auto ret = currMesh_->GetCellValue(type, index, length);
std::ofstream ofs; // std::ofstream ofs;
ofs.open("/home/wdw/grid_use_" + to_string(type) + ".txt", std::ios::app); // ofs.open("/home/wdw/grid_use_" + to_string(type) + ".txt", std::ios::app);
int32_t blockIndexX = index.x.blockId; // int32_t blockIndexX = index.x.blockId;
int32_t blockIndexY = index.y.blockId; // int32_t blockIndexY = index.y.blockId;
uint32_t gridIndexX = index.x.gridId; // uint32_t gridIndexX = index.x.gridId;
uint32_t gridIndexY = index.y.gridId; // uint32_t gridIndexY = index.y.gridId;
Vector2f gridCenter; // Vector2f gridCenter;
gridCenter.x() = blockIndexX * 23.04 + (0.5 + gridIndexX) * 0.09 + currMesh_->GetOffset().x(); // gridCenter.x() = blockIndexX * 23.04 + (0.5 + gridIndexX) * 0.09 + currMesh_->GetOffset().x();
gridCenter.y() = blockIndexY * 23.04 + (0.5 + gridIndexY) * 0.09 + currMesh_->GetOffset().y(); // gridCenter.y() = blockIndexY * 23.04 + (0.5 + gridIndexY) * 0.09 + currMesh_->GetOffset().y();
// if(fabs(gridCenter.x() - (-0.045)) < 0.01 //// if(fabs(gridCenter.x() - (-0.045)) < 0.01
// && fabs(gridCenter.y() - 9.315) < 0.01){ //// && fabs(gridCenter.y() - 9.315) < 0.01){
// LOG(INFO) << "blockIndexX: " << blockIndexX << " blockIndexY: " << blockIndexY //// LOG(INFO) << "blockIndexX: " << blockIndexX << " blockIndexY: " << blockIndexY
// << " gridIndexX: " << gridIndexX << " gridIndexY: " << gridIndexY //// << " gridIndexX: " << gridIndexX << " gridIndexY: " << gridIndexY
// << " type: " << (uint16_t)type << " length: " << (uint16_t)length; //// << " type: " << (uint16_t)type << " length: " << (uint16_t)length;
//// }
// if(ret == nullptr){
//// std::ofstream nullOfs;
//// nullOfs.open("/home/juefx/null_" + to_string(type) + ".txt", std::ios::app);
//// nullOfs << gridCenter.x() << "," << gridCenter.y() << "," << 0 << std::endl;
//// nullOfs.close();
// return nullptr;
// } // }
// for(int i = 0; i < length; i++){
if(ret == nullptr){ // for(int32_t j = 0;
// std::ofstream nullOfs; // j < (ret + i)->height / 3;
// nullOfs.open("/home/juefx/null_" + to_string(type) + ".txt", std::ios::app); // j++){
// nullOfs << gridCenter.x() << "," << gridCenter.y() << "," << 0 << std::endl; // int32_t indexZ = j + (ret + i)->floor / 3;
// nullOfs.close(); // float point[4];
return nullptr; // point[0] = gridCenter.x();
} // point[1] = gridCenter.y();
for(int i = 0; i < length; i++){ // point[2] = ((float)indexZ + 0.5) * 3 / 100;
for(int32_t j = 0; // point[3] = (ret + i)->intensity;
j < (ret + i)->height / 3; // ofs << point[0] << "," << point[1] << ","
j++){ // << point[2] << "," << point[3] << std::endl;
int32_t indexZ = j + (ret + i)->floor / 3; // }
float point[4]; // }
point[0] = gridCenter.x(); // ofs.close();
point[1] = gridCenter.y();
point[2] = ((float)indexZ + 0.5) * 3 / 100;
point[3] = (ret + i)->intensity;
ofs << point[0] << "," << point[1] << ","
<< point[2] << "," << point[3] << std::endl;
}
}
ofs.close();
return ret; return ret;
} }
......
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