def callback_with_cluster_box(self, cluster_boxes_msg, instance_boxes_msg, instance_label_msg):
        labeled_cluster_boxes = BoundingBoxArray()
        labeled_instance_boxes = BoundingBoxArray()

        labeled_cluster_boxes.header = cluster_boxes_msg.header
        labeled_instance_boxes.header = instance_boxes_msg.header

        for index, box in enumerate(cluster_boxes_msg.boxes):
            if not box.pose.position.x == 0.0:
                tmp_box = BoundingBox()
                tmp_box.header = box.header
                tmp_box.pose = box.pose
                tmp_box.dimensions = box.dimensions

                # TODO fix index indent, jsk_pcl_ros_utils/label_to_cluster_point_indices_nodelet.cpp
                tmp_box.label = index + 1

                labeled_cluster_boxes.boxes.append(tmp_box)

        for box, label in zip(instance_boxes_msg.boxes, instance_label_msg.labels):
            tmp_box = BoundingBox()
            tmp_box.header = box.header
            tmp_box.pose = box.pose
            tmp_box.dimensions = box.dimensions
            tmp_box.label = label.id
            labeled_instance_boxes.boxes.append(tmp_box)

        self.labeled_cluster_boxes_pub.publish(labeled_cluster_boxes)
        self.labeled_instance_boxes_pub.publish(labeled_instance_boxes)
Esempio n. 2
0
 def people_msg_callback(self, people, classes):
     bboxes = BoundingBoxArray(header=people.header)
     for p in people.poses:
         b = BoundingBox()
         for i, n in enumerate(p.limb_names):
             if n in ["Neck", "Nose", "REye", "LEye", "REar", "LEar"]:
                 b.header = people.header
                 b.pose = p.poses[i]
                 break
         if not b.header.frame_id:
             b.header = people.header
             b.pose = b.poses[0]
     self.box_msg_callback(bboxes, classes)
Esempio n. 3
0
    def init_boundingboxarray(self, num_boxes=30):
        self.boundingBoxArray_object = BoundingBoxArray()

        h = std_msgs.msg.Header()
        h.stamp = rospy.Time.now(
        )  # Note you need to call rospy.init_node() before this will work
        h.frame_id = "world"

        self.boundingBoxArray_object.header = h

        self.minimum_dimension = 0.2
        self.init_x_position = 1.0

        for i in range(num_boxes):
            new_box = BoundingBox()
            new_box.header = h

            new_box.pose = Pose()
            new_box.pose.position.x = self.init_x_position + i * self.minimum_dimension

            new_box.dimensions = Vector3()
            new_box.dimensions.x = self.minimum_dimension
            new_box.dimensions.y = self.minimum_dimension
            new_box.dimensions.z = self.minimum_dimension

            new_box.label = i
            new_box.value = i * self.minimum_dimension

            self.boundingBoxArray_object.boxes.append(new_box)

        self.publish_once(self.boundingBoxArray_object)
    def callback(self, box_msg):
        labeled_boxes = {}
        label_buf = []
        orientation = Pose().orientation

        for box in box_msg.boxes:
            if box.label in label_buf:
                labeled_boxes[box.label] += [self.get_points(box)]
                orientation = box.pose.orientation
            else:
                labeled_boxes[box.label] = [self.get_points(box)]
                label_buf.append(box.label)

        bounding_box_msg = BoundingBoxArray()

        for label, boxes in zip(labeled_boxes.keys(), labeled_boxes.values()):
            thresh = self.thresh
            if self.label_lst[label] == 'shelf_flont':
                thresh = 2.0

            clustering = Clustering()
            boxes = np.array(boxes)
            result = clustering.clustering_wrapper(boxes, thresh)

            for cluster in result:
                max_candidates = [
                    boxes[i][0] + (boxes[i][1] * 0.5) for i in cluster.indices
                ]
                min_candidates = [
                    boxes[i][0] - (boxes[i][1] * 0.5) for i in cluster.indices
                ]
                candidates = np.array(max_candidates + min_candidates)

                dimension = candidates.max(axis=0) - candidates.min(axis=0)
                center = candidates.min(axis=0) + (dimension * 0.5)

                distances = self.get_distances(
                    np.array([boxes[i][0] for i in cluster.indices]), [
                        np.linalg.norm(boxes[i][1]) * 0.5
                        for i in cluster.indices
                    ])
                tmp_box = BoundingBox()
                tmp_box.header = box_msg.header
                tmp_box.dimensions.x = dimension[0]
                tmp_box.dimensions.y = dimension[1]
                tmp_box.dimensions.z = dimension[2]
                tmp_box.pose.position.x = center[0]
                tmp_box.pose.position.y = center[1]
                tmp_box.pose.position.z = center[2]
                tmp_box.pose.orientation = orientation
                tmp_box.label = label
                tmp_box.value = distances.mean()
                bounding_box_msg.boxes.append(tmp_box)

            bounding_box_msg.header = box_msg.header
        self.box_pub.publish(bounding_box_msg)
