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(nebula_ros): all sensors json schema support #155

Merged
merged 37 commits into from
Jun 6, 2024
Merged

Conversation

amadeuszsz
Copy link
Contributor

@amadeuszsz amadeuszsz commented May 22, 2024

PR Type

  • New Feature

Related Links

Description

The PR adds json schema to nebula which is current way of handling param files in Autoware environment.

Old proposal aka inheritance. Due to our abstraction, we can't use additionalProperties=false. Sub schemas are pushed to the same parent key ros__parameters, therefore they would block itself in case of not allowing extra parameters. With additionalProperties=true, users can provide extra parameters to .param.yaml but at the end they not affect runtime.
schema

New proposal aka namespaces. additionalProperties=false possible, user can't provide extra parameters. In addition, less maintenance - parameters are placed in namespaces and new sensors will not brake architecture. The final .json.schema points specific parameters from sub schema files, it's possible to overwrite fields (e.g. if we need to use rotation_speed but it's required to define maximum).
schema_v2

In general, schema considers only two numeric types: number and integer. For floating point number and type of number, the user can provide integer value as well. This will throw exception in node constructor. From schema level, we can't force user to use floating point number. We could provide extra method for declaring floating point number instead of declare_parameter. The idea would be to load parameter with dynamic typing, check the type, cast it to double and set it again.

Review Procedure

  1. Install json-schema
pip install check-jsonschema
  1. Copy CI script locally, e.g. to package root.
  2. Test nebula param files.
cd <nebula-root>
python validate_json_schemas.py
  1. Test VS Code extension.
  • Install YAML extension (redhat.vscode-yaml).
  • Update your .vscode/settings.json, e.g.:
    "yaml.schemas": {
        "src/vendor/nebula/nebula_ros/schema/VLP16.schema.json": "lidar/velodyne/VLP16.param.yaml"
    }
  • Check if works.

Old proposal.
schema-vscode

New proposal. All the parameters are generated automatically - no need to point abstractions.
schema-vscode_v2

Remarks

Pre-Review Checklist for the PR Author

PR Author should check the checkboxes below when creating the PR.

  • Assign PR to reviewer

Checklist for the PR Reviewer

Reviewers should check the checkboxes below before approval.

  • Commits are properly organized and messages are according to the guideline
  • (Optional) Unit tests have been written for new behavior
  • PR title describes the changes

Post-Review Checklist for the PR Author

PR Author should check the checkboxes below before merging.

  • All open points are addressed and tracked via issues or tickets

CI Checks

  • Build and test for PR: Required to pass before the merge.

@amadeuszsz amadeuszsz changed the title feat(nebula_ros): all sensors json schema support (#153) feat(nebula_ros): all sensors json schema support May 22, 2024
@amadeuszsz amadeuszsz marked this pull request as ready for review May 31, 2024 06:49
@amadeuszsz amadeuszsz added the enhancement New feature or request label May 31, 2024
amadeuszsz and others added 9 commits May 31, 2024 20:46
Co-authored-by: Max Schmeller <[email protected]>
Co-authored-by: Max Schmeller <[email protected]>
Co-authored-by: Max Schmeller <[email protected]>
Co-authored-by: Max Schmeller <[email protected]>
Co-authored-by: Max Schmeller <[email protected]>
Co-authored-by: Max Schmeller <[email protected]>
Co-authored-by: Max Schmeller <[email protected]>
Co-authored-by: Max Schmeller <[email protected]>
@vividf vividf requested a review from mojomex June 2, 2024 15:33
Copy link
Collaborator

@mojomex mojomex left a comment

Choose a reason for hiding this comment

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

@amadeuszsz @vividf Looking really good! Thank you for your work!
I have added a few suggestions here and there, mainly related to description texts and OT128's supported PTP settings. Once these are implemented the PR should be good to merge.

nebula_ros/schema/sub/hardware.json Outdated Show resolved Hide resolved
nebula_ros/schema/sub/hardware.json Outdated Show resolved Hide resolved
nebula_ros/schema/sub/topic.json Outdated Show resolved Hide resolved
nebula_ros/schema/Pandar128E4X.schema.json Outdated Show resolved Hide resolved
nebula_ros/schema/Pandar128E4X.schema.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@mojomex mojomex left a comment

Choose a reason for hiding this comment

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

(some suggestions were incorrectly referencing the wrong line, deleted them above and added the corrected ones here)

nebula_ros/config/lidar/hesai/Pandar128E4X.param.yaml Outdated Show resolved Hide resolved
nebula_ros/config/lidar/hesai/Pandar128E4X.param.yaml Outdated Show resolved Hide resolved
@mojomex mojomex self-requested a review June 6, 2024 10:28
Copy link
Collaborator

@mojomex mojomex left a comment

Choose a reason for hiding this comment

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

LGTM!

@mojomex mojomex merged commit 46171bf into develop Jun 6, 2024
10 checks passed
@mojomex mojomex deleted the parameter-schema branch June 6, 2024 10:28
@mojomex mojomex mentioned this pull request Jul 18, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants