Ask Your Question
1

Occupancy Grid Coordinates

asked 2015-04-26 02:21:42 -0500

sobot gravatar image

updated 2015-04-26 02:23:59 -0500

Hi,

This might be a newbie question but i need a help with it or at least to be pointed in the right direction. I need to extract/acquire the (x, y) coordinates of a given map's (grid) cells to be used in a path planning program.

  • like in the RVIZ that you click somewhere on the map and it prints out the coordinates of that specific location. what i need to achieve is to acquire all of available "unoccupied" cells coordinates of a given map for my Node to calculate a STC path for the robot to travel.

How can i achieve this goal through a ROS node?

Does the (x, y) map coordinates system follow a certain rule? for example (0, 0) is always at a specific corner or there is a system for row and column numbering, etc.

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2015-04-26 02:53:59 -0500

bvbdort gravatar image

updated 2015-04-26 06:12:29 -0500

Hi,

Please have a look into yaml of map you are using.

using origin and resolution you can find position of each cell.


origin : The 2-D pose of the lower-left pixel in the map, as (x, y, yaw), with yaw as counterclockwise rotation (yaw=0 means no rotation). Many parts of the system currently ignore yaw.


resolution : Resolution of the map, meters / pixel


Edit

Occupancy Grid msg member data is having

Occupancy probabilities are in the range [0,100]. Unknown is -1.

Use free_thresh param to get Unoccupied cells (i.e free cells).

free_thresh : Pixels with occupancy probability less than this threshold are considered completely free.

if free_thresh: 0.196 then all cells with occupancy lessthan 19.6 (and not -1 ) are free .

edit flag offensive delete link more

Comments

Thanks so much! This answers the second part of my question. a little twist though, what if its not a static map (would local_costmap_params.yaml serve the same purpose?) Any idea about the first part of the problem (extracting unoccupied grid coordinates) through use of cpp codes?

sobot gravatar imagesobot ( 2015-04-26 04:53:37 -0500 )edit

check update, yes if map is not static you have to use cost map but you need good localization.

bvbdort gravatar imagebvbdort ( 2015-04-26 06:18:40 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2015-04-26 02:21:42 -0500

Seen: 4,356 times

Last updated: Apr 26 '15