I have previously open this thread but it get closed due to the time limit.
In that thread all configuration file seems okay and I’m told to try again creating the map.
Now I’m creating a new map using the cartographer but the issue still exist [map_server-1] [ERROR] [map_io]: Failed processing YAML file /home/user/ros2_ws/install/map_server/share/map_server/maps/tutlebot_area.yaml at position (-1:-1) for reason: bad file
Looking at your yaml file, I don’t see any issues. The formatting is correct (since it is automatically produced).
You can check for a few things here to (maybe) fix your problem:
Check if turtlebot_area.pgm and turtlebot_area.yaml are in the same folder.
Check if turtlebot_area.yaml has any hidden special characters (that are probably ascii or non-ascii characters). To do this try the command cat -A ./turtlebot_area.yaml from the folder containing this file. If you find any special characters, then delete them using a text editor.
If the above two steps did not solve your problem then, as a last step, type the entire contents “as-is” into a fresh yaml file. DO NOT COPY-PASTE.
Once you have typed the entire contents into a fresh yaml file, delete the old file and rename the new file to turtlebot_area.yaml. This should hopefully work.