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

feat(autoware_lanelet2_divider): add lanelet2 divider tool #130

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

StepTurtle
Copy link

Description

Port lanelet2-map-tile-generator to autoware_tools with name autoware_lanelet2_divider.

cc. @ataparlar @YamatoAndo

Related links

Tests performed

Notes for reviewers

Interface changes

Effects on system behavior

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

Signed-off-by: Barış Zeren <[email protected]>
@StepTurtle StepTurtle mentioned this pull request Oct 4, 2024
5 tasks
@YamatoAndo YamatoAndo self-requested a review October 7, 2024 04:22
Copy link

@wenrir wenrir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments that might be irrelevant (please ignore if so), thank you for your consideration.

@wenrir
Copy link

wenrir commented Nov 7, 2024

@StepTurtle thank you for considering my review, I'm not able to resolve my own comments so please feel free to resolve/remove them.

return True


def complete_missing_version_tag(input_osm_file_path: str):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of adding a version tag?

whole_map_xml = ET.parse(input_osm_file_path)
whole_map_root = whole_map_xml.getroot()

add_version = any(root_element != "version" for root_element in whole_map_root.attrib)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it set to update as long as even one non-version element is found?
In this code, it updates even if there is a version tag, as long as there are other elements present.

add_version = any(root_element != "version" for root_element in whole_map_root.attrib)

if add_version:
whole_map_root.set("version", "0.6")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the version fixed to 0.6?
I’d like to know the reason for choosing 0.6.

add_version = False
break
if add_version:
element.set("version", "1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the version fixed to 1?
And I’d like to understand the reason behind adding the version tag to each element. Why?

if add_version:
element.set("version", "1")

whole_map_xml.write(input_osm_file_path, encoding="utf-8", xml_declaration=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid directly modifying the input file.
Could you revise the implementation to create a new temporary file instead?

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.

4 participants