-
Notifications
You must be signed in to change notification settings - Fork 129
Add PersonSkeleton common type and skeleton field for Occupant #899
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
Draft
jdsika
wants to merge
1
commit into
master
Choose a base branch
from
feature/occupant-skeleton
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| # Copilot Instructions for Open Simulation Interface (OSI) | ||
|
|
||
| ## Overview | ||
|
|
||
| OSI is a Protocol Buffers (proto2) interface specification for environmental perception of automated driving functions. All `.proto` files use `syntax = "proto2"`, `option optimize_for = SPEED`, and belong to `package osi3`. | ||
|
|
||
| ## Build & Test | ||
|
|
||
| **Run all tests:** | ||
|
|
||
| ```sh | ||
| pip install pyyaml | ||
| python -m unittest discover tests | ||
| ``` | ||
|
|
||
| **Run a single test file or test case:** | ||
|
|
||
| ```sh | ||
| python -m unittest tests.test_rules | ||
| python -m unittest tests.test_rules.TestRules.test_rules_compliance | ||
| ``` | ||
|
|
||
| **Validate proto compilation** (requires `grpcio-tools`): | ||
|
|
||
| ```sh | ||
| python -m grpc_tools.protoc --proto_path=. --python_out=. osi_common.proto osi_occupant.proto | ||
| ``` | ||
|
|
||
| **Build Doxygen docs** (requires CMake, Doxygen, proto2cpp): | ||
|
|
||
| ```sh | ||
| mkdir build && cd build | ||
| cmake -D FILTER_PROTO2CPP_PY_PATH=<path-to-proto2cpp> ../ | ||
| cmake --build . --config Release | ||
| ``` | ||
|
|
||
| ## Architecture | ||
|
|
||
| ### Proto Dependency Hierarchy | ||
|
|
||
| ``` | ||
| osi_version.proto.in (template → osi_version.proto via CMake) | ||
| ↓ | ||
| osi_common.proto (primitives: Vector3d, Timestamp, Identifier, BoundingBox, etc.) | ||
| ↓ | ||
| building blocks (osi_object, osi_lane, osi_environment, osi_trafficsign, osi_trafficlight, | ||
| osi_roadmarking, osi_occupant, osi_logicallane, osi_referenceline, osi_route, …) | ||
| ↓ | ||
| top-level containers (see below) | ||
| ``` | ||
|
|
||
| ### Top-Level Container Messages | ||
|
|
||
| | Message | File | Role | | ||
| |---------|------|------| | ||
| | `GroundTruth` | `osi_groundtruth.proto` | Complete simulated environment state | | ||
| | `SensorView` | `osi_sensorview.proto` | Input to a sensor model (GroundTruth + config) | | ||
| | `SensorData` | `osi_sensordata.proto` | Output of a sensor model (detected entities) | | ||
| | `HostVehicleData` | `osi_hostvehicledata.proto` | Vehicle's own internal state perception | | ||
| | `StreamingUpdate` | `osi_streamingupdate.proto` | Partial/incremental updates | | ||
| | `SensorDataSeries` | `osi_datarecording.proto` | Time-series recording wrapper | | ||
|
|
||
| ### Detected vs Ground Truth Pattern | ||
|
|
||
| Ground truth entities (e.g. `MovingObject`, `Occupant`, `Lane`) live in `GroundTruth`. Each has a corresponding `Detected*` message (e.g. `DetectedMovingObject`, `DetectedOccupant`, `DetectedLane`) in `SensorData` that wraps a list of candidates with probabilities. | ||
|
|
||
| ## Proto Commenting Conventions | ||
|
|
||
| Every message, enum, and field **must** have a comment. CI tests enforce this. | ||
|
|
||
| ### Messages and Enums | ||
|
|
||
| Must start with `\brief` on a separate comment line: | ||
|
|
||
| ```proto | ||
| // | ||
| // \brief A cartesian 3D vector for positions, velocities or accelerations. | ||
| // | ||
| // The coordinate system is defined as right-handed. | ||
| // | ||
| message Vector3d | ||
| { | ||
| ``` | ||
|
|
||
| ### Fields | ||
|
|
||
| Minimum 2 comment lines (content + blank `//`). Units on a separate line: | ||
|
|
||
| ```proto | ||
| // The number of seconds since start. | ||
| // | ||
| // Unit: s | ||
| // | ||
| optional int64 seconds = 1; | ||
| ``` | ||
|
|
||
| ### Validation Rules | ||
|
|
||
| Wrap in `\rules` / `\endrules` blocks. Available rules are defined in `rules.yml`: | ||
|
|
||
| ```proto | ||
| // \rules | ||
| // is_greater_than_or_equal_to: 0 | ||
| // is_less_than_or_equal_to: 999999999 | ||
| // \endrules | ||
| ``` | ||
|
|
||
| Available rule keywords: `is_greater_than`, `is_greater_than_or_equal_to`, `is_less_than`, `is_less_than_or_equal_to`, `is_equal_to`, `is_different_to`, `is_globally_unique`, `refers_to`, `is_iso_country_code`, `first_element`, `last_element`, `check_if ... else do_check`, `is_set`, `minimum_length`, `maximum_length`. | ||
|
|
||
| ### Other Doxygen Markers | ||
|
|
||
| - `\note` — important notes | ||
| - `\attention` — deprecation warnings | ||
| - `\c TypeName` — inline code/type reference | ||
| - `\image html filename.svg "caption" width=550px` — image reference | ||
| - `\b text` — bold | ||
|
|
||
| ## Code Style | ||
|
|
||
| Defined in `.clang-format`: Google base style, 4-space indent, 80-column limit, Allman braces (`{` on new line), no tabs. | ||
|
|
||
| ## Versioning | ||
|
|
||
| `VERSION` file holds `VERSION_MAJOR`, `VERSION_MINOR`, `VERSION_PATCH`. CMake substitutes these into `osi_version.proto.in` → `osi_version.proto`. Current version: **3.8.0**. | ||
|
|
||
| ## CI Pipeline | ||
|
|
||
| GitHub Actions (`protobuf.yml`) runs on push/PR to master: | ||
| 1. **Spellcheck** — aspell via pyspelling (custom wordlist at `.github/spelling_custom_words_en_US.txt`) | ||
| 2. **Tests** — `python -m unittest discover tests` | ||
| 3. **Doxygen build** — generates API docs from proto comments | ||
|
|
||
| ## Key Conventions | ||
|
|
||
| - All proto field numbers are stable — never reuse or renumber existing fields. | ||
| - `repeated` fields use singular names (e.g. `repeated WheelData wheel_data`, not `wheel_datas`). | ||
| - Enum values are prefixed with the enum type in UPPER_SNAKE_CASE (e.g. enum `Seat` → `SEAT_FRONT_LEFT`). | ||
| - IDs use the `Identifier` message type and are typically `is_globally_unique`. | ||
| - Cross-references between entities use `refers_to` rules (e.g. `refers_to: MovingObject`). | ||
| - Coordinate system is right-handed, following ISO 8855 for vehicles. | ||
| - Bounding box offsets follow the `bbcenter_to_*` naming pattern (e.g. `bbcenter_to_rear`, `bbcenter_to_root`). | ||
| - PRs require DCO sign-off and "ReadyForCCBReview" label for Change Control Board review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this from the PR as it has nothing to do with the skeleton field.