swri-robotics / mapviz

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

Cannot load map + Wgs84Transformer not initialized + NETWORK ERROR #747

Open robodyne-robotics opened 2 years ago

robodyne-robotics commented 2 years ago

I'm using ROS Melodic on Ubuntu 18.04 to launch mapviz. I'm not able to load any map (i.e. http://maps.stamen.com/terrain/#12/40.4485/17.9240) since as soon as I load the tilemap plugin I get:

[ WARN] [1637403046.945206940]: Wgs84Transformer not initialized
[ERROR] [1637403046.945483290]: Error: No transform between /wgs84 and map
[ WARN] [1637403048.950361959]: Wgs84Transformer not initialized

or sometimes, I get this other error:

[ WARN] [1637403364.657058338]: [transform_manager]: No transformer from '/wgs84' to '/map'. If '/map' is a /tf frame, it may not have been broadcast recently.
[ERROR] [1637403364.657141043]: Error: No transform between /wgs84 and map
[ WARN] [1637403364.727952973]: [transform_manager]: No transformer from '/map' to '/wgs84'. If '/map' is a /tf frame, it may not have been broadcast recently.

How can I fix this problem? This is my launch file:

<launch>

  <node pkg="mapviz" type="mapviz" name="mapviz"></node>

  <node pkg="swri_transform_util" type="initialize_origin.py" name="initialize_origin" >
    <param name="local_xy_frame" value="/map"/>
    <param name="local_xy_origin" value="auto"/>
    <!--<param name="local_xy_origin" value="swri"/>-->
    <rosparam param="local_xy_origins">
      [{ name: swri,
         latitude: 40.5675262,
         longitude: 17.4155641,
         altitude: 133.719,
         heading: 0.0},

       { name: back_40,
         latitude: 40.5675262,
         longitude: 17.4155641,
         altitude: 100.0,
         heading: 0.0}]
    </rosparam>
    <remap from="fix" to="/gnss"/>
  </node>

  <node pkg="tf" type="static_transform_publisher" name="swri_transform" args="0 0 0 0 0 0 /map /origin 100"  />

</launch>
danthony06 commented 2 years ago

I notice the local_xy_origin param is called local_xy_origins. Could that be the problem?

robodyne-robotics commented 2 years ago

Thank you for your answer and support! How should I change it in order to fix the issue? I don't think I have changed it.

danthony06 commented 2 years ago

I suspect you might be running into something similar to this: https://github.com/swri-robotics/mapviz/issues/712#issuecomment-748182040. Can you echo /local_xy_origin to see if you the origin is getting published?