Using ray-cast to generate virtual LaserScan data in given map, only work for 2D mobile robot.
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 kinetic
and melodic
.
New a folder as your workspace. Below is the example.
> mkdir -p ~/raycaster/src
> cd ~/raycaster/src
Pull down the code to your workspace.
> git clone https://github.com/hefvcjm/map_scan.git
Compile the code.
> cd ~/raycaster
> catkin_make
If you have sussecced to compile the code. Congratulations. And you can run the test code to feel how it works.
> source devel/setup.bash
> roslaunch map_scan test.launch
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.
static_map (nav_msgs/GetMap)
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.
map_scan(map_scan/GetMapScan)
Service to get the virtual-laser-scan in the map given the pose and the info of the virtual-laser.