def callback(msg):
    box_array = BoundingBoxArray()
    box_array.header = msg.header
    for footstep in msg.footsteps:
        box = BoundingBox()
        box.header = msg.header
        box.pose = footstep.pose
        box.dimensions = footstep.dimensions
        box_array.boxes.append(box)
    pub.publish(box_array)
Esempio n. 6
0
def callback(msg):
    box_array = BoundingBoxArray()
    box_array.header = msg.header
    for footstep in msg.footsteps:
        box = BoundingBox()
        box.header = msg.header
        box.pose = footstep.pose
        box.dimensions = footstep.dimensions
        box_array.boxes.append(box)
    pub.publish(box_array)
def convert(header, xx_cube):
    boundingboxarray_msg = BoundingBoxArray()
    boundingboxarray_msg.header = header

    num_xx = int(xx_cube.shape[0] / 8)
    for i in range(num_xx):
        cube_raw = xx_cube[range(8 * i, 8 * i + 8), :]
        bb_in_camera = np.column_stack((cube_raw, np.ones((8, 1))))
        bb_in_lidar = np.linalg.inv(calib.lidar_to_cam).dot(bb_in_camera.T).T
        boundingbox_msg = BoundingBox()
        boundingbox_msg.header = boundingboxarray_msg.header

        # boundingbox中心点位置
        boundingbox_msg.pose.position.x = bb_in_lidar[:, 0].mean()
        boundingbox_msg.pose.position.y = bb_in_lidar[:, 1].mean()
        boundingbox_msg.pose.position.z = bb_in_lidar[:, 2].mean()

        # 寻找y坐标最小的顶点,计算相邻两个顶点的旋转角及边长
        bb_bottom = bb_in_lidar[:4]
        min_idx = np.where(bb_bottom[:, 1] == bb_bottom[:, 1].min())[0][0]
        theta = math.atan2(
            bb_bottom[(min_idx + 1) % 4, 1] - bb_bottom[min_idx, 1],
            bb_bottom[(min_idx + 1) % 4, 0] - bb_bottom[min_idx, 0])
        b_1 = (
            (bb_bottom[(min_idx + 1) % 4, 1] - bb_bottom[min_idx, 1])**2 +
            (bb_bottom[(min_idx + 1) % 4, 0] - bb_bottom[min_idx, 0])**2)**0.5
        b_2 = (
            (bb_bottom[(min_idx + 3) % 4, 1] - bb_bottom[min_idx, 1])**2 +
            (bb_bottom[(min_idx + 3) % 4, 0] - bb_bottom[min_idx, 0])**2)**0.5
        if theta < 90 * math.pi / 180:
            rotation_angle = theta
            dimension_x = b_1
            dimension_y = b_2
        else:
            rotation_angle = theta - 90 * math.pi / 180
            dimension_x = b_2
            dimension_y = b_1

        # boundingbox旋转角四元数
        boundingbox_msg.pose.orientation.x = 0
        boundingbox_msg.pose.orientation.y = 0
        boundingbox_msg.pose.orientation.z = math.sin(0.5 * rotation_angle)
        boundingbox_msg.pose.orientation.w = math.cos(0.5 * rotation_angle)

        # boundingbox尺寸
        boundingbox_msg.dimensions.x = dimension_x
        boundingbox_msg.dimensions.y = dimension_y
        boundingbox_msg.dimensions.z = bb_in_lidar[:, 2].max(
        ) - bb_in_lidar[:, 2].min()

        boundingbox_msg.value = 0
        boundingbox_msg.label = 0
        boundingboxarray_msg.boxes.append(boundingbox_msg)

    return boundingboxarray_msg
def get_box(msg):
    box = BoundingBox()
    get_box_pose_srv = rospy.ServiceProxy("/transformable_server_sample/get_pose", GetTransformableMarkerPose)
    resp = get_box_pose_srv(target_name=msg.data)
    box.pose = resp.pose_stamped.pose
    box.header = resp.pose_stamped.header
    get_box_dim_srv = rospy.ServiceProxy("/transformable_server_sample/get_dimensions", GetMarkerDimensions)
    resp2 = get_box_dim_srv(target_name=msg.data)
    box.dimensions.x = resp2.dimensions.x
    box.dimensions.y = resp2.dimensions.y
    box.dimensions.z = resp2.dimensions.z
    return box
def callback(msg):
    box_array = BoundingBoxArray()
    box_array.header = msg.header
    for footstep in msg.footsteps:
        box = BoundingBox()
        box.header = msg.header
        box.pose = footstep.pose
        box.dimensions = footstep.dimensions
        box.pose.position.z += (z_max + z_min) / 2.0
        box.dimensions.z = z_max - z_min
        box_array.boxes.append(box)
    pub.publish(box_array)
