Skip to content

Commit b5d0a50

Browse files
committed
comment out cv_bridge
1 parent f147a9a commit b5d0a50

File tree

1 file changed

+18
-13
lines changed
  • formant_ros2_adapter/scripts/components/subscriber

1 file changed

+18
-13
lines changed

formant_ros2_adapter/scripts/components/subscriber/ingester.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from cv_bridge import CvBridge
2-
import cv2
1+
# from cv_bridge import CvBridge
2+
# import cv2
33
import grpc
44
from typing import Dict
55
from sensor_msgs.msg import (
@@ -51,7 +51,7 @@
5151
class Ingester:
5252
def __init__(self, _fclient: Client):
5353
self._fclient = _fclient
54-
self.cv_bridge = CvBridge()
54+
# self.cv_bridge = CvBridge()
5555
self._logger = get_logger()
5656

5757
def ingest(
@@ -124,16 +124,17 @@ def ingest(
124124
)
125125

126126
elif msg_type == Image:
127+
self._logger.info("ROS IMAGE UNSUPPORTED")
127128
# Convert Image to a Formant image
128-
cv_image = self.cv_bridge.imgmsg_to_cv2(msg, "bgr8")
129-
encoded_image = cv2.imencode(".jpg", cv_image)[1].tobytes()
129+
# cv_image = self.cv_bridge.imgmsg_to_cv2(msg, "bgr8")
130+
# encoded_image = cv2.imencode(".jpg", cv_image)[1].tobytes()
130131

131-
self._fclient.post_image(
132-
stream=formant_stream,
133-
value=encoded_image,
134-
tags=tags,
135-
timestamp=msg_timestamp,
136-
)
132+
# self._fclient.post_image(
133+
# stream=formant_stream,
134+
# value=encoded_image,
135+
# tags=tags,
136+
# timestamp=msg_timestamp,
137+
# )
137138

138139
elif msg_type == CompressedImage:
139140
# Post the compressed image
@@ -177,7 +178,9 @@ def ingest(
177178
except grpc.RpcError as e:
178179
return
179180
except Exception as e:
180-
self._logger.error("Could not ingest " + formant_stream + ": " + str(e))
181+
self._logger.error(
182+
"Could not ingest " + formant_stream + ": " + str(e)
183+
)
181184
return
182185

183186
elif msg_type == PointCloud2:
@@ -193,7 +196,9 @@ def ingest(
193196
except grpc.RpcError as e:
194197
return
195198
except Exception as e:
196-
self._logger.error("Could not ingest " + formant_stream + ": " + str(e))
199+
self._logger.error(
200+
"Could not ingest " + formant_stream + ": " + str(e)
201+
)
197202
return
198203

199204
else:

0 commit comments

Comments
 (0)