Ask Your Question

Creat map without gmapping/laser sensor

asked 2019-08-12 18:47:48 -0600

enthusiast.australia gravatar image

Hello everyone. I want to create a map, let say of a rectangle shaped room/area. I am using a turtlebot 3 but without laser sensor. Is it possible to create a map without any laser sensor or let say i give coordinate range of my area which will represent a border line of a map? Or is there any custom maps which can acquire and modify it's dimensions according to my usability?

edit retag flag offensive close merge delete


To generate an actual map you will need some sensor to sense the environment. Answer by @billy describes how you can trick it by drawing your own map. This approach however assumes that you accurately describe the operating environment. If you choose to use this for navigation, you cannot avoid actual obstacles as it will assume your map is accurate.

PG_GrantDare gravatar image PG_GrantDare  ( 2019-08-12 21:49:41 -0600 )edit

Yes, i want to use it for navigation. In the map, can I also include actual static obstacles? For example, i make a map of square shape area of 4 meter square, is it possible to include static obstacle, let say a square shape area of 0.2 meter square, and then use this map for navigation.

enthusiast.australia gravatar image enthusiast.australia  ( 2019-08-13 06:42:32 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2019-08-15 22:10:06 -0600

PapaG gravatar image

As per @billy s answer you can use map_server to load an existing map to your environment. To do this, assuming you know the details of the environment you are trying to describe, you can use an image editor to draw and represent the Occupancy Grid Map (OGM). To accompany this you will require a .yaml file that defines parameters about how map_server loads your map and interprets it. The YAML file is as so:

image: testmap.png
resolution: 0.1
origin: [0.0, 0.0, 0.0]
occupied_thresh: 0.65
free_thresh: 0.196
negate: 0

in order, define:

  • The location of the image
  • The resolution meters/pixels (This is based on how you choose to draw the image)
  • 0,0,0 (origin) of your map (set this number to where ever your robot will consistently start in your drawn map) (or you could initialize your robots pose at a point other than map origin)
  • The % that occupied is defined as (leave this default if your map is black and white)
  • The % that free is defined as (leave this default if your map is black and white)
  • Leave this default as if true inverts occupied and free

The restriction of not having environmental sensory data will affect navigation in that you won't have dynamic avoidance. You are restricted to what ever map you draw. Ensure you represent your environment accurately or you might collide with obstacles and ensure you have not added obstacles.

Using a global planner your path will be generated to navigate the environment you have specified in your OGM. The local control is where sensory data is usually important. If you use a blank costmap then a local planner will control a local path to achieve the global plan without dynamic avoidance. Without dynamic information of obstacles, the navigation will assume there are no obstacles and will control the robot to achieve the global plan which has already accounted for the static obstacles you have defined in your OGM.

I can understand that a LIDAR might be expensive however I have personally chosen to use an Xbox Kinect as it is rather cheap and can sense a 3D environment. You do not have to use 3D environments if you choose this path and can squash everything to 2D.

Please consider choosing an answer :)

edit flag offensive delete link more

answered 2019-08-12 19:01:26 -0600

billy gravatar image

If you know the dimensions of the room, you can simply draw a room shaped box in your favorite photo editor as greyscale, save the file as PGM and in the YAML file you describe the scaling of the map.

See this link to help with your YAML file;

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2019-08-12 18:47:48 -0600

Seen: 186 times

Last updated: Aug 15 '19