def callback(msg):
    box_array = BoundingBoxArray()
    box_array.header = msg.header
    for footstep in msg.footsteps:
        box = BoundingBox()
        box.header = msg.header
        box.pose = footstep.pose
        box.dimensions = footstep.dimensions
        box.pose.position.z += (z_max + z_min) / 2.0
        box.dimensions.z = z_max - z_min
        box_array.boxes.append(box)
    pub.publish(box_array)
Esempio n. 11
0
 def labeled_pose_callback(self, pose_msg):
     self.header = pose_msg.header
     self.qatm_boxes = BoundingBoxArray()
     self.qatm_boxes.header = pose_msg.header
     for pose in pose_msg.poses:
         tmp_box = BoundingBox()
         tmp_box.header = pose_msg.header
         tmp_box.pose = pose.pose
         tmp_box.dimensions.x = 0.03
         tmp_box.dimensions.y = 0.03
         tmp_box.dimensions.z = 0.03
         tmp_box.label = self.label_lst.index(pose.label)
         self.qatm_boxes.boxes.append(tmp_box)
    def callback(self, instance_boxes_msg, instance_label_msg):
        labeled_instance_boxes = BoundingBoxArray()
        labeled_instance_boxes.header = instance_boxes_msg.header

        for box, label in zip(instance_boxes_msg.boxes, instance_label_msg.labels):
            tmp_box = BoundingBox()
            tmp_box.header = box.header
            tmp_box.pose = box.pose
            tmp_box.dimensions = box.dimensions
            tmp_box.label = label.id
            labeled_instance_boxes.boxes.append(tmp_box)

        self.labeled_instance_boxes_pub.publish(labeled_instance_boxes)
def get_box(msg):
    box = BoundingBox()
    get_box_pose_srv = rospy.ServiceProxy(
        "/transformable_server_sample/get_pose", GetTransformableMarkerPose)
    resp = get_box_pose_srv(target_name=msg.data)
    box.pose = resp.pose_stamped.pose
    box.header = resp.pose_stamped.header
    get_box_dim_srv = rospy.ServiceProxy(
        "/transformable_server_sample/get_dimensions", GetMarkerDimensions)
    resp2 = get_box_dim_srv(target_name=msg.data)
    box.dimensions.x = resp2.dimensions.x
    box.dimensions.y = resp2.dimensions.y
    box.dimensions.z = resp2.dimensions.z
    return box
Esempio n. 14
0
def dummyBoundingBoxPublisher():
    pub = rospy.Publisher('/dummy_bounding_box', BoundingBox, queue_size=1)
    rospy.init_node('dummyBoundingBoxPublisher_node', anonymous=True)
    rate = rospy.Rate(25)

    boundingBox_object = BoundingBox()
    i = 0
    pose_object = Pose()
    dimensions_object = Vector3()
    minimum_dimension = 0.2
    boundingBox_object.label = 1234

    while not rospy.is_shutdown():
        h = std_msgs.msg.Header()
        h.stamp = rospy.Time.now(
        )  # Note you need to call rospy.init_node() before this will work
        h.frame_id = "world"

        boundingBox_object.header = h

        sinus_value = math.sin(i / 10.0)
        boundingBox_object.value = sinus_value

        # Change Pose to see effects
        pose_object.position.x = 1.0
        pose_object.position.y = 0.0
        pose_object.position.z = sinus_value

        # ai, aj, ak == roll, pitch, yaw
        quaternion = tf.transformations.quaternion_from_euler(ai=0,
                                                              aj=0,
                                                              ak=sinus_value)
        pose_object.orientation.x = quaternion[0]
        pose_object.orientation.y = quaternion[1]
        pose_object.orientation.z = quaternion[2]
        pose_object.orientation.w = quaternion[3]

        dimensions_object.x = sinus_value / 10 + minimum_dimension
        dimensions_object.y = minimum_dimension
        dimensions_object.z = minimum_dimension

        # Assign pose and dimension objects
        boundingBox_object.pose = pose_object
        boundingBox_object.dimensions = dimensions_object
        pub.publish(boundingBox_object)
        rate.sleep()

        i += 1
