protected override void ReceiveMessage(BoundingBoxes message) { Debug.Log($"Recieve BoundingBoxes: {message.bboxes.Length}"); Dictionary <int, Bounds> boundsDict = new Dictionary <int, Bounds>(); for (int i = 0; i < message.bboxes.Length; i++) { BoundingBox bbox = message.bboxes[i]; Vector3 minPtRos = new Vector3(bbox.xmin, bbox.ymin, bbox.zmin); Vector3 maxnPtRos = new Vector3(bbox.xmax, bbox.ymax, bbox.zmax); Vector3 minPt = CoordinateConvert.RosToUnity(minPtRos); Vector3 maxPt = CoordinateConvert.RosToUnity(maxnPtRos); Bounds bounds = new Bounds(); bounds.SetMinMax(minPt, maxPt); boundsDict.Add((int)bbox.bbox_id, bounds); } NewBoundingBoxesListeners.Invoke(boundsDict); }
protected override void BeforeUnsubscribe() { NewBoundingBoxesListeners.Invoke(null); }