Closed ywiyogo closed 4 years ago
Hi @ywiyogo ,
Firstly, in the "karto_tools.h" file, a class called "LocalizedRangeScan" is implemented to store the data of a laser scan. If you want to get the scan points in the map frame, you can call the function "pScan->GetPointReadings" to access the point readings in global coordinates.
Secondly, when you have a point in world coordinates, you must scale it into grid coordinates before you can access the value at the grid map. The function "WorldToGrid" implemented in the "Grid" class can help you.
Thanks @nkuwenjian , it works now!
Hi @nkuwenjian ,
I have another questions. The function
scanCallback()
is the start entry of the scan processing if a lidar measurements coming. It contains three important steps :getLaser()
,processScan()
, andupdateMap()
.There is no documentation in both repositories from scan_tools and open_karto. Thus, I would like to ask how can I get the measurement points at the map frame?
Furthermore, since the function
int value = occ_grid->GetValue(Vector2<int>(x, y));
is index-based. If I have a point (x,y) from the map frame in meter, how can I get the value at the occupancy gridmap?Thanks