Esempio n. 15
0
def vis_callback(msg):
    obj_bba = BoundingBoxArray()
    obj_bba.header.frame_id = 'map'

    for obj in msg.objects:
        obj_bb = BoundingBox()
        res = tosm.query_individual(obj.object_name + str(obj.ID))
        obj_bb.header = obj.header
        pose = res.pose[0].replace('[', '').replace(']', '').split(',')
        size = res.size[0].replace('[', '').replace(']', '').split(',')

        obj_bb.pose.position.x = float(pose[0])
        obj_bb.pose.position.y = float(pose[1])
        obj_bb.pose.position.z = float(pose[2]) + float(size[2]) / 2.0
        obj_bb.pose.orientation.x = float(pose[3])
        obj_bb.pose.orientation.y = float(pose[4])
        obj_bb.pose.orientation.z = float(pose[5])
        obj_bb.pose.orientation.w = float(pose[6])

        # bounding box size
        obj_bb.dimensions.x = float(size[0])
        obj_bb.dimensions.y = float(size[1])
        obj_bb.dimensions.z = float(size[2])

        # likelihood
        obj_bb.value = 1

        # determine the color
        if (obj.object_name == "hingeddoor"):
            obj_bb.label = 1
        elif (obj.object_name == "elevatordoor"):
            obj_bb.label = 2
        elif (obj.object_name == "A"):
            obj_bb.label = 3
        elif (obj.object_name == "B"):
            obj_bb.label = 4
        elif (obj.object_name == "C"):
            obj_bb.label = 5
        else:
            obj_bb.label = 10

        obj_bba.boxes.append(obj_bb)

    ses_map_object_vis_pub.publish(obj_bba)
Esempio n. 16
0
    def inference_image(self, data):

        try:
            image = self.bridge.imgmsg_to_cv2(data, "bgr8")
        except CvBridgeError as e:
            print(e)
            return

        #if image captured
        image_expanded = np.expand_dims(image, axis=0)
        # Perform the actual detection by running the model with the image as input
        (boxes, scores, classes,
         num) = self.sess.run([
             self.detection_boxes, self.detection_scores,
             self.detection_classes, self.num_detections
         ],
                              feed_dict={self.image_tensor: image_expanded})
        # Draw the results of the detection (aka 'visulaize the results')
        vis_util.visualize_boxes_and_labels_on_image_array(
            image,
            np.squeeze(boxes),
            np.squeeze(classes).astype(np.int32),
            np.squeeze(scores),
            self.category_index,
            use_normalized_coordinates=True,
            line_thickness=8,
            min_score_thresh=0.9)
        if len(boxes[0]) > 0 and scores[0][0] > 0.95:
            [min_x, min_y, max_x, max_y] = boxes[0][0]
            height, width = image.shape[:2]
            # print(min_x * height, min_y * width, max_x * height, max_y * width)
            # cv2.rectangle(image, (int(min_y * width), int(min_x * height)), (int(max_y * width), int(max_x * height)), (255, 0, 0), 2)
            boundingbox = BoundingBox()
            boundingbox.header = data.header
            boundingbox.pose.position.x = int(min_y * width)
            boundingbox.pose.position.y = int(min_x * height)
            boundingbox.dimensions.x = int((max_y - min_y) * width)
            boundingbox.dimensions.y = int((max_x - min_x) * height)
            # print(boundingbox)
            self.pub_boundingbox.publish(boundingbox)
        # All the results have been drawn on image. Now display the image.
        cv2.imshow('Object detector', image)
        if cv2.waitKey(10) == ord('q'):
            return
def candidateBoxes(header, model_index):
    box_array = BoundingBoxArray()
    box_array.header.stamp = header.stamp
    box_array.header.frame_id = "odom"
    dx = 0.1
    for y in np.arange(0.0, 0.6, dx):
        for z in np.arange(0.7, 1.0, dx):
            for x in np.arange(0.0, -0.5, -dx):
                box = BoundingBox()
                box.header = box_array.header
                box.pose.orientation.w = 1.0
                box.pose.position.x = x
                box.pose.position.y = y
                box.pose.position.z = z
                box.dimensions.x = 0.1
                box.dimensions.y = 0.1
                box.dimensions.z = 0.1
                box_array.boxes.append(box)
    return box_array
Esempio n. 18
0
def LeadCarUpdate(msg):
	global lidar_array, filter_boxes
	leadc_boxes = BoundingBoxArray()
	leadc_boxes.header = filter_boxes.header
	compare_boxes = BoundingBoxArray()
	compare_boxes.header = filter_boxes.header
	compare_boxes.boxes = filter_boxes.boxes[:]

	if len(msg.data)==0:
		print('no lead car')
	else:
		rc_x = msg.data[0].pos_x
		rc_y = msg.data[0].pos_y
		rc_v = msg.data[0].speed

	distances = []
	for i in range(len(compare_boxes.boxes)):
		lidar_x = compare_boxes.boxes[i].pose.position.x
		lidar_y = compare_boxes.boxes[i].pose.position.y

		distance = np.sqrt((rc_x-lidar_x)**2+(rc_y-lidar_y)**2)
		distances.append(distance)
	print(min(distances))
	if (min(distances)<5):
		obj_i = distances.index(min(distances))
		leadc_boxes.boxes.append(compare_boxes.boxes[obj_i])
	else:
		leadc_box = BoundingBox()
		leadc_box.header = filter_boxes.boxes[1].header
		leadc_box.pose.position.x = rc_x
		leadc_box.pose.position.y = rc_y
		leadc_box.pose.position.z = .5
		leadc_box.pose.orientation.x = 0
		leadc_box.pose.orientation.y = 0
		leadc_box.pose.orientation.z = 0
		leadc_box.pose.orientation.w = 0
		leadc_box.dimensions.x = 5
		leadc_box.dimensions.y = 5
		leadc_box.dimensions.z = 5

		leadc_boxes.boxes.append(leadc_box)

	pub_leadc.publish(leadc_boxes)
