Skip to content

Commit c3d0c41

Browse files
committed
AAGSB-2042 mods to stream camera data
1 parent 2e1ceba commit c3d0c41

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

rosboard/compression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ def compress_compressed_image(msg, output):
146146
stride = int(np.ceil(max(img.shape[0] / 800.0, img.shape[1] / 800.0)))
147147
img = img[::stride,::stride]
148148
img_jpeg = encode_jpeg(img)
149+
output["_data_jpeg"] = base64.b64encode(img_jpeg).decode()
150+
output["_data_shape"] = list(original_shape)
149151
except Exception as e:
150152
output["_error"] = "Error: %s" % str(e)
151-
output["_data_jpeg"] = base64.b64encode(img_jpeg).decode()
152-
output["_data_shape"] = list(original_shape)
153153

154154

155155
def compress_image(msg, output):

rosboard/html/js/viewers/ImageViewer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class ImageViewer extends Viewer {
7373

7474
decodeAndRenderCompressed(msg) {
7575
this.img[0].src = "data:image/jpeg;base64," + msg._data_jpeg;
76+
this.img[0].id = msg._topic_name;
7677
this.lastMsg = msg;
7778
}
7879

0 commit comments

Comments
 (0)