From 231f5fc81559ecaca7630e784914f3d009109932 Mon Sep 17 00:00:00 2001 From: wxchen Date: Mon, 8 May 2023 10:03:17 +0800 Subject: [PATCH] da changes modified: .gitignore modified: .vscode/tasks.json modified: src/maintain/scripts/test.py modified: src/vision_opencv/cv_bridge/python/cv_bridge/__pycache__/core.cpython-38.pyc --- .gitignore | 1 + .vscode/tasks.json | 4 ++-- src/maintain/scripts/test.py | 22 +++++++++--------- .../cv_bridge/__pycache__/core.cpython-38.pyc | Bin 9333 -> 9320 bytes 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 8ccf7d5..a81ad19 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .catkin_tools .vscode +.vscode/* /build /devel /logs diff --git a/.vscode/tasks.json b/.vscode/tasks.json index d6dcdd7..dff2b5d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -5,8 +5,8 @@ "command": "catkin", "args": [ "build", - // "-DPYTHON_EXECUTABLE=/home/da/miniconda3/envs/gsmini/bin/python", - "-DPYTHON_EXECUTABLE=${HOME}/.conda/envs/gsmini/bin/python" + "-DPYTHON_EXECUTABLE=/home/da/miniconda3/envs/gsmini/bin/python", + //"-DPYTHON_EXECUTABLE=${HOME}/.conda/envs/gsmini/bin/python" ], "problemMatcher": [ "$catkin-gcc" diff --git a/src/maintain/scripts/test.py b/src/maintain/scripts/test.py index 457f63f..675f73b 100755 --- a/src/maintain/scripts/test.py +++ b/src/maintain/scripts/test.py @@ -1,4 +1,4 @@ -#! /home/wxchen/.conda/envs/gsmini/bin/python +#! /home/da/miniconda3/envs/gsmini/bin/python import numpy as np import cv2 as cv @@ -32,18 +32,18 @@ def box_callback(box, depth, color_info): z = np.mean(depth_roi) * 0.001 x = (screw_x - color_intrinsics[2]) * z / color_intrinsics[0] y = (screw_y - color_intrinsics[5]) * z / color_intrinsics[4] - # print(x,y,z) + print(x,y,z) # calculate normal direction of screw area - X,Y = np.meshgrid(np.arange(depth_roi.shape[1]), np.arange(depth_roi.shape[0])) - X = X.reshape(-1) - Y = Y.reshape(-1) - Z = depth_roi.reshape(-1) - points = np.vstack([X, Y, Z]).T - center = np.mean(points, axis=0) - points = points - center - U, S, V = np.linalg.svd(points) - normal = V[2] + # X,Y = np.meshgrid(np.arange(depth_roi.shape[1]), np.arange(depth_roi.shape[0])) + # X = X.reshape(-1) + # Y = Y.reshape(-1) + # Z = depth_roi.reshape(-1) + # points = np.vstack([X, Y, Z]).T + # center = np.mean(points, axis=0) + # points = points - center + # U, S, V = np.linalg.svd(points) + # normal = V[2] # print(normal) # publish screw pose diff --git a/src/vision_opencv/cv_bridge/python/cv_bridge/__pycache__/core.cpython-38.pyc b/src/vision_opencv/cv_bridge/python/cv_bridge/__pycache__/core.cpython-38.pyc index b1dd76e7c2fe10d7785a5439026268fff99699ec..2668308e50a44995b7a4918ee66e121e4565e327 100644 GIT binary patch delta 43 xcmezB@xp^Ul$V!_0SJ~@yKUq)V-)n$&&bbB)lW&(4=BpdN=+`=9M34G3;+$342J*! delta 56 zcmaFi@zsMnl$V!_0SMkd_Snd6#wZu9pOK%Ns$X7_oRONRA5fH^m6}{qtY20VU!Gr- Ky*Y?cOc?+VkrMv^