1
This commit is contained in:
@@ -42,8 +42,8 @@ def read_stl(stl_path: str, save_path: str, view_pointcloud: bool = False) -> No
|
||||
|
||||
o3d.visualization.draw_geometries([pcd_model, line_set])
|
||||
|
||||
success = o3d.io.write_point_cloud(save_path, pcd_model)
|
||||
logging.info(f"PCD_0, 写入结果: {success}")
|
||||
# success = o3d.io.write_point_cloud(save_path, pcd_model)
|
||||
# logging.info(f"PCD_0, 写入结果: {success}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -130,6 +130,8 @@ class DetectNode(Node):
|
||||
self.declare_parameter('eye_in_right_hand_path', "configs/hand_eye_mat/eye_in_left_hand.json")
|
||||
self.declare_parameter('eye_to_hand_path', "configs/hand_eye_mat/eye_in_left_hand.json")
|
||||
|
||||
self.get_logger().info("Init param done")
|
||||
|
||||
def _init_model(self):
|
||||
"""init model"""
|
||||
device_model = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
||||
@@ -146,10 +148,14 @@ class DetectNode(Node):
|
||||
self.function = None
|
||||
self.get_logger().error(f'Unknown checkpoint: {self.checkpoint_name}')
|
||||
|
||||
self.get_logger().info("Init model done")
|
||||
|
||||
def _init_publisher(self):
|
||||
"""init publisher"""
|
||||
if self.output_boxes or self.output_masks:
|
||||
self.pub_detect_image = self.create_publisher(Image, '/image/detect_image', 10)
|
||||
|
||||
self.get_logger().info("Init publisher done")
|
||||
|
||||
def _init_service(self):
|
||||
"""init service server"""
|
||||
@@ -159,6 +165,8 @@ class DetectNode(Node):
|
||||
self._service_callback
|
||||
)
|
||||
|
||||
self.get_logger().info("Init service done")
|
||||
|
||||
def _init_subscriber(self):
|
||||
"""init subscriber"""
|
||||
self.sub_img = self.create_subscription(
|
||||
@@ -168,10 +176,14 @@ class DetectNode(Node):
|
||||
10
|
||||
)
|
||||
|
||||
self.get_logger().info("Init subscriber done")
|
||||
|
||||
def _init_config(self):
|
||||
"""init config"""
|
||||
with open(self.config_dir, "r") as f:
|
||||
self.config = json.load(f)
|
||||
|
||||
self.get_logger().info("Init config done")
|
||||
|
||||
def _init_json_file(self):
|
||||
self.eye_in_left_hand_path = os.path.join(share_dir, self.get_parameter('eye_in_left_hand_path').value)
|
||||
@@ -275,7 +287,7 @@ class DetectNode(Node):
|
||||
class_name = item["class_name"],
|
||||
class_id = item["class_id"],
|
||||
pose = item["pose"],
|
||||
grab_width = item["grab_width"]
|
||||
grab_width = item["grap_width"]
|
||||
)
|
||||
)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user