Ask Your Question
1

Loading 2D raw data

asked 2011-03-31 01:03:45 -0500

szokei gravatar image

Hello, I've obtained a 2D map from another development environment, how could I load/display/manipulate (in gazebo/rviz) this set of 2D points. Thank you.

edit retag flag offensive close merge delete

Comments

What format is your map in ?
Guido gravatar imageGuido ( 2011-03-31 01:17:40 -0500 )edit
I've the 2D coordinate points in a .txt file.
szokei gravatar imageszokei ( 2011-03-31 19:41:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-03-31 20:54:15 -0500

Guido gravatar image

I think the simplest way is to write your map to a .pgm file. I guess a simple program can do it. It has to map the occupied points to black pixels (value=0), the free points to white pixels (254) and unknown points to gray pixels (205).

Then you can use the map_server package to publish it to rviz with the command: rosrun map_server map_server mymap.pgm

If you set the fixed frame as "/map" in rviz, you should see your map.

Hope this helps,

Guido

edit flag offensive delete link more

Comments

I've plot my map in Matlab, saved it in .tif and convert it into .pgm. The map is successfully loaded into RViz . Thank you!
szokei gravatar imageszokei ( 2011-04-01 23:39:46 -0500 )edit

I know this is an old thread, but I cant get this method to work. I have the pgm file on my desktop, and I run rosrun map_server map_server mymap.pgm, but it cant open the file. Any help would be appreciated. Thanks!

kost9 gravatar imagekost9 ( 2015-01-28 23:55:56 -0500 )edit
1

I used rosrun map_server map_serverrospack find <my_map_package>/mymap.yaml.

Be sure you have the correct file_path within the argument for your mymap.yaml

sealguy77 gravatar imagesealguy77 ( 2015-06-11 19:10:06 -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

Stats

Asked: 2011-03-31 01:03:45 -0500

Seen: 1,631 times

Last updated: Mar 31 '11