Hello
I’m currently trying to complete the ROS 2 Navigation (Galactic) course. However, on part 3 “How to localize the robot in the environment” I run into an error when using acml. The error I receive is that “Frame [map] does not exist” when I open Rviz2. I tried debugging for a long time, until I ended up copying the solution code for the exercises, but I still get the same error. My launch file, config files and setup file is identical to the solutions, and the amcl packages builds and runs with expected output:
user:~/ros2_ws$ colcon build --packages-select localization_serverStarting >>> localization_server
Finished <<< localization_server [2.14s]Summary: 1 package finished [2.50s]
user:~/ros2_ws$ source ~/ros2_ws/install/setup.bash
user:~/ros2_ws$ ros2 launch localization_server localization.launch.py
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2023-10-14
-12-58-31-648849-3_xterm-2846
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [map_server-1]: process started with pid [2848]
[INFO] [amcl-2]: process started with pid [2850]
[INFO] [lifecycle_manager-3]: process started with pid [2852]
[lifecycle_manager-3] [INFO] [1697288312.264099797] [lifecycle_manager_localization]: Creating
[lifecycle_manager-3] [INFO] [1697288312.272206926] [lifecycle_manager_localization]: Creating and initializing lifecycle service clients
[lifecycle_manager-3] [INFO] [1697288312.279015844] [lifecycle_manager_localization]: Starting managed nodes bringup...
[lifecycle_manager-3] [INFO] [1697288312.279625725] [lifecycle_manager_localization]: Configuring map_server
[amcl-2] [INFO] [1697288312.286019997] [amcl]:
[amcl-2] amcl lifecycle node launched.
[amcl-2] Waiting on external lifecycle transitions to activate
[amcl-2] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[amcl-2] [INFO] [1697288312.286166428] [amcl]: Creating
[map_server-1] [INFO] [1697288312.437992960] [map_server]:
[map_server-1] map_server lifecycle node launched.
[map_server-1] Waiting on external lifecycle transitions to activate
[map_server-1] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[map_server-1] [INFO] [1697288312.438141299] [map_server]: Creating
[map_server-1] [INFO] [1697288312.451080866] [map_server]: Configuring
[map_server-1] [INFO] [map_io]: Loading yaml file: /home/user/ros2_ws/install/map_server/share/map_server/config/turtlebot_area.yaml
[map_server-1] [DEBUG] [map_io]: resolution: 0.05
[map_server-1] [DEBUG] [map_io]: origin[0]: -4.31
[map_server-1] [DEBUG] [map_io]: origin[1]: -5.33
[map_server-1] [DEBUG] [map_io]: origin[2]: 0
[map_server-1] [DEBUG] [map_io]: free_thresh: 0.25
[map_server-1] [DEBUG] [map_io]: occupied_thresh: 0.65
[map_server-1] [DEBUG] [map_io]: mode: trinary
[map_server-1] [DEBUG] [map_io]: negate: 0
[map_server-1] [INFO] [map_io]: Loading image_file: /home/user/ros2_ws/install/map_server/share/map_server/config/turtlebot_area.pgm
[map_server-1] [DEBUG] [map_io]: Read map /home/user/ros2_ws/install/map_server/share/map_server/config/turtlebot_area.pgm: 232 X 218 map @ 0.05 m/cell
[lifecycle_manager-3] [INFO] [1697288312.516344792] [lifecycle_manager_localization]: Configuring amcl
[amcl-2] [INFO] [1697288312.516687330] [amcl]: Configuring
[amcl-2] [INFO] [1697288312.516796026] [amcl]: initTransforms
[amcl-2] [INFO] [1697288312.528289610] [amcl]: initPubSub
[amcl-2] [INFO] [1697288312.531923916] [amcl]: Subscribed to map topic.
[lifecycle_manager-3] [INFO] [1697288312.534485837] [lifecycle_manager_localization]: Activating map_server
[map_server-1] [INFO] [1697288312.534736499] [map_server]: Activating
[map_server-1] [INFO] [1697288312.534963188] [map_server]: Creating bond (map_server) to lifecycle manager.
[amcl-2] [INFO] [1697288312.535673053] [amcl]: Received a 232 X 218 map @ 0.050m/pix
[lifecycle_manager-3] [INFO] [1697288312.638709625] [lifecycle_manager_localization]: Server map_server connected with bond.
[lifecycle_manager-3] [INFO] [1697288312.638785905] [lifecycle_manager_localization]: Activating amcl
[amcl-2] [INFO] [1697288312.638997754] [amcl]: Activating
[amcl-2] [INFO] [1697288312.639051963] [amcl]: Creating bond (amcl) to lifecycle manager.
[amcl-2] [INFO] [1697288312.665716697] [amcl]: createLaserObject
[lifecycle_manager-3] [INFO] [1697288312.741945513] [lifecycle_manager_localization]: Server amcl connected with bond.
[lifecycle_manager-3] [INFO] [1697288312.742020307] [lifecycle_manager_localization]: Managed nodes are active
[lifecycle_manager-3] [INFO] [1697288312.742050165] [lifecycle_manager_localization]: Creating bond timer...
[amcl-2] [WARN] [1697288314.472852263] [amcl]: AMCL cannot publish a pose or update the transform. Please set the initial pose...
I also check the topics, and I can see that the map topic exists, but when I echo it, nothing is published to it. I find it weird that the output from amcl package is saying that it receives the map I made in part 2 of this tutorial.
I also checked the tf tree:
digraph G {
"odom" -> "base_footprint"[label=" Broadcaster: default_authority\nAverage rate: 29.61\nBuffer length: 5.032\nMost recent transform: 1481.414\nOldest transform: 1476.382\n"];
"base_footprint" -> "base_link"[label=" Broadcaster: default_authority\nAverage rate: 10000.0\nBuffer length: 0.0\nMost recent transform: 0.0\nOldest transform: 0.0\n"];
"base_link" -> "caster_back_link"[label=" Broadcaster: default_authority\nAverage rate: 10000.0\nBuffer length: 0.0\nMost recent transform: 0.0\nOldest transform: 0.0\n"];
"base_link" -> "imu_link"[label=" Broadcaster: default_authority\nAverage rate: 10000.0\nBuffer length: 0.0\nMost recent transform: 0.0\nOldest transform: 0.0\n"];
"base_link" -> "base_scan"[label=" Broadcaster: default_authority\nAverage rate: 10000.0\nBuffer length: 0.0\nMost recent transform: 0.0\nOldest transform: 0.0\n"];
"base_link" -> "wheel_left_link"[label=" Broadcaster: default_authority\nAverage rate: 19.608\nBuffer length: 4.998\nMost recent transform: 1481.414\nOldest transform: 1476.416\n"];
"base_link" -> "wheel_right_link"[label=" Broadcaster: default_authority\nAverage rate: 19.608\nBuffer length: 4.998\nMost recent transform: 1481.414\nOldest transform: 1476.416\n"];
edge [style=invis];
subgraph cluster_legend { style=bold; color=black; label ="view_frames Result";
"Recorded at time: 1697288688.9173172"[ shape=plaintext ] ;
}->"odom";
}
This is what my rviz2 looks like:
Is anyone able to help me? Would appreciate any help because I need the amcl to work in the next tutorials as well:)