Skip to content

Commit

Permalink
compressed_vipc.py fixes (commaai#32699)
Browse files Browse the repository at this point in the history
* Restored VISION_STREAM_* to original index order

* Register exit handler
  • Loading branch information
andiradulescu authored Jun 11, 2024
1 parent 9654151 commit 4581f6c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/camerastream/compressed_vipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import numpy as np
import multiprocessing
import time
import signal

import cereal.messaging as messaging
from msgq.visionipc import VisionIpcServer, VisionStreamType
Expand All @@ -18,8 +19,8 @@

ENCODE_SOCKETS = {
VisionStreamType.VISION_STREAM_ROAD: "roadEncodeData",
VisionStreamType.VISION_STREAM_WIDE_ROAD: "wideRoadEncodeData",
VisionStreamType.VISION_STREAM_DRIVER: "driverEncodeData",
VisionStreamType.VISION_STREAM_WIDE_ROAD: "wideRoadEncodeData",
}

def decoder(addr, vipc_server, vst, nvidia, W, H, debug=False):
Expand Down Expand Up @@ -147,10 +148,14 @@ def kill(self):

vision_streams = [
VisionStreamType.VISION_STREAM_ROAD,
VisionStreamType.VISION_STREAM_WIDE_ROAD,
VisionStreamType.VISION_STREAM_DRIVER,
VisionStreamType.VISION_STREAM_WIDE_ROAD,
]

vsts = [vision_streams[int(x)] for x in args.cams.split(",")]
cvipc = CompressedVipc(args.addr, vsts, args.nvidia, debug=(not args.silent))

# register exit handler
signal.signal(signal.SIGINT, lambda sig, frame: cvipc.kill())

cvipc.join()

0 comments on commit 4581f6c

Please sign in to comment.