NeBula-Autonomy / LOCUS

Robust Lidar Odometry System
MIT License
352 stars 48 forks source link

Reg : Using Realsense Pointcloud as input #60

Closed dummyjohn77 closed 1 year ago

dummyjohn77 commented 1 year ago

Hi,

I was hoping to use a realsense pointcloud as input for LoCUS. Can you please tell me if this would be possible.

I have converted the realsense's depth cloud to a pointcloud using http://wiki.ros.org/depth_image_proc. I have also made the necessary TF changes. However, I keep running into the error

[pcl::MultithreadedGeneralizedIterativeClosestPoint::" "computeCovariances] Number or points in cloud (%lu) is less " "than kcorrespondences (%lu)!\n"

which is in line 70 of gicp.hpp.

Can you please tell me if there should be parameter change to incorporate the use of realsense?

femust commented 1 year ago

Hmm, this very likely means that the point cloud that you input to locus doesn't have size for some reason. Can you please check that the point cloud size that you are inputting to the locus and whether this point cloud has more points that the correspondence that you are looking for? What's your kcorresponences in odometry and localization module? Maybe those numbers are too large?

dummyjohn77 commented 1 year ago

Thank you for the prompt response.

I am able to visualize the input pointcloud of locus in rviz. I hope this would suffice to confirm that the pointcloud is valid and has points. The LOCUS error outputs that it has 4,8 or 16 points while the kcorrespondences is fixed at 20, in both odometry and localization.

https://user-images.githubusercontent.com/130052621/234924927-e16eaa63-7d14-462a-8252-6a1f0d5a9239.mp4

Added to this, LOCUS runs for a few iterations and running odom_to_map_tf gives us an set of odometry outputs. The error pops up after a few iterations of LOCUS (PFA: command prompt Video ).

Also can you please tell me how to edit the kcorrespondences. I tried searching the config files, but couldnt find the parameter

dummyjohn77 commented 1 year ago

I was trying to upload the launch file when I accidentally closed the issue. Sorry for any confusion caused

filter_field_name: z filter_limit_min: -100 filter_limit_max: 100 output_frame: $(arg robot_namespace)/base_link filter_field_name: y filter_limit_min: -10 filter_limit_max: 10 filter_limit_negative: False leaf_size: 0.2 output_frame: $(arg robot_namespace)/base_link
dummyjohn77 commented 1 year ago

Hi, An update

https://user-images.githubusercontent.com/130052621/235120507-04014bb4-53ce-4907-ba64-7281c498fac0.mp4

Your advise of K_correpondences worked. I reduced it to as low as 2, to ensure that the algorithm is running (but erroneous).

I also captured an rviz depiction of the input pointcloud. As you can see from the video, the scans are coming in at irregular intervals. The average rate of the topic was 4.724.

Can you please tell me if it is possible to tune the rate of LOCUS's expected input rate. Please do let me know if you think some other workaround is possible

dummyjohn77 commented 1 year ago

Hi, I managed to get the code running as expected. The issue was specific to the nodelet point_cloud_filter/CustomVoxelGrid. The nodelet was carrying out extreme downsampling inconsistently, which resulted in the input cloud being sparse.

I switched to pcl/VoxelGrid and the issue was resolved.

Can you please let me know if there is a reason for the use of point_cloud_filter/CustomVoxelGrid instead of pcl/VoxelGrid