Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Correct velocity frame for fake_gps. #1722

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jgoppert
Copy link
Member

@jgoppert jgoppert commented Mar 8, 2022

Closes Issue #1719

Do not merge yet, awaiting flight test.

mavros_extras/src/plugins/fake_gps.cpp Outdated Show resolved Hide resolved
@vooon vooon added this to the Version 1.14 milestone Mar 8, 2022
@Alefunk
Copy link

Alefunk commented Mar 30, 2022

Hey, i just noticed that the whole ECEF transformation is obsolete with this change. You could simply use ENU instead of ECEF as function argument in send_fake_gps() and remove the member variable ecef_origin completely.
To still have access to the local geodetic variable in send_fake_gps() use this function as described here:

const GeographicLib::Geocentric& earth = GeographicLib::Geocentric::WGS84();
GeographicLib::LocalCartesian proj(map_origin.x(), map_origin.y(), map_origin.z(), earth);
proj.Reverse(pos_enu.x(), pos_enu.y(), pos_enu.z(), geodetic.x(), geodetic.y(), geodetic.z());

Because the ellipsoid height will be returned, it is necessary to convert the height to the geoid height like here or by using the mavros function:

geodetic.z() += m_uas->ellipsoid_to_geoid_height(...);

Don't forget to convert the enu coordinates into ned coordinates with the build in mavros helper function (ftf::transform_frame_enu_ned(pos_enu);).

@vooon vooon modified the milestones: Version 1.14, Version 1.15 Sep 24, 2022
@vooon vooon modified the milestones: Version 1.15, Version 1.16 Dec 30, 2022
@vooon vooon modified the milestones: Version 1.16, Version 1.17 May 5, 2023
@vooon vooon modified the milestones: Version 1.17, Version 1.18 Sep 9, 2023
@vooon vooon modified the milestones: Version 1.18, Version 1.19 Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants