Compare commits
2 Commits
c2f252dce6
...
5e8f1d6ab0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e8f1d6ab0 | ||
|
|
a00f111d7f |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,6 +1,6 @@
|
||||
.catkin_tools
|
||||
.vscode
|
||||
.vscode/*
|
||||
.vscode/
|
||||
/build
|
||||
/devel
|
||||
/logs
|
||||
|
||||
20
.vscode/c_cpp_properties.json
vendored
20
.vscode/c_cpp_properties.json
vendored
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"browse": {
|
||||
"databaseFilename": "${default}",
|
||||
"limitSymbolsToIncludedHeaders": false
|
||||
},
|
||||
"includePath": [
|
||||
"/opt/ros/melodic/include/**",
|
||||
"/usr/include/**"
|
||||
],
|
||||
"name": "ROS",
|
||||
"intelliSenseMode": "gcc-x64",
|
||||
"compilerPath": "/usr/bin/gcc",
|
||||
"cStandard": "gnu11",
|
||||
"cppStandard": "c++14"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"python.autoComplete.extraPaths": [
|
||||
"/opt/ros/melodic/lib/python2.7/dist-packages"
|
||||
],
|
||||
"python.analysis.extraPaths": [
|
||||
"/opt/ros/melodic/lib/python2.7/dist-packages"
|
||||
]
|
||||
}
|
||||
18
.vscode/tasks.json
vendored
18
.vscode/tasks.json
vendored
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"tasks": [
|
||||
{
|
||||
"type": "shell",
|
||||
"command": "catkin",
|
||||
"args": [
|
||||
"build",
|
||||
// "-DPYTHON_EXECUTABLE=/home/da/miniconda3/envs/gsmini/bin/python",
|
||||
"-DPYTHON_EXECUTABLE=${HOME}/.conda/envs/gsmini/bin/python"
|
||||
],
|
||||
"problemMatcher": [
|
||||
"$catkin-gcc"
|
||||
],
|
||||
"group": "build",
|
||||
"label": "catkin: build"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6,11 +6,13 @@ from matplotlib import pyplot as plt
|
||||
import rospy
|
||||
import tf2_ros
|
||||
import tf
|
||||
from sensor_msgs.msg import Image , CameraInfo
|
||||
from sensor_msgs.msg import Image , CameraInfo, PointCloud2
|
||||
from geometry_msgs.msg import PoseStamped, TransformStamped, Quaternion
|
||||
import message_filters
|
||||
from cv_bridge import CvBridge, CvBridgeError
|
||||
import rospkg
|
||||
import open3d as o3d
|
||||
from open3d_ros_helper import open3d_ros_helper as orh
|
||||
|
||||
import os
|
||||
import sys
|
||||
@@ -106,7 +108,7 @@ def box_callback(box, depth, color_info):
|
||||
|
||||
annulus_roi = depth_array[boundingBox.ymin-annulus_width:boundingBox.ymax+annulus_width, boundingBox.xmin-annulus_width:boundingBox.xmax+annulus_width]
|
||||
normal = calculate_image_edge_plane_normal(annulus_roi)
|
||||
# print(normal)
|
||||
print(normal)
|
||||
|
||||
# publish screw pose
|
||||
# screw_pose = PoseStamped()
|
||||
@@ -128,6 +130,7 @@ def box_callback(box, depth, color_info):
|
||||
screw_quat[1] = normal[1]
|
||||
screw_quat[2] = normal[2]
|
||||
screw_quat[3] = 0
|
||||
|
||||
# quaternion to euler
|
||||
screw_euler = tf.transformations.euler_from_quaternion(screw_quat)
|
||||
screw_quat = tf.transformations.quaternion_from_euler(screw_euler[0], screw_euler[1], 0)
|
||||
@@ -156,7 +159,6 @@ def box_callback(box, depth, color_info):
|
||||
tf_broadcaster.sendTransform(screw_tf)
|
||||
|
||||
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user