From b41b579747f5c5fad4e2155e891976fe2961481b Mon Sep 17 00:00:00 2001 From: ZdenekM Date: Wed, 7 Feb 2024 12:20:21 +0100 Subject: [PATCH] feat(arcor2_calibration): smaller aruco dictionary --- .github/workflows/pants.yaml | 2 +- README.md | 2 +- compose-files/fit-demo/calibration.yaml | 24 ++++++++++++++++++- compose-files/fit-demo/docker-compose.yml | 2 +- src/docker/arcor2_calibration/BUILD | 2 +- src/python/arcor2_calibration/CHANGELOG.md | 6 +++++ src/python/arcor2_calibration/calibration.py | 2 +- .../arcor2_calibration/tests/markers.png | 4 ++-- .../tests/test_estimate_camera_pose.py | 2 ++ 9 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pants.yaml b/.github/workflows/pants.yaml index 2325b135e..6787e8256 100644 --- a/.github/workflows/pants.yaml +++ b/.github/workflows/pants.yaml @@ -28,7 +28,7 @@ jobs: - name: Maximize build space uses: easimon/maximize-build-space@v10 with: - root-reserve-mb: 35000 + root-reserve-mb: 30000 swap-size-mb: 1024 remove-dotnet: 'true' remove-android: 'true' diff --git a/README.md b/README.md index 24a0935f5..181bdfd73 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ The following video by [Kinali](https://www.kinali.cz/en/) shows the use case (o [README](src/python/arcor2_calibration/README.md) | [CHANGELOG](src/python/arcor2_calibration/CHANGELOG.md) - - 2023-02-14: [1.0.0](https://github.com/robofit/arcor2/releases/tag/arcor2_calibration%2F1.0.0) ([docker](https://hub.docker.com/r/arcor2/arcor2_calibration/tags?page=1&ordering=last_updated&name=1.0.0), [pypi](https://pypi.org/project/arcor2-calibration/1.0.0/)). + - 2024-02-07: [1.1.0](https://github.com/robofit/arcor2/releases/tag/arcor2_calibration%2F1.1.0) ([docker](https://hub.docker.com/r/arcor2/arcor2_calibration/tags?page=1&ordering=last_updated&name=1.1.0), [pypi](https://pypi.org/project/arcor2-calibration/1.1.0/)). ### arcor2_calibration_data diff --git a/compose-files/fit-demo/calibration.yaml b/compose-files/fit-demo/calibration.yaml index ce044f2ec..598fc99a4 100644 --- a/compose-files/fit-demo/calibration.yaml +++ b/compose-files/fit-demo/calibration.yaml @@ -4,12 +4,34 @@ min_dist: 0.5 max_dist: 2.0 blur_threshold: 150.0 markers: - 10: + 0: + pose: + position: + x: -0.729 + y: 0 + z: 0 + orientation: + x: 0 + y: 0 + z: 0 + w: 1 + 30: pose: position: x: 0 y: 0 z: 0 + orientation: + x: 0 + y: 0 + z: 0 + w: 1 + 49: + pose: + position: + x: 0.729 + y: 0 + z: 0 orientation: x: 0 y: 0 diff --git a/compose-files/fit-demo/docker-compose.yml b/compose-files/fit-demo/docker-compose.yml index 3fc2f9d65..ff19b8634 100644 --- a/compose-files/fit-demo/docker-compose.yml +++ b/compose-files/fit-demo/docker-compose.yml @@ -82,7 +82,7 @@ services: - ARCOR2_KINECT_AZURE_MOCK=true fit-demo-calibration: - image: arcor2/arcor2_calibration:1.0.0 + image: arcor2/arcor2_calibration:1.1.0 networks: - fit-demo-calibration-network ports: diff --git a/src/docker/arcor2_calibration/BUILD b/src/docker/arcor2_calibration/BUILD index f601d72fc..988493429 100644 --- a/src/docker/arcor2_calibration/BUILD +++ b/src/docker/arcor2_calibration/BUILD @@ -1,5 +1,5 @@ shell_source(name="start.sh", source="start.sh") docker_image( - name="arcor2_calibration", repository="arcor2/arcor2_calibration", dependencies=[":start.sh"], image_tags=["1.0.0"] + name="arcor2_calibration", repository="arcor2/arcor2_calibration", dependencies=[":start.sh"], image_tags=["1.1.0"] ) \ No newline at end of file diff --git a/src/python/arcor2_calibration/CHANGELOG.md b/src/python/arcor2_calibration/CHANGELOG.md index 216fb32a8..de45059d6 100644 --- a/src/python/arcor2_calibration/CHANGELOG.md +++ b/src/python/arcor2_calibration/CHANGELOG.md @@ -2,6 +2,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +## [1.1.0] - 2024-02-07 + +### Changed + +- Markers used to be from 7x7 dictionary, which is unnecessarily large, now a 4x4 dictionary of size 50 is used (use marker IDs 0..49). + ## [1.0.0] - 2023-02-14 ### Changed diff --git a/src/python/arcor2_calibration/calibration.py b/src/python/arcor2_calibration/calibration.py index 8c1d34592..e8d8079b5 100644 --- a/src/python/arcor2_calibration/calibration.py +++ b/src/python/arcor2_calibration/calibration.py @@ -11,7 +11,7 @@ BLUR_THRESHOLD: float = 150.0 -aruco_dict = aruco.getPredefinedDictionary(aruco.DICT_7X7_1000) +aruco_dict = aruco.getPredefinedDictionary(aruco.DICT_4X4_50) detector_params = aruco.DetectorParameters() detector = aruco.ArucoDetector(aruco_dict, detector_params) diff --git a/src/python/arcor2_calibration/tests/markers.png b/src/python/arcor2_calibration/tests/markers.png index 81628e2dc..04d6e081a 100644 --- a/src/python/arcor2_calibration/tests/markers.png +++ b/src/python/arcor2_calibration/tests/markers.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:57face8a2761d34ed45168b2be9ebffd16c19dfa90d05eb2b99e87662716e511 -size 470096 +oid sha256:b5c3919f187cdb3de93fc2e3a5b8edf7cc051cd14724ffa5312c56b6eb5d1f53 +size 7088 diff --git a/src/python/arcor2_calibration/tests/test_estimate_camera_pose.py b/src/python/arcor2_calibration/tests/test_estimate_camera_pose.py index 5c170c83c..bf9b1e3a8 100644 --- a/src/python/arcor2_calibration/tests/test_estimate_camera_pose.py +++ b/src/python/arcor2_calibration/tests/test_estimate_camera_pose.py @@ -12,5 +12,7 @@ def test_estimate_camera_pose() -> None: [[1, 0.00000, 1], [0.00000, 1, 1], [0.00000, 0.00000, 1]], [1.0, 1.0, 1.0, 1.0], im, 0.1 ) assert len(markers) == 2 + assert set(markers.keys()) == {0, 39} + for pose in markers.values(): assert isinstance(pose, Pose)