How do i use the map_server node of the navigation2 package with a greyscale .png? [closed]

asked 2022-07-11 06:59:47 -0500 gravatar image

updated 2022-07-11 07:02:49 -0500

I try to publish a greyscale image as a map in ROS2 Foxy on Ubuntu Focal and show it in RVIZ2.
However, following the documentation i get only an error using the Nav2 map_server.

I have three files
a map.yaml:

image: map.png    
resolution: 0.1    
origin: [2.0, 3.0, 1.0]    
negate: 0    
occupied_thresh: 0.65    
free_thresh: 0.196

a param.yaml:

    yaml_filename: "map.yaml"
    yaml_topic: "map"
    map_id: "map"

and greyscale .png,

I used the following two commands in the files folder
I tried local paths and global paths to the param.yaml file

ros2 run nav2_map_server map_server __params:=param.yaml

ros2 run nav2_util lifecycle_bringup map_server

The map server is starting, however the following error is issued:

 [INFO] [1657539590.016173007] [map_server]: Creating    
[INFO] [1657539593.413936635] [map_server]: Configuring    
[ERROR] [1657539593.414011086] []: Caught exception in callback for transition 10    
[ERROR] [1657539593.414019606] []: Original error: yaml_filename    
[WARN] [1657539593.414035949] []: Error occurred while doing error handling.    
[FATAL] [1657539593.414044050] [map_server]: Lifecycle node map_server does not have error state implemented    
[WARN] [1657539593.414704048] [rcl_lifecycle]: No transition matching 3 found for current state unconfigured    
[ERROR] [1657539593.414732613] []: Unable to start transition 3 from current state unconfigured: Transition is not registered., at /tmp/binarydeb/ros-foxy-rcl-lifecycle-1.1.13/src/rcl_lifecycle.c:350

I found a similiar question with a workaround only.

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by
close date 2022-07-25 03:46:23.848378


Because my application of the map_sever required a launch file anyway, i went with the answer in gravatar image  ( 2022-07-25 03:45:54 -0500 )edit