configuration for generating laser scan using the gen_scan option

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

configuration for generating laser scan using the gen_scan option

jamrs
Hello,

I am currently using depthimage_to_laserscan option to generate a laserscan. However, I wanted to see if I can reduce the processing power needed by my edge computer if I instead use the gen_scan option to generate the 2D occupancy grid map.

I have the following configurations so far:
1. Grid/FromDepth = false
2. subscribe_scan= true
3. subscribe_depth= true

However, I do not see any new topic being published or a method to verify that the new scan is generated based on the gen_scan option.

Can you also explain how the gen_scan option generates the scan? using depth data? I am using an intel D435 and the dept readings for it seem to be unstable and result in a slightly fluctuating map.

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: configuration for generating laser scan using the gen_scan option

matlabbe
Administrator
Hi,

You would have to set subscribe_scan to false to make gen_scan work. However, I just saw a bug since 8 months making gen_scan not usable. I fixed it in this commit. Thx for reporting!

The gen_scan option takes the middle horizontal line of the depth image and projects it in 3D. It is pretty much the same than depthimage_to_laserscan node but done only at rtabmap rate instead of all images. In rtabmap, it also supports multi-cameras (for example if you have a rig of 3 cameras covering a larger field of view).

Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: configuration for generating laser scan using the gen_scan option

jamrs
Thank you. I will test this new commit and let you know.
Reply | Threaded
Open this post in threaded view
|

Re: configuration for generating laser scan using the gen_scan option

jamrs
In reply to this post by matlabbe
Hello,

I did a fresh installation but I am not sure how I can verify that gen_scan is working correctly. When I set the parameters as follows:
1. subscribe_scan=false
2. subscribe_depth=true
3. gen_scan=true
4. grid/fromdepth=false

I get grid map is empty warning when I try to visualize it on rviz.

when I change the parameters to:
1. subscribe_scan=false
2. subscribe_depth=true
3. gen_scan=true
4. grid/fromdepth=true

I end up with the same result as if the gen_scan was false. So how can I verify that gen_scan is working properly?
I am attaching the relevant launch files heremapping.launch   mvp_rtabmap.launch
Reply | Threaded
Open this post in threaded view
|

Re: configuration for generating laser scan using the gen_scan option

matlabbe
Administrator
Hi,

If rtabmapviz is launched, you could see the generated scan like this (line in cyan or gray in the middle, I overlayed the occupancy grid created from this scan):


You can also open the resulting database in rtabmap-databaseViewer, then open 3D View and the scan should appear in yellow:


In RVIZ, with rtabmap_ros/MapCloud plugin, check Cloud from Scan, and a red line showing the scan should appear:


If the line doesn't show up, you may check if a scan is actually generated by adding "ROS_WARN("scan = %d", scan.size());" just after this line.

cheers,
Mathieu