Comments (13)
try this
extern const int N_SCAN = 40;
extern const int Horizon_SCAN = 1800;
extern const float ang_res_x = 0.2;
extern const float ang_res_y = 0.33;
extern const float ang_bottom = 16;
extern const int groundScanInd = 25;
from lego-loam.
I just notice that the vertical resolution o pandar is not consistent, You need to make more modifications to ensure the point cloud is correctly projected onto the range image.
from lego-loam.
from lego-loam.
@hunkyu
The package is optimized for Velodyne lidar. If you could share me a bag file and let me take a closer look, I may be able to point you to the right direction to customize it for your lidar.
from lego-loam.
@TixiaoShan
I am test package :
https://drive.google.com/open?id=1mYqc6BX8cwTu82p3lkWplGs9NY5oG-gu
from lego-loam.
@hunkyu
Thanks for sharing the bag file. I noticed that the point cloud drops a lot frames. I believe the pandar 40 frame is very different from velodyne frame. However, I can't find any useful information as this lidar is pooly documented. You can make changes in projectPointCloud() function to make it work with your lidar.
from lego-loam.
@TixiaoShan
The package I used was recorded again, using rosbag record, and there might be a lot of frame dropping. It was no problem to run with pandar_loam before, and the topic of the package was /panda_points. Do you need a complete bag? About 3.6G
from lego-loam.
@hunkyu
A complete bad would be great.
from lego-loam.
@TixiaoShan
https://drive.google.com/open?id=1UA7B0BfDNW5M4yQdzakJ98xOaPApuK2p
You can try it.
from lego-loam.
@hunkyu
I am able to get a map after making a few changes to the code. Set world frame in Rviz to "camera_init"
extern const int N_SCAN = 40;
extern const int Horizon_SCAN = 1800;
extern const float ang_res_x = 0.2;
extern const float ang_res_y = 0.33;
extern const float ang_bottom = 16;
extern const int groundScanInd = 25;
extern const float globalMapVisualizationSearchRadius = 10000.0;
void projectPointCloud(){
float verticalAngle, horizonAngle, range;
size_t rowIdn, columnIdn, index, cloudSize;
PointType thisPoint;
cloudSize = laserCloudIn->points.size();
for (size_t i = 0; i < cloudSize; ++i){
thisPoint.x = laserCloudIn->points[i].x;
thisPoint.y = laserCloudIn->points[i].y;
thisPoint.z = laserCloudIn->points[i].z;
verticalAngle = atan2(thisPoint.z, sqrt(thisPoint.x * thisPoint.x + thisPoint.y * thisPoint.y)) * 180 / M_PI;
float y_res;
if (verticalAngle >= -6 + 0.1 && verticalAngle <= 2 + 0.1)
y_res = 0.33;
else
y_res = 1.0;
rowIdn = (verticalAngle + ang_bottom) / y_res;
if (rowIdn < 0 || rowIdn >= N_SCAN)
continue;
horizonAngle = atan2(thisPoint.x, thisPoint.y) * 180 / M_PI;
if (horizonAngle <= -90)
columnIdn = -int(horizonAngle / ang_res_x) - 450;
else if (horizonAngle >= 0)
columnIdn = -int(horizonAngle / ang_res_x) + 1350;
else
columnIdn = 1350 - int(horizonAngle / ang_res_x);
range = sqrt(thisPoint.x * thisPoint.x + thisPoint.y * thisPoint.y + thisPoint.z * thisPoint.z);
rangeMat.at<float>(rowIdn, columnIdn) = range;
thisPoint.intensity = (float)rowIdn + (float)columnIdn / 10000.0;
index = columnIdn + rowIdn * Horizon_SCAN;
fullCloud->points[index] = thisPoint;
fullInfoCloud->points[index].intensity = range;
}
}
However, I am still not sure the image projection is 100% correct.
from lego-loam.
@TixiaoShan awesome! There was no concern at the time that the vertical angle was a problem of inhomogeneity
from lego-loam.
@hunkyu
There is a bug in the code above. The projection function should look like this:
void projectPointCloud(){
float verticalAngle, horizonAngle, range;
size_t rowIdn, columnIdn, index, cloudSize;
PointType thisPoint;
cloudSize = laserCloudIn->points.size();
for (size_t i = 0; i < cloudSize; ++i){
thisPoint.x = laserCloudIn->points[i].x;
thisPoint.y = laserCloudIn->points[i].y;
thisPoint.z = laserCloudIn->points[i].z;
verticalAngle = atan2(thisPoint.z, sqrt(thisPoint.x * thisPoint.x + thisPoint.y * thisPoint.y)) * 180 / M_PI;
if (verticalAngle < -6)
rowIdn = (verticalAngle + 16) / 1.0;
else if (verticalAngle >= -6 && verticalAngle < 2)
rowIdn = (verticalAngle + 6) / 0.33 + 10;
else
rowIdn = (verticalAngle - 2) / 1.0 + 34;
if (rowIdn < 0 || rowIdn >= N_SCAN)
continue;
horizonAngle = atan2(thisPoint.x, thisPoint.y) * 180 / M_PI;
if (horizonAngle <= -90)
columnIdn = -int(horizonAngle / ang_res_x) - 450;
else if (horizonAngle >= 0)
columnIdn = -int(horizonAngle / ang_res_x) + 1350;
else
columnIdn = 1350 - int(horizonAngle / ang_res_x);
range = sqrt(thisPoint.x * thisPoint.x + thisPoint.y * thisPoint.y + thisPoint.z * thisPoint.z);
rangeMat.at<float>(rowIdn, columnIdn) = range;
thisPoint.intensity = (float)rowIdn + (float)columnIdn / 10000.0;
index = columnIdn + rowIdn * Horizon_SCAN;
fullCloud->points[index] = thisPoint;
fullInfoCloud->points[index].intensity = range;
}
}
The mapping result will be much better.
from lego-loam.
@TixiaoShan Set world frame in Rviz to "camera_init"
from lego-loam.
Related Issues (20)
- I have been trying to use lego -LOAM for ouster os1 32 lidar to get 3d point cloud could you please give me an idea how to acheive it. HOT 1
- Q. How can I convert output of LeGO-LOAM to 2D grid map for path planning?
- Q. How to change lidar data type of XYZI to XYZIR?
- Can i use this with a non-rotating LiDAR? HOT 1
- Why does the exported PCD files look rotated and the z-value is very large
- Pose file
- roslaunch meet [mapOptmization-7] process has died issue.
- How to directly run LeGo LOAM on Velodyne .pcap file?
- terminate called after throwing an instance of 'pcl::IOException' what(): : [pcl::PCDWriter::writeBinary] Input point cloud has no data! HOT 4
- How to get a global(whole) map with format of .pcd?
- Ubuntu 20.4, ROS Noetic Drift Problem
- catkin build fails -
- Isn't an IMU a must
- mapOptimization crashes when robot starts moving
- How can I edit the code to apply mapping to all points (include outliers), rather than just the corners and surf?
- LiDAR rotates and moves alone in a mapping environment, even though LIDAR is fixed in reality.
- SLAM estimate data HOT 1
- Adaption to Robosense RS-Lidar M1 HOT 2
- [mapOptmization-7] process has died
- Using LsLidar C16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lego-loam.