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

EnuCoor_i and NedCoor_i units #2715

Open
Fabien-B opened this issue May 6, 2021 · 3 comments
Open

EnuCoor_i and NedCoor_i units #2715

Fabien-B opened this issue May 6, 2021 · 3 comments
Labels
Airborne New Feature To draft up an idea for a new feature in issue que Refactoring

Comments

@Fabien-B
Copy link
Contributor

Fabien-B commented May 6, 2021

EnuCoor_i structures can be expressed in INT32_POS_FRAC or centimeters, and its not always clear which unit is used.
I think its a huge risk to introduce bugs.
I would suggest reserving this struct for INT32_POS_FRAC coordinates, and make a new structure EnuCoorCm_i if centimeters are needed, to reduce the risk of errors.

Does anyone have an other suggestion ?

Example were it can be found:

enu_of_lla_point_i(&enu, &state.ned_origin_i, &waypoints[wp_id].lla);
// convert ENU pos from cm to BFP with INT32_POS_FRAC
enu.x = POS_BFP_OF_REAL(enu.x) / 100;
enu.y = POS_BFP_OF_REAL(enu.y) / 100;
enu.z = POS_BFP_OF_REAL(enu.z) / 100;
waypoints[wp_id].enu_i = enu;

@fvantienen
Copy link
Member

I didn't know this problem existed. But seems like a good solution.
For me personally I prefer to do most calculations in float, since almost all autopilots can easily compute floats.

@gautierhattenberger
Copy link
Member

Using float is mainly a matter of rewriting a lot of navigation, control and estimation code...

@fvantienen
Copy link
Member

I was not meaning to really rewrite most of the code, but more if new code is made or code is refactored I don't mind anymore if it is only made using float's. Since it avoid's a lot of error's and mistakes with converting and precision etc.

@OpenUAS OpenUAS added New Feature To draft up an idea for a new feature in issue que Refactoring labels Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Airborne New Feature To draft up an idea for a new feature in issue que Refactoring
Projects
None yet
Development

No branches or pull requests

4 participants