GithubHelp home page GithubHelp logo

ethz-asl / geodetic_utils Goto Github PK

View Code? Open in Web Editor NEW
238.0 41.0 105.0 1017 KB

Simple library for converting coordinates to/from several geodetic frames (lat/lon, ECEF, ENU, NED, etc.)

C++ 83.26% CMake 4.22% Python 10.65% Shell 1.86%

geodetic_utils's Introduction

There are now 2 different geodetic libraries:

  • The new geotf that supports any type of geodetic coordinate system (WGS84, UTM, CH1903, ENU etc) and can convert between tf and geodetic frames as well. Geotf is based on gdal (https://gdal.org) and thus needs libgdal to be installed.
  • The usual geodetic_utils for simple conversions without many external dependencies

geodetic_utils's People

Contributors

clanegge avatar enricgalceran avatar fmina avatar lorenwel avatar marco-tranzatto avatar michaelpantic avatar raghavkhanna avatar rikba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geodetic_utils's Issues

rosdep installation for GDAL fails

rosdep with geodetic_utils does not work properly. Seems like the <depends> tag is not correct.

ERROR: the following packages/stacks could not have their rosdep keys resolved

to system dependencies:

geotf: Cannot locate rosdep definition for [GDAL]

This fails for kinetic and melodic.

This can be solved by installing libgdal-dev on the system, but would be easier to integrate into the ros-industrial-ci if it can work with rosdep installations.

CMake error

With the current CMakeLists.txt, upon using the command catkin_make, I am getting CMake error.
I am new to ROS.
I am unable to use this package.
I want to convert lat&lon to ECEF to ned coordinates.
Please help.

bug in geodetic2Enu

Hi,
As mentioned in #30 and #28 the conversion between geodetic and ENU produce some error.
I did the following test:
image
since the reference longitude and latitude is the same as the longitude and latitude the expected ENU coordinate should be (0,0,100), but the code result in 0.237m error in y direction

after I change the line 55
ecef_to_ned_matrix_ = nRe(phiP, initial_longitude_);
to
ecef_to_ned_matrix_ = nRe(initial_latitude_, initial_longitude_);
the code works well:
image

and my question is the conversion between geodesic and ENU should be an invertable function why the original code compute the geocentric latitude "phiP" to compute the ecef_to_ned_matrix_ but use geodetic latitude "initial_latitude_" to compute the ned_to_ecef_matrix_ ? Did I missed something important?

Miller

ned2geodetic returns wrong altitude for +ve values of down

In NED +down values should decrease the altitude however when converting to geodetic it returns +ve altitude instead. If you look at the equations in ecef2geodetic then it can be easily seen that returned altitude value will always be positive. I think this happens because sqrt(x) is supposed to be +/- value but in code we always end up using only + value.

License

Hi, could you please specify license for this code? Is it BSD like rest of the ETH code?

Thanks.

Pose messages

gps_to_pose_conversion node publishes GPS pose messages with orientation which are not being used in our programs. Should we modify this to publish position only? @enricgalceran

ECEF-to-NED initial latitude?

In GeodeticConverter::initializeReference() the ecef_to_ned_matrix_ is defined using double phiP = atan2(initial_ecef_z_, sqrt(pow(initial_ecef_x_, 2) + pow(initial_ecef_y_, 2))); as the latitude.

Doesn't this imply a geocentric latitude instead of geodetic latitude? Why isn't the geodetic initial_latitude_ used, like in the reverse ned_to_ecef_matrix_?

[geotf] ENU frame projection error

The orthographic projection causes a non-neglectable error when converting geodetic to ENU coordinates.

The current projection should be replaced by a topocentric projection, i.e.,

char enu_proj[250];
sprintf(enu_proj, "+proj=topocentric +ellps=WGS84 +lon_0=%.15f +lat_0=%.15f +h_0=%.15f", lon, lat, alt);
spatial_ref->importFromProj4(enu_proj);

See https://proj.org/operations/conversions/topocentric.html

Unfortunately, this is only available with PROJ4 >= 8.0.0 which is only available with Ubuntu 22.04.

For now one can use the deprecated geodetic_utils for example, but should correct the bug #36

/gps_pose having wrong orientation values

I am running "gps_to_pose_conversion_node.cpp" to get a pose, but It isn't updating the orientation values on the /gps_pose . As I move the GPS I can see it changing the position values, but when I move the IMU sensor it doesn't change the orientation values.

When I check the /tf message, it shows the rotation values as NAN.

Have anyone had this problem before?

Conversion of lat & lon to ECEF coordinates

I want to convert latitude and longitude provided by the gps to ECEF coordinates and further convert them to NED coordinates.
What are the steps to do that?
I am new to ROS.

Upon using command
rosrun geodetic_utils set_gps_reference_node
I am getting,

[ INFO] [1516291269.537867694]: Usage: set_gps_reference [n_fixes] [average|wait], defaults: n_fixes=50, average
[ INFO] [1516291269.537931520]: Taking 2 measurements and averaging to get the reference

Then using the command,
rosrun geodetic_utils gps_to_pose_conversion_node
I am getting,

[ INFO] [1516295811.468117753]: Waiting for GPS reference parameters...
[ INFO] [1516295811.468581024]: GPS reference not ready yet, use set_gps_reference_node to set it

Publish static transforms

Our geotf object knows a transformation between the cartesian frames ECEF and ENU. Can it somehow broadcast this TF transform?

Something like

geotf_.addFrameByEPSG("ecef", 4978);
geotf_.addFrameByENUOrigin("enu", lat, lon, alt);
geotf_.publishTf("ecef", "enu");

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.