Esempio n. 19
0
def candidateBoxes(header, model_index):
    box_array = BoundingBoxArray()
    box_array.header.stamp = header.stamp
    box_array.header.frame_id = "odom"
    dx = 0.1
    for y in np.arange(0.0, 0.6, dx):
        for z in np.arange(0.7, 1.0, dx):
            for x in np.arange(0.0, -0.5, -dx):
                box = BoundingBox()
                box.header = box_array.header
                box.pose.orientation.w = 1.0
                box.pose.position.x = x
                box.pose.position.y = y
                box.pose.position.z = z
                box.dimensions.x = 0.1
                box.dimensions.y = 0.1
                box.dimensions.z = 0.1
                box_array.boxes.append(box)
    return box_array
 def prepareDetectionRegistration(self, centroid, now):
     obj_det = BucketDetection()
     obj_det.image = self.cv_bridge.cv2_to_imgmsg(self.stereo_left, "bgr8")
     obj_det.tag = "object_tags/gate"
     bbox_3d = BoundingBox()
     bbox_3d.dimensions = Vector3(self.gate_dimensions[0], self.gate_dimensions[1], self.gate_dimensions[2])
     bbox_pose = Pose()
     x, y, z = list((np.squeeze(centroid)).T)
     obj_det.position = Point(x, y, z)
     bbox_pose.position = Point(x, y, z)
     bbox_3d.pose = bbox_pose
     bbox_header = Header()
     bbox_header.frame_id = "duo3d_optical_link_front"
     bbox_header.stamp = now
     bbox_3d.header = bbox_header
     obj_det.bbox_3d = bbox_3d
     obj_det.header = Header()
     obj_det.header.frame_id = bbox_header.frame_id
     obj_det.header.stamp = now
     return obj_det
Esempio n. 21
0
 def prepare_detection_registration(self, centroid, det, now):
     obj_det = BucketDetection()
     obj_det.image = self.cv_bridge.cv2_to_imgmsg(self.stereo_left, "bgr8")
     obj_det.tag = str("object_tags/" + self.classes[det[0]])
     bbox_dims = np.asarray([1.0, 1.0, 1.0])
     if rospy.has_param("object_tags/" + self.classes[det[0]] + "/dimensions"):
         bbox_dims = np.asarray(rospy.get_param("object_tags/" + self.classes[det[0]] + "/dimensions")).astype(float)
     bbox_3d = BoundingBox()
     bbox_3d.dimensions = Vector3(bbox_dims[0], bbox_dims[1], bbox_dims[2])
     bbox_pose = Pose()
     x, y, z = list((np.squeeze(centroid)).T)
     obj_det.position = Point(x, y, z)
     bbox_pose.position = Point(x, y, z)
     bbox_3d.pose = bbox_pose
     bbox_header = Header()
     bbox_header.frame_id = "duo3d_optical_link_front"
     bbox_header.stamp = now
     bbox_3d.header = bbox_header
     obj_det.bbox_3d = bbox_3d
     obj_det.header = Header()
     obj_det.header.frame_id = bbox_header.frame_id
     obj_det.header.stamp = now
     return obj_det
Esempio n. 22
0
def talker():
    pub = rospy.Publisher('/segmentation_decomposer/boxes',
                          BoundingBoxArray,
                          queue_size=10)
    rospy.init_node('segmentation_talker', anonymous=True)
    rate = rospy.Rate(10)
    while not rospy.is_shutdown():
        b = BoundingBoxArray()
        b.header.frame_id = "/head_mount_kinect_rgb_optical_frame"
        b.header.stamp = rospy.get_rostime()
        b1 = BoundingBox()
        # b1.header.frame_id  = "/head_mount_kinect_rgb_optical_frame"
        # b1.header.stamp = rospy.get_rostime()
        b1.header = b.header
        b1.pose.position.x = 0.1
        b1.pose.position.y = 0.1
        b1.pose.position.z = 0.1
        b1.dimensions.x = 0.15
        b1.dimensions.y = 0.06
        b1.dimensions.z = 0.06
        b.boxes = [b1]
        pub.publish(b)
        rate.sleep()
