diff --git a/apriltag/bin/src/apriltag.py b/apriltag/bin/src/apriltag.py index f94514a..60bb9d0 100644 --- a/apriltag/bin/src/apriltag.py +++ b/apriltag/bin/src/apriltag.py @@ -21,22 +21,12 @@ lebai = lebai_sdk.connect("127.0.0.1", True) def main(): - fx = (lebai.get_item("plugin_camera_fx"))['value'] - if not fx: - fx = "900" - fx = float(fx) - fy = (lebai.get_item("plugin_camera_fy"))['value'] - if not fy: - fy = "900" - fy = float(fy) - cx = (lebai.get_item("plugin_camera_cx"))['value'] - if not cx: - cx = "640" - cx = float(cx) - cy = (lebai.get_item("plugin_camera_cy"))['value'] - if not cy: - cy = "360" - cy = float(cy) + camera_matrix = (lebai.get_item("plugin_camera_calibrater_camera_matrix"))['value'] + camera_matrix = json.loads(camera_matrix) + fx = camera_matrix[0][0] + fy = camera_matrix[1][1] + cx = camera_matrix[0][2] + cy = camera_matrix[1][2] tag_family = (lebai.get_item("plugin_apriltag_tag_family"))['value'] if not tag_family: tag_family = "tag36h11" diff --git a/apriltag/plugin.json b/apriltag/plugin.json index 749c58e..cb13436 100644 --- a/apriltag/plugin.json +++ b/apriltag/plugin.json @@ -1,5 +1,6 @@ { "name": "apriltag", "description": "视觉识别apriltag位姿", - "homepage": "lebai.ltd" + "homepage": "lebai.ltd", + "auto_restart": true } \ No newline at end of file diff --git a/apriltag/web/index.html b/apriltag/web/index.html index 5d72b24..879d159 100644 --- a/apriltag/web/index.html +++ b/apriltag/web/index.html @@ -7,6 +7,7 @@
+