Integration test test_pyroki_real_service sends a 4x4 matrix where /ik expects a 7-vector
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 191
- Forks
- 12
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 1
Description
Summary
test_pyroki_real_service can never pass against a running PyRoKi server. It builds the IK request from a 4x4 homogeneous transform, but the server declares target_pose_wxyz_xyz as a flat list of 7 floats, so FastAPI rejects the body with HTTP 422 before any IK is attempted.
Where
tests/integrations/test_pyroki_integration.py:56—q = ik_solve(np.eye(4))cap/serving/launch_pyroki_server.py:183—target_pose_wxyz_xyz: list[float] # length 7 (wxyz + xyz)
Reproduce
Start the documented perception servers, then:
ASPIRE_INTEGRATION_REAL=1 .venv-libero/bin/python -m pytest \
tests/integrations/test_pyroki_integration.py -q
RuntimeError: Request to http://127.0.0.1:8116/ik failed after 4 retries / 15.00s.
Last error: 422 Client Error: Unprocessable Entity for url: http://127.0.0.1:8116/ik
Posting both shapes to the same live server isolates it to the payload:
4x4 matrix (what the test sends) -> HTTP 422
{"detail":[{"type":"float_type","loc":["body","target_pose_wxyz_xyz",0],
"msg":"Input should be a valid number","input":[1.0,0.0,0.0,0.0]}, ...
7-vector [1,0,0,0, 0.4,0,0.4] -> HTTP 200
{"joint_positions":[0.8286,0.1814,-0.7436,-2.7072, ...
Why it went unnoticed
test_init_pyroki_returns_ik_client, directly above in the same file, also passes np.eye(4) — but it monkeypatches post_with_retries with a fake that only asserts "target_pose_wxyz_xyz" in payload. The fake never checks the shape, so the unit test stays green and effectively documents the wrong contract. The integration test is the only one that could catch the mismatch, and it is gated behind ASPIRE_INTEGRATION_REAL=1.
Suggested fix
Send a 7-vector in the integration test:
q = ik_solve(np.array([1.0, 0.0, 0.0, 0.0, 0.4, 0.0, 0.4]))
Verified end-to-end through init_pyroki(...) against a live server: returns shape (8,), which satisfies the existing assert q.shape[0] >= 6.
It is also worth tightening the unit-test fake to assert len(payload["target_pose_wxyz_xyz"]) == 7, so a mock can no longer hide a shape mismatch of this kind.
Environment
Fresh clone at f4c8939, Linux x86-64, .venv-libero (Python 3.12). PyRoKi started via the documented command in scripts/common/start_perception_servers.sh (--robot panda_description --target-link panda_hand, port 8116).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in tests/integrations/test_pyroki_integration.py at test_pyroki_real_service and compare its request with the 7-float contract in cap/serving/launch_pyroki_server.py. Run ASPIRE_INTEGRATION_REAL=1 .venv-libero/bin/python -m pytest tests/integrations/test_pyroki_integration.py -q against the documented server. Done means the integration test receives joint positions and the unit-test fake verifies a payload length of 7.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100