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

gnss_poser does not parse MGRS zone correctly #2085

Closed
3 tasks done
VRichardJP opened this issue Oct 17, 2022 · 1 comment
Closed
3 tasks done

gnss_poser does not parse MGRS zone correctly #2085

VRichardJP opened this issue Oct 17, 2022 · 1 comment
Assignees
Labels
component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) type:bug Software flaws or errors.

Comments

@VRichardJP
Copy link
Contributor

Checklist

  • I've read the contribution guidelines.
  • I've searched other issues and no duplicate issues were found.
  • I'm convinced that this is not my fault but a bug.

Description

In GNSSStat, there is no support for MGRS zone (e.g. "53SPU"). There is a int zone which can be used for utm zone, but MGRS would need a string.

Yet, in the UTM2MGRS function, the MGRS zone (e.g. "53SPU") is converted to int using stod:

mgrs.zone = std::stod(mgrs_code.substr(0, GZD_ID_size));

There are 2 problems with this piece of code:

  1. since zone is a int, it is strange to use stod instead not stoi
  2. std::stod("53SPU") returns 53.0, which looses the second part of the code SPU

Although the value mgrs.zone is not used elsewhere in gnss_poser, it could cause some issue in the future.

Expected behavior

N/A

Actual behavior

N/A

Steps to reproduce

N/A

Versions

No response

Possible causes

No response

Additional context

No response

@YamatoAndo YamatoAndo added type:bug Software flaws or errors. component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) labels Oct 17, 2022
@YamatoAndo
Copy link
Contributor

@VRichardJP Thank you for the report.
You are right, there are problems with this code.
Can you please issue a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) type:bug Software flaws or errors.
Projects
None yet
Development

No branches or pull requests

2 participants