laboshinl / loam_velodyne

Laser Odometry and Mapping (Loam) is a realtime method for state estimation and mapping using a 3D lidar.
http://wiki.ros.org/loam_velodyne
Other
1.68k stars 956 forks source link

Public place to ask questions, post and discuss issues #3

Open laboshinl opened 8 years ago

laboshinl commented 8 years ago

The mapping is working, but in some point the pointcloud suddenly returns to the initial position and I get this error:

  laserOdometry: /build/buildd/pcl-1.7-1.7.1/kdtree/include/pcl/kdtree/impl/kdtree_flann.hpp:136: int pcl::KdTreeFLANN<PointT, Dist>::nearestKSearch(const PointT&, int, std::vector<int>&, std::vector<float>&) const [with PointT = pcl::PointXYZI; Dist = flann::L2_Simple<float>]: Assertion `point_representation_->isValid (point) && "Invalid (NaN, Inf) point coordinates given to nearestKSearch!"' failed.
    [laserOdometry-2] process has died [pid 10107, exit code -6, cmd /home/vicky/catkin_ws/devel/lib/loam_velodyne/laserOdometry __name:=laserOdometry __log:=/home/vicky/.ros/log/580f7db4-ffc0-11e5-aee2-74d4358625bb/laserOdometry-2.log].
    log file: /home/vicky/.ros/log/580f7db4-ffc0-11e5-aee2-74d4358625bb/laserOdometry-2*.log
    [laserOdometry-2] restarting process

I think when a keypoint from the registration process is not found, then the node laserOdometry node crashed and restart, then the mapping does not work because it does not continue in the same position as before, however it start again from the initial position.

When you run your example:

roslaunch ~/catkin_ws/src/loam_velodyne/launch/loam_velodyne.launch
rosbag play ~/Downloads/nsh_indoor_outdoor.bag 

do you obtain the same error?

How can I avoid this error? Many thanks in advance.

I have the same errors with the nsh bag. Works great with sample VLP16 data

laboshinl commented 8 years ago

Is this a version you wrote or is it the original implementation or did you piece it back together from the help pages? Did you write the package and launch file?

I've created package and launch file. I've also modified scanRegistration.cpp to get it to work with my VLP16 (I think originally it was for HDL32 )

ZepherusFF commented 8 years ago

@laboshinl Do you know if it saves the map generated anywhere? and if not, are you planning on modifying it so it does?

DamonMIN commented 8 years ago

When I build with catkin "source ~catkin_ws/devel/setup.bash", there is an error "bash: ~catkin_ws/devel/setup.bash: No such file or directory". Please help me to solve it. Thank you. @laboshinl

ZepherusFF commented 8 years ago

Hi @DamonMIN did you setup your catkin workspace correctly based on the ROS documentation ? Do you have the file in that directory ?

DamonMIN commented 8 years ago

Hi@ZepherusFF I have the "setup.bash" file in the folder ~catkin_ws/devel. The following text is the content of this file.

////////////////////////////////////////////////////////////////////
#!/usr/bin/env bash
# generated from catkin/cmake/templates/setup.bash.in

CATKIN_SHELL=bash

# source setup.sh from same directory as this file
_CATKIN_SETUP_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)
. "$_CATKIN_SETUP_DIR/setup.sh"
//////////////////////////////////////////////////////////////////
laboshinl commented 8 years ago

@DamonMIN You have missed "/"

laboshinl@rtc ~/catkin_ws $ source ~catkin_ws/devel/setup.bash 
bash: ~catkin_ws/devel/setup.bash: No such file or directory
laboshinl@rtc ~/catkin_ws $ source ~/catkin_ws/devel/setup.bash 
DamonMIN commented 8 years ago

@laboshinl

In second terminal play sample velodyne data from VLP16 rosbag:

rosbag play ~/Downloads/2014-11-10-10-48-31_Velodyne-VLP_20Hz_Hecker Pass.pcap
[ INFO] [1461760124.789037514]: Opening /home/aicrobo/Downloads/2014-11-10-10-48-31_Velodyne-VLP_20Hz_Hecker
[FATAL] [1461760124.789397586]: Error opening file: /home/aicrobo/Downloads/2014-11-10-10-48-31_Velodyne-VLP_20Hz_Hecker

read from velodyne VLP16 sample pcap:

roslaunch velodyne_pointcloud VLP16_points.launch pcap:="/home/aicrobo/Downloads/2014-11-10-10-48-31_Velodyne-VLP_20Hz_Hecker Pass.pcap"
[VLP16_points.launch] is neither a launch file in package [velodyne_pointcloud] nor is [velodyne_pointcloud] a launch file name
The traceback for the exception was written to the log file

It seems that the launch file can't find or recognize the velodyne data (The data was downloaded from VLP16 sample pcap).

laboshinl commented 8 years ago

You should compile velodyne driver https://github.com/ros-drivers/velodyne/tree/master/velodyne_pointcloud

ZepherusFF commented 8 years ago

@DamonMIN For the VLP16 you need to compile yourself the driver

FernandoArrigorriaga commented 8 years ago

Is there any way to export the data or is just for visualization?. By the way, works great.

laboshinl commented 8 years ago

@Fazt You can save registered clouds to pcd and open with ccViewer rosrun pcl_ros pointcloud_to_pcd input:=/velodyne_cloud_registered

drscopus commented 8 years ago

It seems that I can't run it successfully. I used the "VLP16 sample pcap" data sets. Should I calibrate the Velodyne sensor at first? At first, the 3D data points couldn't be displayed in rviz, only two odom topics /laser_odom_to_init and /integrated_to_init could be displayed. The locations of these odom topics are strange. Initially, they start at a same position. They are getting further in the distance. And the orientations of these two topics are also very strange. Then I found if the displayed style of pointcloud2 is adjusted from "points" to "squares", the 3D data points could be displayed. However, I couldn't see the constructed 3D map in rviz. Looking forwards to any great advices. Best!

laboshinl commented 8 years ago

@drscopus

only two odom topics /laser_odom_to_init and /integrated_to_init could be displayed. The locations of these odom topics are strange. Initially, they start at a same position. They are getting further in the distance. And the orientations of these two topics are also very strange.

Did you clone latest version of repo? It has different rviz config. You should look only at RED odom lines. Just disable GREEN. Arrows are perpendicular to the the direction of movement for some reason.

laboshinl commented 8 years ago

@drscopus

I couldn't see the constructed 3D map in rviz.

Try setting 'Decay Time' parameter to 1000 in topic 'velodyne_cloud_registered'

screenshot-10

drscopus commented 8 years ago

@laboshinl Thanks! It seems works fine now!

CansenJIANG commented 8 years ago

Dear Leonid,

Hello, I'm a Phd student from Univ. de Bourgogne in France. And recently I found your awesome project on github using Zhang's method on SLAM. I tested your code and it was working very well. However, I have some questions on the performances of the registration results. I tested the dataset that you shared on Github (VLP16 rosbag). Here are the results that I obtain (Fig.1 is the top view, and Fig.2 is the side view) . As we know, the Zhang's method achieves the best performances among the KITTI dataset (the LOAM ranked second, while V-LOAM ranked first). But the registered clouds that I got from the dataset that you provided are bent (see Fig.2).

I would like to ask that if you are having the same problem on this testing data or not? Or do you know the reason why it happens?

Thank you very much and look forward to your reply! Cansen

image Inline image 1 image Inline image 2

haoala commented 8 years ago

Hi,

The LOAM paper defines a formula for computing curvature that normalises by the distance of the point from the origin (equation (1) in the paper). However, it seems like the curvature computed in line 378 of scanRegistration.cpp is not normalised by the distance of the point from the origin. Any idea why this might be the case?

Thanks!

TopGunSnake commented 8 years ago

@laboshinl When testing the loam_velodyne with real data, I noticed that the transform frames are in a non-standard coordinate system. Namely, sensor forward is mapped to +z, sensor up is mapped to +y, and sensor left is mapped to +x. Is there a reason for this, and where can I easily change it to standard cartesian?

haoala commented 8 years ago

@TopGunSnake I believe it's because that's the convention the paper uses (page 2 at http://www.roboticsproceedings.org/rss10/p07.pdf).

haoala commented 8 years ago

@laboshinl What units are distances in?

Kailegh commented 8 years ago

@haoala meters I think

think@laboshinl What units are distances in?

@laboshinl For the error generated in nsh_indoor_outdoor.bag is it possible to make that when it losses odometry it keeps the last pose? And I have other question, is it possible to add the help of an IMU or wheel odometry?

laboshinl commented 8 years ago

@Kailegh There is no error for me with current version https://github.com/laboshinl/loam_velodyne/commit/60db8c10f79bb4e2de77f6b8212b40430c2ae473

Kailegh commented 8 years ago

@Kailegh There is no error for me with current version 60db8c1

Thanks a lot, works perfect now I had an old version sorry. Great work man! Although this version seems to have less points, do you use a voxel grid or something like that?

Regarding the IMU, do you think there is any advantage of including one?

An important question would be what is the maximun speed this can work?

laboshinl commented 8 years ago

@Kailegh I have not tested it with IMU yet. https://github.com/laboshinl/loam_velodyne/issues/6

haoala commented 8 years ago

I believe there's a bug with laserOdometry.cpp. Lines 458-459 should really go after line 470. You want to reset the points used to build the Jacobian at the start of each new iteration, and not keep points from previous iterations.

laboshinl commented 8 years ago

@haoala Feel free to send pull requests with updates

doublej317 commented 8 years ago

Can you share the original version of scanRegistration.cpp that works with HDL-32E? Thanks.

laboshinl commented 8 years ago

@doublej317 I was mistaken, it doesn't seem to be for HDL-32. Original sources can be found here: http://docs.ros.org/indigo/api/loam_velodyne/html/files.html

doublej317 commented 8 years ago

@laboshinl Thank you :)

laboshinl commented 7 years ago

@haythamd I'm not really sure, but it looks like a problem with environment variable, have you executed the following command? source ~/catkin_ws/devel/setup.bash Is your ROS configured correctly?

laboshinl commented 7 years ago

@haythamd Oh, I think you should also execute source ~/catkin_ws/devel/setup.bash in second terminal window to make your self-compilled velodyne driver work

CansenJIANG commented 7 years ago

@haythamd Hi, I suggest you read the point cloud using PCL or Meshlab, it's much more convenient. However, if you need to use some functions of cloudcompare, feel free to go. Just check the report and follow step by step.

Cansen

ctwu0314 commented 7 years ago

@laboshinl I have found the reason , the Lidar VLP-16 is malfunction. one channel is no signal.~~~

@laboshinl I have successfully implemented according to your steps. But when I connect the VLP-16 Lidar (roslaunch velodyne_pointcloud VLP16_points.launch _ip_address:=192.168.1.201), Usually happen the following error

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// [scanRegistration-2] process has died [pid 13615, exit code -11, cmd /home/ctwu/ROS_Code/catkin_loam/devel/lib/loam_velodyne/scanRegistration name:=scanRegistration log:=/home/ctwu/.ros/log/1f7faff2-5d33-11e6-98e2-74d02b61e376/scanRegistration-2.log]. log file: /home/ctwu/.ros/log/1f7faff2-5d33-11e6-98e2-74d02b61e376/scanRegistration-2.log /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// (the scanRegistration-2.log can't find in the folder)

desmosedic commented 7 years ago

@TopGunSnake @haoala I noticed the non-standard coordinate frames and thought maybe it was LOAM that was changing the coordinate frames but when you stream Point cloud data from the LiDAR and display it on Rviz, it still has the same coordinate frames as we see on LOAM. Were you guys able to fix the coordinate frames by writing a tf?

TopGunSnake commented 7 years ago

I had to ditch this node due to time constraints, but once I finish my project, I will be looking at this node again.

Jake Webster

On Aug 18, 2016 11:51 AM, "arjunmenon03" notifications@github.com wrote:

@TopGunSnake https://github.com/TopGunSnake @haoala https://github.com/haoala I noticed the non-standard coordinate frames and thought maybe it was LOAM that was changing the coordinate frames but when you stream Point cloud data from the LiDAR and display it on Rviz, it still has the same coordinate frames as we see on LOAM. Were you guys able to fix the coordinate frames by writing a tf?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/laboshinl/loam_velodyne/issues/3#issuecomment-240785577, or mute the thread https://github.com/notifications/unsubscribe-auth/AMXAMOlidSDO4LXswZkSii7hzEmarm9rks5qhI2XgaJpZM4IEd9W .

haoala commented 7 years ago

For my application, the lidar data was coming in using the coordinate system I wanted, so I didn't have to change it there. In any case, using a different coordinate frame doesn't change the algorithm, and it shouldn't be too hard to change the coordinate frame of the incoming lidar data.

On 19 August 2016 at 00:51, arjunmenon03 notifications@github.com wrote:

@TopGunSnake https://github.com/TopGunSnake @haoala https://github.com/haoala I noticed the non-standard coordinate frames and thought maybe it was LOAM that was changing the coordinate frames but when you stream Point cloud data from the LiDAR and display it on Rviz, it still has the same coordinate frames as we see on LOAM. Were you guys able to fix the coordinate frames by writing a tf?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/laboshinl/loam_velodyne/issues/3#issuecomment-240785577, or mute the thread https://github.com/notifications/unsubscribe-auth/AJGwB0pQpozVu5EwvbVwWJXhU97VlnOoks5qhI2XgaJpZM4IEd9W .

desmosedic commented 7 years ago

@TopGunSnake @haoala I wrote a simple fixed frame that ended up putting it in the same coordinate frame as the Velodyne. Quaternion of [0, 0.7071, 0.7071, 0] will put it in the Velodyne's coordinate frame. You are right @haoala , this does not change the algorithm whatsoever.

wine3603 commented 7 years ago

Hi guys, I am using LOAM too! are there anybody use LOAM on Hokuyo ? I had some problems on synchronization of laser and imu.

TopGunSnake commented 7 years ago

@desmosedic What frames was the transform for?

cuipengfeily commented 7 years ago

@laboshinl ,@haoala ,Hi, I have run the command "rosrun pcl_ros pointcloud_to_pcd input:=/velodyne_cloud_registered" and then I open them in CloudCompare,but it seems to be not registrated.However, the topic "laser_cloud_surround" is the all registrated points. So would you like to help me how the topic "laser_cloud_surround" can be saved in pcd format.Thank you!

sxsong1207 commented 7 years ago

@Fazt I recommend this package to export point cloud data. https://github.com/ShineSong/gatherpclmsg

Kailegh commented 7 years ago

I know this is asking a lot, but could you write some comments in the code? I have tried to understand how it works, but is everything too messy and I do not really get it. Thanks a lot anyway for your code

laboshinl commented 7 years ago

@amenonDJI rosrun pcl_ros pointcloud_to_pcd input:=/velodyne_cloud_registered saves .pcd for each registered pointcloud. Then this files should be simultaneously opened with CloudCompare

cuipengfeily commented 7 years ago

@amenonDJI I have tried with your help,and I have no issues now. Thank you

desmosedic commented 7 years ago

@laboshinl That makes sense. I opened them simultaneously and they work fantastic. In fact I took some measurements to see what kind of error I was receiving and I was able to measure with less than <2% of error with measurements. Do you have any error % from your tests. LOAM paper lists a few measurements as well.

DamonMIN commented 7 years ago

@laboshinl When I run "roslaunch loam_velodyne loam_velodyne.launch", there is an error as follow shows: qq 20161022114322

desmosedic commented 7 years ago

@DamonMIN As a debugging step, remove the call to Rviz inside the launch. Run the LOAM node separately and call rviz in another terminal. Then choose the laser_cloud_surround topic.

desmosedic commented 7 years ago

@laboshinl @TopGunSnake @CansenJIANG I have some test accuracy data and the algorithm is looking really good. I have less than 2% error in all the geometric calculations. There is a small problem though, a lot of the dynamic obstacles in the map such as a human walking around show up as artifacts in the map. Is there a way to reduce the "sensitivity" per say, in order to filter out point cloud data that are not static?

JohnMMeyer commented 7 years ago

Hello, I have just discovered LOAM, it seems very useful. I had a question if you don't mind. I have VLP-16 data that I collected a few months ago. They are in .bagfiles with the following topics:

topics: /cloud_in 1969 msgs : sensor_msgs/PointCloud2
/cloud_nodelet/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription /cloud_nodelet/parameter_updates 1 msg : dynamic_reconfigure/Config
/diagnostics 197 msgs : diagnostic_msgs/DiagnosticArray
/rosout 19 msgs : rosgraph_msgs/Log (5 connections) /rosout_agg 2 msgs : rosgraph_msgs/Log
/tf 2062 msgs : tf2_msgs/TFMessage
/velodyne_nodelet_manager/bond 828 msgs : bond/Status (3 connections)
/velodyne_packets 1969 msgs : velodyne_msgs/VelodyneScan

Is it possible to build a map with these topics? In other words without specifically having the topic 'velodyne_cloud_registered' ?

I have pulled out the pcd files already, can I build a map using those?

Thank you very much