ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

how do I to make /wgs84 frame available?

asked 2017-05-11 22:02:47 -0500

danielsnider gravatar image

Bit of background:

I want to use point_click_publisher to publish lat/lon coordinates of tile map.


The easiest way would be to type /wgs84 in the Frame dropdown for the point click plugin.

That will make the published point have the /wgs84 frame and contain longitude for the x coordinate and latitude for the y coordinate.


But how do I to make the /wgs84 frame available?

I'm following the steps that were given, but still no wgs84 frame...

The /wgs84 frame is not a true tf frame (since it can't be defined with a simple translation and rotation), so it won't be available through the standard tf interfaces. For the point_click_publisher you would just type /wgs84 into the frame dropdown box. This will work as long as the /local_xy_origin has been published and the tf frame it is associated with is connected to the frame mapviz is displaying.

I see in your launch file that the initialize origin node is set to 'auto' and will only publish the origin once it receives a GPS message. Can you confirm that the /local_xy_origin topic has been populated? If not, you can set it to one of the manually defined origins instead of 'auto'.

To use the /wgs84 frame in code as if it were a tf frame you would use swri_transform_util::TransformManager in place of a tf::TransformListener and use swri_transform_util::Transform instead of tf::Transform. The transform manger wraps the standard tf listener and also listens for the local xy orign so it can perform the conversion to and from lat / lon and frames in the tf tree.


My roslaunch file mapviz.launch.

Launch log output:

process[swri_transform-1]: started with pid [125343]
process[mapviz_ubuntu_125328_4724633399611045863-2]: started with pid [125344]
process[initialize_origin-3]: started with pid [125345]
process[rosapi-4]: started with pid [125346]
[139911776519936] [/initialize_origin/initialize_origin:101]: Local XY origin is "auto"
[139911776519936] [/initialize_origin/initialize_origin:104]: Local XY frame ID is "/world"
[139911776519936] [/initialize_origin/initialize_origin:121]: Subscribed to NavSat on /gps/fix
Warning: TF_OLD_DATA ignoring data from the past for frame robot_base at time 1.49455e+09 according to authority unknown_publisher
Possible reasons are listed at
         at line 273 in /tmp/binarydeb/ros-kinetic-tf2-0.5.15/src/buffer_core.cpp
[139911042692864] [/initialize_origin/gps_callback:54]: Got NavSat message. Setting origin and unsubscribing from NavSat.
[7ff0bf201880] [/mapviz_ubuntu_125328_4724633399611045863/TileMapPlugin::PrintError:245]: Error: No transform between /wgs84 and map
[7ff0bf201880] [/mapviz_ubuntu_125328_4724633399611045863/PointClickPublisherPlugin::PrintError:169]: Error: Unable to find transform from map to wgs84.

image description

My tf tree:

image description

I am using the latest mapviz packages available for ubuntu 16.04. Any thoughts?

THANK YOU, this feature would be awesome!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-05-12 08:42:36 -0500

"/wgs84" isn't a real TF frame and isn't handled by the normal ROS TF system, so it won't show up in the normal TF tree. It's handled specially by the swri_transform_util package.

You could try putting a forward slash in front of it in the plugin panel -- so "/wgs84" rather than "wgs84" -- but I don't think that should make a difference. Do you have a topic at "/local_xy_origin"? What does echoing it produce? (it should have been published by after I got its first NavSatFix)

edit flag offensive delete link more


Yes! Thank you! Putting a forward slash is important -- so "/wgs84" rather than "wgs84". We opened an issue for this:

danielsnider gravatar image danielsnider  ( 2017-05-13 11:19:57 -0500 )edit

answered 2020-08-25 11:22:04 -0500

Combinacijus gravatar image

Ended up with this launch file to run Mapviz and to have transform to /wgs84

    <!--WGS84 transform-->
    <node pkg="swri_transform_util" type="" name="initialize_origin" output="screen" >
        <param name="local_xy_frame" value="map"/>
        <param name="local_xy_origin" value="auto"/>

        <!--<remap from="/fix"    to="/YOUR/NAVSAT/FIX"/>-->
        <remap from="/fix"    to="/gps/filtered"/>

    <node name="mapviz" type="mapviz" pkg="mapviz">
        <param name="config" value="PATH_TO_YOUR_CONFIG/mapviz_config.mvc"/>
edit flag offensive delete link more

Question Tools



Asked: 2017-05-11 22:02:47 -0500

Seen: 2,808 times

Last updated: Aug 25 '20