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 b1dd76e..2668308 100644 Binary files a/src/vision_opencv/cv_bridge/python/cv_bridge/__pycache__/core.cpython-38.pyc and b/src/vision_opencv/cv_bridge/python/cv_bridge/__pycache__/core.cpython-38.pyc differ