Esempio n. 23
0
    def callback(self, front_MarkerArray, back_MarkerArray, TwistStamped):
        # print("front",len(front_MarkerArray.markers)/4)
        # print("back",len(back_MarkerArray.markers)/4)
        # #  Concat front and back MarkerArray Messages
        add_MarkerArray = copy.deepcopy(front_MarkerArray)
        for i in range(len(back_MarkerArray.markers)):
            add_MarkerArray.markers.append(back_MarkerArray.markers[i])
        # print("add",len(add_MarkerArray.markers)/4)
        # print("done")

        if len(add_MarkerArray.markers) == 0:
            return

        header = add_MarkerArray.markers[0].header
        frame = header.seq

        boxes = BoundingBoxArray()  #3D Boxes with JSK
        boxes.header = header

        texts = PictogramArray()  #Labels with JSK
        texts.header = header

        obj_ori_arrows = MarkerArray()  #arrow with visualization_msgs

        velocity_markers = MarkerArray()  #text with visualization_msgs

        obj_path_markers = MarkerArray()  # passed path

        warning_line_markers = MarkerArray()

        dets = np.zeros((0, 9))  # (None, 9) : 9는 사용할 3d bbox의 파라미터 개수

        obj_box_info = np.empty((0, 7))
        obj_label_info = np.empty((0, 2))

        # frame을 rviz에 출력
        overlayTxt = OverlayText()
        overlayTxt.left = 10
        overlayTxt.top = 10
        overlayTxt.width = 1200
        overlayTxt.height = 1200
        overlayTxt.fg_color.a = 1.0
        overlayTxt.fg_color.r = 1.0
        overlayTxt.fg_color.g = 1.0
        overlayTxt.fg_color.b = 1.0
        overlayTxt.text_size = 12
        overlayTxt.text = "Frame_seq : {}".format(frame)

        det_boxes = BoundingBoxArray()  #3D Boxes with JSK
        det_boxes.header = header

        # Receive each objects info in this frame
        for object_info in add_MarkerArray.markers:
            #extract info  [ frame,type(label),tx,ty,tz,h,w,l,ry ]
            if object_info.ns == "/detection/lidar_detector/box_markers":
                tx = object_info.pose.position.x
                ty = object_info.pose.position.y
                tz = object_info.pose.position.z
                l = object_info.scale.x
                w = object_info.scale.y
                h = object_info.scale.z
                quaternion_xyzw = [object_info.pose.orientation.x, object_info.pose.orientation.y, \
                        object_info.pose.orientation.z, object_info.pose.orientation.w]
                rz = tf.transformations.euler_from_quaternion(
                    quaternion_xyzw)[2]
                obj_box_info = np.append(
                    obj_box_info,
                    [[-ty, -tz, tx - 0.27, h, w, l, -rz + np.pi / 2]],
                    axis=0)

                size_det = Vector3(l, w, h)
                det_box = BoundingBox()
                det_box.header = header
                det_box.pose.position = Point(tx, ty, tz)
                q_det_box = tf.transformations.quaternion_from_euler(
                    0.0, 0.0, rz)  # 어쩔 수 없이 끝단에서만 90도 돌림
                det_box.pose.orientation = Quaternion(*q_det_box)
                det_box.dimensions = size_det
                det_boxes.boxes.append(det_box)

            elif object_info.ns == "/detection/lidar_detector/label_markers":
                label = object_info.text.strip()
                if label == '':
                    label = 'None'
                obj_label_info = np.append(obj_label_info, [[frame, label]],
                                           axis=0)

        dets = np.concatenate((obj_label_info, obj_box_info), axis=1)
        self.pub_det_markerarray.publish(det_boxes)

        del current_id_list[:]

        # All Detection Info in one Frame
        bboxinfo = dets[dets[:, 0] == str(frame),
                        2:9]  # [ tx, ty, tz, h, w, l, rz ]
        additional_info = dets[dets[:, 0] == str(frame), 0:2]  # frame, labe
        reorder = [3, 4, 5, 0, 1, 2,
                   6]  # [tx,ty,tz,h,w,l,ry] -> [h,w,l,tx,ty,tz,theta]
        reorder_back = [3, 4, 5, 0, 1, 2,
                        6]  # [h,w,l,tx,ty,tz,theta] -> [tx,ty,tz,h,w,l,ry]
        reorder2velo = [2, 0, 1, 3, 4, 5, 6]
        bboxinfo = bboxinfo[:,
                            reorder]  # reorder bboxinfo parameter [h,w,l,x,y,z,theta]
        bboxinfo = bboxinfo.astype(np.float64)
        dets_all = {'dets': bboxinfo, 'info': additional_info}

        # ObjectTracking from Detection
        trackers = self.mot_tracker.update(dets_all)  # h,w,l,x,y,z,theta
        trackers_bbox = trackers[:, 0:7]
        trackers_info = trackers[:, 7:10]  # id, frame, label
        trackers_bbox = trackers_bbox[:,
                                      reorder_back]  # reorder_back bboxinfo parameter [tx,ty,tz,h,w,l,ry]
        trackers_bbox = trackers_bbox[:,
                                      reorder2velo]  # reorder coordinate system cam to velo
        trackers_bbox = trackers_bbox.astype(np.float64)
        trackers_bbox[:, 0] = trackers_bbox[:, 0]
        trackers_bbox[:, 1] = trackers_bbox[:, 1] * -1
        trackers_bbox[:, 2] = trackers_bbox[:, 2] * -1
        trackers_bbox[:, 6] = trackers_bbox[:, 6] * -1

        # for문을 통해 각 objects들의 정보를 추출하여 사용
        for b, info in zip(trackers_bbox, trackers_info):
            bbox = BoundingBox()
            bbox.header = header

            # parameter 뽑기     [tx,ty,tz,h,w,l,rz]
            tx_trk, ty_trk, tz_trk = float(b[0]), float(b[1]), float(b[2])
            rz_trk = float(b[6])
            size_trk = Vector3(float(b[5]), float(b[4]), float(b[3]))
            obj_id = info[0]
            label_trk = info[2]
            bbox_color = colorCategory20(int(obj_id))

            odom_mat = get_odom(self.tf2, "velo_link", "map")
            xyz = np.array(b[:3]).reshape(1, -1)
            points = np.array((0, 3), float)

            if odom_mat is not None:
                points = get_transformation(odom_mat, xyz)

                # 이전 x frame 까지 지나온 points들을 저장하여 반환하는 함수
                # obj_id와 bbox.label은 단지 type차이만 날뿐 같은 데이터
                # path_points_list = points_path(tx_trk, ty_trk, tz_trk, obj_id)
                path_points_list = points_path(points[0, 0], points[0, 1],
                                               points[0, 2], obj_id)
                map_header = copy.deepcopy(header)
                map_header.frame_id = "/map"
                bbox_color = colorCategory20(int(obj_id))
                path_marker = Marker(
                    type=Marker.LINE_STRIP,
                    id=int(obj_id),
                    lifetime=rospy.Duration(0.5),
                    # pose=Pose(Point(0,0,0), Quaternion(0, 0, 0, 1)),        # origin point position
                    scale=Vector3(0.1, 0.0, 0.0),  # line width
                    header=map_header,
                    color=bbox_color)
                path_marker.points = path_points_list
                obj_path_markers.markers.append(path_marker)

            # Tracker들의 BoundingBoxArray 설정
            bbox.pose.position = Point(tx_trk, ty_trk, tz_trk / 2.0)
            q_box = tf.transformations.quaternion_from_euler(
                0.0, 0.0, rz_trk + np.pi / 2)  # 어쩔 수 없이 끝단에서만 90도 돌림
            bbox.pose.orientation = Quaternion(*q_box)
            bbox.dimensions = size_trk
            bbox.label = int(obj_id)
            boxes.boxes.append(bbox)

            picto_text = Pictogram()
            picto_text.header = header
            picto_text.mode = Pictogram.STRING_MODE
            picto_text.pose.position = Point(tx_trk, ty_trk, -tz_trk)
            # q = tf.transformations.quaternion_from_euler(0.7, 0.0, -0.7)
            picto_text.pose.orientation = Quaternion(0.0, -0.5, 0.0, 0.5)
            picto_text.size = 4
            picto_text.color = std_msgs.msg.ColorRGBA(1, 1, 1, 1)
            picto_text.character = label_trk + ' ' + str(bbox.label)
            texts.pictograms.append(picto_text)

            # GPS sensor values
            oxtLinear = TwistStamped.twist.linear

            # oxtLinear = TwistStamped.twist.linear
            # Tracker들의 속도 추정
            obj_velo, dx_t, dy_t, dz_t = obj_velocity([tx_trk, ty_trk, tz_trk],
                                                      bbox.label, oxtLinear)
            if obj_velo != None:
                obj_velo = np.round_(obj_velo, 1)  # m/s
                obj_velo = obj_velo * 3.6  # km/h
            obj_velo_scale = convert_velo2scale(obj_velo)

            # # Tracker들의 Orientation
            q_ori = tf.transformations.quaternion_from_euler(
                0.0, 0.0, rz_trk + np.pi / 2)  # 어쩔 수 없이 끝단에서만 90도 돌림
            obj_ori_arrow = Marker(
                type=Marker.ARROW,
                id=bbox.label,
                lifetime=rospy.Duration(0.2),
                pose=Pose(Point(tx_trk, ty_trk, tz_trk / 2.0),
                          Quaternion(*q_ori)),
                scale=Vector3(obj_velo_scale, 0.5, 0.5),
                header=header,
                # color=ColorRGBA(0.0, 1.0, 0.0, 0.8))
                color=bbox_color)
            obj_ori_arrows.markers.append(obj_ori_arrow)

            obj_velo_marker = Marker(type=Marker.TEXT_VIEW_FACING,
                                     id=bbox.label,
                                     lifetime=rospy.Duration(0.5),
                                     pose=Pose(Point(tx_trk, ty_trk, tz_trk),
                                               Quaternion(0.0, -0.5, 0.0,
                                                          0.5)),
                                     scale=Vector3(1.5, 1.5, 1.5),
                                     header=header,
                                     color=ColorRGBA(1.0, 1.0, 1.0, 1.0),
                                     text="{}km/h".format(obj_velo))
            velocity_markers.markers.append(obj_velo_marker)
            current_id_list.append(bbox.label)

            # Warning object line
            warning_line = Marker(
                type=Marker.LINE_LIST,
                id=int(obj_id),
                lifetime=rospy.Duration(0.2),
                pose=Pose(Point(0, 0, 0),
                          Quaternion(0, 0, 0, 1)),  # origin point position
                scale=Vector3(0.2, 0.0, 0.0),  # line width
                header=header,
                color=ColorRGBA(1.0, 0.0, 0.0, 1.0))

            d = dist_from_objBbox(tx_trk, ty_trk, tz_trk, size_trk.x,
                                  size_trk.y, size_trk.z)
            if d < MIN_WARNING_DIST:
                warning_line.points = Point(tx_trk, ty_trk,
                                            tz_trk), Point(0.0, 0.0, 0.0)
                warning_line_markers.markers.append(warning_line)

            # Change Outer Circle Color
            outer_circle_color = ColorRGBA(1.0 * 25 / 255, 1.0, 0.0, 1.0)
            if len(warning_line_markers.markers) > 0:
                outer_circle_color = ColorRGBA(1.0 * 255 / 255, 1.0 * 0 / 255,
                                               1.0 * 0 / 255, 1.0)

            # ego_vehicle's warning boundary
            outer_circle = Marker(
                type=Marker.CYLINDER,
                id=int(obj_id),
                lifetime=rospy.Duration(0.5),
                pose=Pose(Point(0.0, 0.0, -2.0), Quaternion(0, 0, 0, 1)),
                scale=Vector3(8.0, 8.0, 0.1),  # line width
                header=header,
                color=outer_circle_color)

            inner_circle = Marker(
                type=Marker.CYLINDER,
                id=int(obj_id),
                lifetime=rospy.Duration(0.5),
                pose=Pose(Point(0.0, 0.0, -1.8), Quaternion(0, 0, 0, 1)),
                scale=Vector3(7.0, 7.0, 0.2),  # line width
                header=header,
                color=ColorRGBA(0.22, 0.22, 0.22, 1.0))

        # ego-vehicle velocity
        selfvelo = np.sqrt(oxtLinear.x**2 + oxtLinear.y**2 + oxtLinear.z**2)
        selfvelo = np.round_(selfvelo, 1)  # m/s
        selfvelo = selfvelo * 3.6  # km/h
        oxtAngular = TwistStamped.twist.angular
        q_gps = tf.transformations.quaternion_from_euler(
            oxtAngular.x, oxtAngular.y, oxtAngular.z)

        # # ego-vehicle 사진 출력
        ego_car = Marker(type=Marker.MESH_RESOURCE,
                         id=0,
                         lifetime=rospy.Duration(0.5),
                         pose=Pose(Point(0.0, 0.0, -1.8),
                                   Quaternion(0, 0, 0, 1)),
                         scale=Vector3(1.5, 1.5, 1.5),
                         header=header,
                         action=Marker.ADD,
                         mesh_resource=CAR_DAE_PATH,
                         color=ColorRGBA(1.0, 1.0, 1.0, 1.0))

        # Self ego Velocity
        text_marker = Marker(type=Marker.TEXT_VIEW_FACING,
                             id=0,
                             lifetime=rospy.Duration(0.5),
                             pose=Pose(Point(-7.0, 0.0, 0.0),
                                       Quaternion(0, 0, 0, 1)),
                             scale=Vector3(1.5, 1.5, 1.5),
                             header=header,
                             color=ColorRGBA(1.0, 1.0, 1.0, 1.0),
                             text="{}km/h".format(selfvelo))

        for i in prior_trk_xyz.keys():
            if i not in current_id_list:
                prior_trk_xyz.pop(i)

        self.pub_frame_seq.publish(overlayTxt)
        self.pub_boxes.publish(boxes)
        self.pub_pictograms.publish(texts)
        self.pub_selfvelo_text.publish(text_marker)
        # self.pub_selfveloDirection.publish(arrow_marker)
        self.pub_objs_ori.publish(obj_ori_arrows)
        self.pub_objs_velo.publish(velocity_markers)
        self.pub_path.publish(obj_path_markers)
        self.pub_warning_lines.publish(warning_line_markers)
        self.pub_ego_outCircle.publish(outer_circle)
        self.pub_ego_innerCircle.publish(inner_circle)
        self.pub_ego_car.publish(ego_car)