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): add json schema #153

Merged

Conversation

amadeuszsz
Copy link
Contributor

@amadeuszsz amadeuszsz commented May 21, 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. The proposed changes consider schema composition based on few abstractions:
schema
The contains of specific abstraction may still change. The schema for now brings two drawbacks:

  • 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 considers only two numeric types: number and integer. Therefore 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.
    schema-vscode

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.

mojomex and others added 30 commits March 28, 2024 20:10
* check PTC command error codes, throw exception if necessary
* perform size checks before parsing responses
* emit errors on too-large payload size
This is step one of the single node refactoring of Nebula.
In this step, only the three Hesai wrapper nodes were combined into one, and no optimizations have been done that are made possible by this refactoring.

The next step is to do those optimizations (e.g. get rid of unnecessary pointcloud copying).
mojomex and others added 19 commits May 22, 2024 14:23
@amadeuszsz amadeuszsz requested review from vividf and removed request for mojomex May 22, 2024 05:48
@amadeuszsz amadeuszsz self-assigned this May 22, 2024
@mojomex mojomex merged commit ad67d06 into tier4:parameter-schema May 22, 2024
9 checks passed
mojomex added a commit that referenced this pull request May 22, 2024
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

Successfully merging this pull request may close these issues.

4 participants