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

Projector forward convert error #370

Open
jianhuaz opened this issue Oct 24, 2024 · 3 comments
Open

Projector forward convert error #370

jianhuaz opened this issue Oct 24, 2024 · 3 comments

Comments

@jianhuaz
Copy link

When debugging AutoWare Universe, I found that the calculation result was wrong. May I ask which part was wrong?

map_projector_info.yaml

projector_type: TransverseMercator
vertical_datum: WGS84
map_origin:
latitude: 27.855293457897343
longitude: 113.68145973280252
altitude: 62.200000

C++ Code

LocalPoint project_forward(const GeoPoint & geo_point, const MapProjectorInfo & projector_info)
{
std::unique_ptrlanelet::Projector projector = get_lanelet2_projector(projector_info);
lanelet::GPSPoint position{geo_point.latitude, geo_point.longitude, geo_point.altitude};

lanelet::BasicPoint3d projected_local_point;

projected_local_point = projector->forward(position);

projected_local_point.z() = geo_point.altitude - projector_info.map_origin.altitude;

LocalPoint local_point;

local_point.x = projected_local_point.x();
local_point.y = projected_local_point.y();
local_point.z = projected_local_point.z();

return local_point;
}

convert the result

geo_point.latitude::::27.858572 ---> projected_local_point.x:-532.046651
geo_point.longitude::::113.676056 ---> projected_local_point.y:363.137080

lanelet2_map.osm

...

...

<nd ref="71"/>
<nd ref="72"/>
<nd ref="73"/>
<tag k="type" v="line_thin"/>
<tag k="subtype" v="solid"/>
...

<nd ref="139"/>
<nd ref="140"/>
<nd ref="141"/>
<tag k="type" v="line_thin"/>
<tag k="subtype" v="solid"/>
@jianhuaz
Copy link
Author

lanelet2_map.osm

...

...

<nd ref="71"/>
<nd ref="72"/>
<nd ref="73"/>
<tag k="type" v="line_thin"/>
<tag k="subtype" v="solid"/>
...

<nd ref="139"/>
<nd ref="140"/>
<nd ref="141"/>
<tag k="type" v="line_thin"/>
<tag k="subtype" v="solid"/>

@poggenhans
Copy link
Contributor

Why do you think it's wrong?

@jianhuaz
Copy link
Author

@poggenhans hi, It doesn't match the actual scene. Should GNSS bias be considered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants