Skip to content

This repository gives and C++ code to transform WGS84 to UTM coordinates using ROS framework

Notifications You must be signed in to change notification settings

bigbigpark/WGS84-UTM-Converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WGS84-UTM-Converter

This repository gives and C++ code to transform WGS84 to UTM converter using ROS framework


Tested Environment

  • Ubuntu 18.04
  • ROS Melodic

Summary

subscribe a topic as sensor_msgs/NavSatFix

publish a topic as nav_msgs/Path

How to use

1. Prerequisites

GeographicLib


2. Clone and Build

Clone this repository

$ git clone https://github.com/bigbigpark/WGS84-UTM-Converter.git

Build

# You can build this 'catkin build' or 'catkin_make'
$ catkin build

3. Run

$ roslaunch wgs84_to_utm wgs84_to_utm.launch

4. Parameter Configuration

in /launch/wgs84_to_utm.launch,

All you need to do is change utm_zone and hemishpere

That value is default of South Korea (UTM 52N)

<!-- Default setting: UTM 52N in South Korea -->
<param name="utm_zone" type="int" value="52" />
  
<!-- Hemishpere setting: if your country is on North, set it as true, vice versa -->
<param name="hemisphere" type="bool" value="true" />  

Output

GPS lat, lon is successfully converted to UTM coordinates


This is rqt_graph,


Known error

CMake Error at CMakeLists.txt:13 (find_package):
  By not providing "FindGeographicLib.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "GeographicLib", but CMake did not find one.

  Could not find a package configuration file provided by "GeographicLib"
  with any of the following names:

    GeographicLibConfig.cmake
    geographiclib-config.cmake

  Add the installation prefix of "GeographicLib" to CMAKE_PREFIX_PATH or set
  "GeographicLib_DIR" to a directory containing one of the above files.  If
  "GeographicLib" provides a separate development package or SDK, be sure it
  has been installed

This error occurs are result of cannot find GeoraphicLib_DIR correctly

So all you need to do is set GeographicLib to be correctly


As an example, in your CMakeLists.txt,

add that line before find_package() , this is important

you should change GeographicLib_DIR to your installed path

set(GeographicLib_DIR /home/${user_name}/tools/geographic/lib/cmake/GeographicLib)

About

This repository gives and C++ code to transform WGS84 to UTM coordinates using ROS framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published