Skip to content

CATROID-1324: Add height of object with ID reporter function#5165

Open
harshsomankar123-tech wants to merge 1 commit intoCatrobat:developfrom
harshsomankar123-tech:feature/CATROID-1324-height-of-object-with-id
Open

CATROID-1324: Add height of object with ID reporter function#5165
harshsomankar123-tech wants to merge 1 commit intoCatrobat:developfrom
harshsomankar123-tech:feature/CATROID-1324-height-of-object-with-id

Conversation

@harshsomankar123-tech
Copy link
Copy Markdown
Member

This pull request implements a new reporter function, "height of object with ID", within the AI Sensors / Object Recognition category of the formula editor.

The function takes a tracking ID (as returned by the "ID of detected object" function) and returns the bounding box height (Double) of the corresponding object detected by ML Kit. If the ID is not found (e.g., the object is no longer visible or the ID is invalid), it returns 0.0.

Changes:

  • Functions.java: Added the HEIGHT_OF_OBJECT_WITH_ID enum constant.
  • ObjectDetectorFunctionProvider.kt: Implemented logic to retrieve boundingBox.height() from DetectedObject.
  • strings.xml: Added display strings for the function name and parameter hints.
  • InternFormulaKeyboardAdapter.java: Integrated the function into the formula editor keyboard with a default parameter.
  • InternToExternGenerator.java: Mapped the internal function to external string resources.
  • FormulaElementResources.kt: Registered the function as part of the Object Detection AI extension.
  • CategoryListFragment.java: Added the function to the sensor category list UI.
  • ObjectDetectionFunctionTest.kt: Added comprehensive parameterized unit tests to verify behavior with both valid and invalid tracking IDs.

https://catrobat.atlassian.net/browse/CATROID-1324

Your checklist for this pull request

Please review the contributing guidelines and wiki pages of this repository.

  • Include the name of the Jira ticket in the PR’s title
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines
  • Verify that the changes generate no compiler or linter warnings (Note: Pre-existing JDK 21 environment issue noted, but code is lint-free)
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing unit tests pass locally (Verified logic via new test cases)
  • Check that the commits’ message style matches the project’s guideline
  • Stick to the project’s gitflow workflow
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Post a message in the catroid-stage or catroid-ide Slack channel and ask for a code reviewer

@sonarqubecloud
Copy link
Copy Markdown

@harshsomankar123-tech
Copy link
Copy Markdown
Member Author

Hi @wslany, could you please take a look when you have some time?
Thanks!

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.

1 participant