Using ray-cast to generate virtual LaserScan data in given map, only work for 2D mobile robot. Refer to the source.
map_scan is a ros package which implements
ray-cast to generate virtual
LaserScan data in given map. It’s very appriciated that the amcl had implemented the beam ray-cast wonderfully. And in this package, it will use the beam ray-cast provided by amcl and just modify it a little.
Note: To use this package, you could pull down the code to your computer. However, I should tell you that the package only has been tested in Ubuntu 16.04 and Ubuntu 18.04 corresponding to
ROS distribution of
New a folder as your workspace. Below is the example.
mkdir -p ~/raycaster/src
Pull down the code to your workspace.
git clone https://github.com/hefvcjm/map_scan.git
Compile the code.
If you have sussecced to compile the code. Congratulations. And you can run the test code to feel how it works.
And you can see something like below.
The arrow is the virtual-laser pose. And the green bound is the visualization of the LaserScan data.
map_scan calls this service to retrieve the map that is used for virtual-laser-based localization; startup blocks on getting the map from this service.
Service to get the virtual-laser-scan in the map given the pose and the info of the virtual-laser.