1 Answer

Odometry is a proprioceptive measure, i.e. it gives you information about the state of the robot not about the external world.

SLAM algorithms (Simultaneous Localization and Mapping) are what you need, but they always rely on exteroceptive sensors (lidar, camera, sonar...).

If you don't know what's surrounding your robot it's almost impossible to build a map. From the odometry you can only build the path the robot has followed so far.
Moreover also obstacle avoidance becomes problematic.

If you need to map an environment using standard SLAM techniques there are examples in ROS.

On the other hand, if what you need is really to build a map using ONLY odometry, the only solution is to cover all the environment with the robot.
Just make an algorithm to move the robot from wall to wall using a "snake" pattern.
Note that the robot will not be able to asses where obstacles are until it bumps into them. So you will need at least a bumper or another additional sensor which tells you that the wheels are spinning but the robot is not moving forward (because it's against a wall).
In this case you could look for "wall following" algorithms and "environment coverage" ones.
But I strongly suggest to think about you really need to map using odometry.

The navigation stack is a "collection" of standard nodes used for navigation.
You should look at it to get an idea of which components do you need.
Then you can either use the included nodes or other similar ones.
There are no requirements between using Gazebo and the navigation stack

I'm going to teleop the robot with the keyboard to make the map. I had thought to use gmapping to store the map but it seems that it needs a laser and I can't use it. Any suggestion about how and where to store the map? Thanks.