Gestures in the CB. #36

Merged
9828273 merged 16 commits from feat/cb2ri-gestures into dev 2025-12-16 09:24:26 +00:00
9828273 commented 2025-12-09 14:44:19 +00:00 (Migrated from git.science.uu.nl)

ref: N25B-334

To verify:

  • Style checks pass
  • Pipeline (tests) pass
  • Documentation is up to date
  • Tests are up to date (new code is covered)

Yeah, to actually test this you need to be at pepper, and launch both the UI and RI (with the RI on the correct network and having the correct qi-url). Without going to pepper you could test:

  • Fetching the gestures gives an empty list (we're not connected).

  • Do gesture does work, at least it gives a print statement in the RI. Note that an error could occur when trying to send it to pepper, due to not having a qi session:)

  • Check that the tests make sense

  • New:
    With the new threads applied, the endpoints are changed. This means that all the testing should be done on a branch of the UI where these changes are also reflected (which they now are in the gestures branch).

  • After the threads everything also works.

ref: N25B-334 To verify: - [x] Style checks pass - [x] Pipeline (tests) pass - [x] Documentation is up to date - [x] Tests are up to date (new code is covered) Yeah, to actually test this you need to be at pepper, and launch both the UI and RI (with the RI on the correct network and having the correct qi-url). Without going to pepper you could test: - [x] Fetching the gestures gives an empty list (we're not connected). - [x] Do gesture `does` work, at least it gives a print statement in the RI. Note that an error could occur when trying to send it to pepper, due to not having a qi session:) - [x] Check that the tests make sense - New: With the new threads applied, the endpoints are changed. This means that all the testing should be done on a branch of the UI where these changes are also reflected (which they _now_ are in the gestures branch). - [x] After the threads everything also works.
9828273 commented 2025-12-09 14:44:19 +00:00 (Migrated from git.science.uu.nl)

assigned to @9828273

assigned to @9828273
8464960 commented 2025-12-11 11:34:58 +00:00 (Migrated from git.science.uu.nl)

requested review from @8464960

requested review from @8464960
8464960 (Migrated from git.science.uu.nl) changed target branch from main to dev 2025-12-11 11:39:56 +00:00
9828273 commented 2025-12-11 11:46:41 +00:00 (Migrated from git.science.uu.nl)

added 8 commits

  • 7f34fede...2366255b - 7 commits from branch dev
  • 1c9b722b - Merge branch 'dev' into feat/cb2ri-gestures

Compare with previous version

added 8 commits <ul><li>7f34fede...2366255b - 7 commits from branch <code>dev</code></li><li>1c9b722b - Merge branch &#39;dev&#39; into feat/cb2ri-gestures</li></ul> [Compare with previous version](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135767&start_sha=7f34fede81ddea4ee4dab756b235adf77abc0152)
9828273 commented 2025-12-11 11:48:25 +00:00 (Migrated from git.science.uu.nl)

added 1 commit

  • 2e472ea2 - chore: remove wrong test paths

Compare with previous version

added 1 commit <ul><li>2e472ea2 - chore: remove wrong test paths</li></ul> [Compare with previous version](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135769&start_sha=1c9b722ba387576aa4e570032042c019c1dea19d)
8464960 commented 2025-12-11 12:03:43 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Pipeline (tests) pass as completed

marked the checklist item **Pipeline (tests) pass** as completed
0950726 commented 2025-12-11 13:30:21 +00:00 (Migrated from git.science.uu.nl)

FastAPI uses the types in the function signature for model checking:

async def receive_command(command: SpeechCommand, request: Request):

If the given command is not a valid SpeechCommand, FastAPI should reject the request before this function even gets called.

For now it works because a GestureCommand is a sort of subset of SpeechCommand, but if SpeechCommand changes, this may no longer be the case.

I suggest making two endpoints, for example /command/speech and /command/gesture.

FastAPI uses the types in the function signature for model checking: ``` async def receive_command(command: SpeechCommand, request: Request): ``` If the given command is not a valid `SpeechCommand`, FastAPI should reject the request before this function even gets called. For now it works because a `GestureCommand` is a sort of subset of `SpeechCommand`, but if `SpeechCommand` changes, this may no longer be the case. I suggest making two endpoints, for example `/command/speech` and `/command/gesture`.
0950726 commented 2025-12-11 13:34:37 +00:00 (Migrated from git.science.uu.nl)

The "get" in /get_... is superflous because it's an HTTP GET endpoint. We should probably define standards for URL naming conventions, but I'd say a conventional name would be "/command/gesture/tags".

The "get" in `/get_...` is superflous because it's an HTTP GET endpoint. We should probably define standards for URL naming conventions, but I'd say a conventional name would be "/command/gesture/tags".
0950726 commented 2025-12-11 13:37:03 +00:00 (Migrated from git.science.uu.nl)

Can be done with a query parameter, e.g. "/command/gesture/tags?count=<number>"

Can be done with a [query parameter](https://fastapi.tiangolo.com/tutorial/query-params/), e.g. "/command/gesture/tags?count=\<number\>"
0950726 commented 2025-12-11 13:41:34 +00:00 (Migrated from git.science.uu.nl)

You could use req_socket.recv_json() to merge this with the next step.

You could use `req_socket.recv_json()` to merge this with the next step.
0950726 commented 2025-12-11 13:44:52 +00:00 (Migrated from git.science.uu.nl)

This ri_command_address is not actually something that we can know beforehand, we only know it from the negotiation. I've removed the setting in the feat/environment-variables branch, so it'll have to be removed here as well when that's merged.

        address: str,

The suggested change will break unit tests because there is no longer a default, which the tests assume.

This `ri_command_address` is not actually something that we can know beforehand, we only know it from the negotiation. I've removed the setting in the feat/environment-variables branch, so it'll have to be removed here as well when that's merged. ```suggestion:-0+0 address: str, ``` The suggested change will break unit tests because there is no longer a default, which the tests assume.
0950726 commented 2025-12-11 13:47:08 +00:00 (Migrated from git.science.uu.nl)

You may reject this :P

        self.gesture_data = gesture_data or []
You may reject this :P ```suggestion:-3+0 self.gesture_data = gesture_data or [] ```
0950726 commented 2025-12-11 13:56:29 +00:00 (Migrated from git.science.uu.nl)

Please move this address to the config file

Please move this address to the config file
8464960 commented 2025-12-11 14:40:45 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Do gesture does work, at least it gives a print statement in the RI. Note that an error could occur when trying to send it to pepper, due to not having a qi session:) as completed

marked the checklist item **Do gesture `does` work, at least it gives a print statement in the RI. Note that an error could occur when trying to send it to pepper, due to not having a qi session:)** as completed
8464960 commented 2025-12-11 14:43:29 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Fetching the gestures gives an empty list (we're not connected). as completed

marked the checklist item **Fetching the gestures gives an empty list (we're not connected).** as completed
8464960 commented 2025-12-11 14:49:57 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Style checks pass as completed

marked the checklist item **Style checks pass** as completed
8464960 commented 2025-12-11 14:51:32 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Documentation is up to date as completed

marked the checklist item **Documentation is up to date** as completed
8464960 commented 2025-12-11 14:58:08 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Tests are up to date (new code is covered) as completed

marked the checklist item **Tests are up to date (new code is covered)** as completed
8464960 commented 2025-12-11 14:58:10 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Check that the tests make sense as completed

marked the checklist item **Check that the tests make sense** as completed
8464960 commented 2025-12-11 15:01:26 +00:00 (Migrated from git.science.uu.nl)

Small detail: this should be "It receives gesture commands"

    It receives gesture commands from other agents or from the UI,
Small detail: this should be "It receives gesture commands" ```suggestion:-0+0 It receives gesture commands from other agents or from the UI, ```
8464960 commented 2025-12-11 15:01:26 +00:00 (Migrated from git.science.uu.nl)

I tested it both with and without Pepper and it works great!

If you resolve the current threads (and as Twirre said, move the adresses to the config file), you have my approval.

I tested it both with and without Pepper and it works great! If you resolve the current threads (and as Twirre said, move the adresses to the config file), you have my approval.
8464960 commented 2025-12-11 15:01:27 +00:00 (Migrated from git.science.uu.nl)

left review comments

left review comments
9828273 commented 2025-12-11 15:14:27 +00:00 (Migrated from git.science.uu.nl)

changed this line in version 5 of the diff

changed this line in [version 5 of the diff](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135785&start_sha=2e472ea292586b6eb2c390d09e221e3877e641f4#263dfe717551994421f8b00d361780afe2d3e8a0_15_15)
9828273 commented 2025-12-11 15:14:29 +00:00 (Migrated from git.science.uu.nl)

added 1 commit

  • b2d01475 - Apply 1 suggestion(s) to 1 file(s)

Compare with previous version

added 1 commit <ul><li>b2d01475 - Apply 1 suggestion(s) to 1 file(s)</li></ul> [Compare with previous version](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135785&start_sha=2e472ea292586b6eb2c390d09e221e3877e641f4)
9828273 commented 2025-12-15 10:36:16 +00:00 (Migrated from git.science.uu.nl)

changed this file in version 6 of the diff

changed this file in [version 6 of the diff](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135978&start_sha=b2d014753d43c8d368891f3d558d701d26f5172d#01cda8a3eb14c8d76afdbdf2e0636563c0f12c7e)
9828273 commented 2025-12-15 10:36:16 +00:00 (Migrated from git.science.uu.nl)

changed this line in version 6 of the diff

changed this line in [version 6 of the diff](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135978&start_sha=b2d014753d43c8d368891f3d558d701d26f5172d#01cda8a3eb14c8d76afdbdf2e0636563c0f12c7e_61_83)
9828273 commented 2025-12-15 10:36:16 +00:00 (Migrated from git.science.uu.nl)

changed this line in version 6 of the diff

changed this line in [version 6 of the diff](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135978&start_sha=b2d014753d43c8d368891f3d558d701d26f5172d#01cda8a3eb14c8d76afdbdf2e0636563c0f12c7e_72_94)
9828273 commented 2025-12-15 10:36:17 +00:00 (Migrated from git.science.uu.nl)

changed this line in version 6 of the diff

changed this line in [version 6 of the diff](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135978&start_sha=b2d014753d43c8d368891f3d558d701d26f5172d#263dfe717551994421f8b00d361780afe2d3e8a0_42_39)
9828273 commented 2025-12-15 10:36:17 +00:00 (Migrated from git.science.uu.nl)

changed this line in version 6 of the diff

changed this line in [version 6 of the diff](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135978&start_sha=b2d014753d43c8d368891f3d558d701d26f5172d#263dfe717551994421f8b00d361780afe2d3e8a0_74_71)
9828273 commented 2025-12-15 10:36:17 +00:00 (Migrated from git.science.uu.nl)

added 2 commits

  • daf31ac6 - fix: change the address to the config, update some logic, seperate the api...
  • 71d86f5f - Merge branch 'feat/cb2ri-gestures' of...

Compare with previous version

added 2 commits <ul><li>daf31ac6 - fix: change the address to the config, update some logic, seperate the api...</li><li>71d86f5f - Merge branch &#39;feat/cb2ri-gestures&#39; of...</li></ul> [Compare with previous version](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135978&start_sha=b2d014753d43c8d368891f3d558d701d26f5172d)
9828273 commented 2025-12-15 10:52:09 +00:00 (Migrated from git.science.uu.nl)

added 1 commit

Compare with previous version

added 1 commit <ul><li>f15a5189 - fix: tests</li></ul> [Compare with previous version](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135980&start_sha=71d86f5fb037056437de4aee3b30b4e5ab81adca)
9828273 commented 2025-12-15 10:53:07 +00:00 (Migrated from git.science.uu.nl)

changed the description

changed the description
9828273 commented 2025-12-15 10:53:40 +00:00 (Migrated from git.science.uu.nl)

changed the description

changed the description
9828273 commented 2025-12-15 11:33:58 +00:00 (Migrated from git.science.uu.nl)

changed the description

changed the description
0950726 commented 2025-12-15 19:33:10 +00:00 (Migrated from git.science.uu.nl)

This validation is redundant: FastAPI already does this for you.

You already have tests covering this test_receive_speech_command_invalid_payload and test_receive_gesture_command_invalid_payload. Remove this validation and you'll see they still pass.

This validation is redundant: FastAPI already does this for you. You already have tests covering this `test_receive_speech_command_invalid_payload` and `test_receive_gesture_command_invalid_payload`. Remove this validation and you'll see they still pass.
0950726 commented 2025-12-16 08:39:59 +00:00 (Migrated from git.science.uu.nl)

mentioned in merge request !38

mentioned in merge request !38
0950726 commented 2025-12-16 09:22:15 +00:00 (Migrated from git.science.uu.nl)

changed this line in version 8 of the diff

changed this line in [version 8 of the diff](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135995&start_sha=f15a518984b69296bd2e2d40ff7984438c60f5d5#01cda8a3eb14c8d76afdbdf2e0636563c0f12c7e_37_30)
0950726 commented 2025-12-16 09:22:16 +00:00 (Migrated from git.science.uu.nl)

added 1 commit

  • db5504db - chore: remove redundant check

Compare with previous version

added 1 commit <ul><li>db5504db - chore: remove redundant check</li></ul> [Compare with previous version](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/36/diffs?diff_id=135995&start_sha=f15a518984b69296bd2e2d40ff7984438c60f5d5)
0950726 commented 2025-12-16 09:22:26 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item After the threads everything also works. as completed

marked the checklist item **After the threads everything also works.** as completed
0950726 (Migrated from git.science.uu.nl) scheduled this pull request to auto merge when all checks succeed 2025-12-16 09:22:39 +00:00
0950726 commented 2025-12-16 09:24:26 +00:00 (Migrated from git.science.uu.nl)

mentioned in commit 4ab6b2a0e6

mentioned in commit 4ab6b2a0e674420aa22844a17ab2c7d69e82f70b
0950726 (Migrated from git.science.uu.nl) merged commit 4ab6b2a0e6 into dev 2025-12-16 09:24:26 +00:00
8464960 commented 2025-12-16 09:25:07 +00:00 (Migrated from git.science.uu.nl)

I approve!

I approve!
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: pepperplus/pepperplus-cb#36