swri-robotics / mapviz

Modular ROS visualization tool for 2D data.
BSD 3-Clause "New" or "Revised" License
370 stars 144 forks source link

mapviz on ros2 iron not show the map [SOLVED] #811

Closed elgarbe closed 3 months ago

elgarbe commented 5 months ago

Hi, I've installed mapviz from binary on ros2 iron following this tutorial for navigation stack. Everything works as expected on that demo. Now I want to use mapviz with my own robot. So I run my own robot_localization dual ekf and navsat but mapviz wont show the map. After a few warnings and some errors the map is not loaded:

[mapviz-1] [INFO] [1705970237.310865913] [mapviz]: Target frame selected: map
[mapviz-1] [INFO] [1705970237.312678528] [mapviz]: creating: mapviz_plugins/tile_map
[mapviz-1] [WARN] [1705970237.329849517] [mapviz]: [transform_manager]: No transformer from 'wgs84' to 'map'. If 'map' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [ERROR] [1705970237.329914933] [mapviz]: Error: No transform between wgs84 and map
[mapviz-1] [INFO] [1705970237.329969518] [mapviz]: Reorder displays
[mapviz-1] [INFO] [1705970237.334444731] [mapviz]: creating: mapviz_plugins/point_click_publisher
[mapviz-1] [INFO] [1705970237.410617852] [mapviz]: Publishing points to topic: clicked_point
[mapviz-1] [INFO] [1705970237.415078459] [mapviz]: Ready.
[mapviz-1] [INFO] [1705970237.424242578] [mapviz]: Reorder displays
[mapviz-1] [INFO] [1705970237.424357422] [mapviz]: Publishing points to topic: clicked_point
[mapviz-1] [INFO] [1705970237.429709922] [mapviz]: creating: mapviz_plugins/tf_frame
[mapviz-1] [INFO] [1705970237.437347095] [mapviz]: Reorder displays
[mapviz-1] [WARN] [1705970237.437629616] [mapviz]: Waiting for transform.
[mapviz-1] [INFO] [1705970237.437667247] [mapviz]: Setting target frame to to base_link
[mapviz-1] [INFO] [1705970237.438090888] [mapviz]: creating: mapviz_plugins/navsat
[mapviz-1] [INFO] [1705970237.442910620] [mapviz]: Reorder displays
[mapviz-1] [WARN] [1705970237.443256920] [mapviz]: No messages received.
[mapviz-1] [INFO] [1705970237.447384441] [mapviz]: Subscribing to /fix
[mapviz-1] [INFO] [1705970237.492977834] [mapviz]: OK
[mapviz-1] [WARN] [1705970237.496088904] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [WARN] [1705970237.496183211] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [WARN] [1705970237.608824028] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [WARN] [1705970237.644285358] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [ERROR] [1705970237.765964087] [mapviz]: [transform_manager]: Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.Tf has two or more unconnected trees.
[mapviz-1] [WARN] [1705970237.768162238] [mapviz]: [transform_manager]: Failed to get tf transform ('base_link' to 'map').  Both frames exist in tf.
[mapviz-1] [ERROR] [1705970237.772587022] [mapviz]: NETWORK ERROR: Protocol "" is unknown
[mapviz-1] [WARN] [1705970237.773754987] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [INFO] [1705970237.773901773] [mapviz]: OK
[mapviz-1] [ERROR] [1705970237.962370595] [mapviz]: [transform_manager]: Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.Tf has two or more unconnected trees.
[mapviz-1] [WARN] [1705970237.962675939] [mapviz]: [transform_manager]: Failed to get tf transform ('base_link' to 'map').  Both frames exist in tf.
[mapviz-1] [INFO] [1705970237.964708782] [mapviz]: API Key Set.
[mapviz-1] [INFO] [1705970237.966012186] [mapviz]: OK
[mapviz-1] [WARN] [1705970237.966397494] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [ERROR] [1705970238.125979271] [mapviz]: [transform_manager]: Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.Tf has two or more unconnected trees.
[mapviz-1] [WARN] [1705970238.126305363] [mapviz]: [transform_manager]: Failed to get tf transform ('base_link' to 'map').  Both frames exist in tf.
[mapviz-1] [ERROR] [1705970238.127018689] [mapviz]: NETWORK ERROR: Protocol "" is unknown
[mapviz-1] [WARN] [1705970238.130293670] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [ERROR] [1705970238.248568235] [mapviz]: [transform_manager]: Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.Tf has two or more unconnected trees.
[mapviz-1] [WARN] [1705970238.248914090] [mapviz]: [transform_manager]: Failed to get tf transform ('base_link' to 'map').  Both frames exist in tf.
[mapviz-1] [WARN] [1705970238.252063924] [mapviz]: [transform_manager]: No transformer from '' to 'tf'. If '' is a /tf frame, it may not have been broadcast recently.
[mapviz-1] [ERROR] [1705970238.260254833] [mapviz]: NETWORK ERROR: Protocol "" is unknown
[mapviz-1] [INFO] [1705970238.262219333] [mapviz]: OK
[mapviz-1] [ERROR] [1705970238.294023996] [mapviz]: NETWORK ERROR: Protocol "" is unknown
[mapviz-1] [ERROR] [1705970238.303270983] [mapviz]: NETWORK ERROR: Protocol "" is unknown

I'm not sure why using nav2 demo it's working ok, but with my robot doesn't.

elgarbe commented 4 months ago

I managed to make mapviz show the map using the changes suggested on this post to mapviz.launch.py

               Node(
              package="swri_transform_util",
              executable="initialize_origin.py",
              name="initialize_origin",
              parameters=[
                  {"local_xy_frame": "slc"},
                  {"local_xy_origin": "slc"},
                  {
                      "local_xy_origins": [
                          40.76935585340519,
                          -111.89107193491502,
                          0.0,
                          0.0,
                      ]
                  },
                  {"use_sim_time": True},
              ],
          )

I change local_xy_origin with the GPS coordinates of my location and the map shows up.