This commit is contained in:
2022-08-11 16:24:40 +02:00
commit f55fbfce38
21 changed files with 6836 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
from imp import load_package
try:
load_package("zmq","/Users/gobbo_a/opt/anaconda3/envs/pide/lib/python3.8/site-packages/zmq")
except:
pass
import zmq.backend
import zmq.utils
import zmq.sugar
#import zmq.PUB
#import zmq.Poller
#import zmq._future
load_package("zmq","/Users/gobbo_a/opt/anaconda3/envs/pide/lib/python3.8/site-packages/zmq")
#from cam_server import CameraClient
+15
View File
@@ -0,0 +1,15 @@
import base64
import numpy
#"localhost:5554”
pipeline_client = PipelineClient("http://0.0.0.0:8889")
instance_id, pipeline_stream_address = pipeline_client.create_instance_from_name("simulation_sp", "simulation_sp3")
pipeline_host, pipeline_port = get_host_port_from_stream_address(pipeline_stream_address)
# Subscribe to the stream.
with source(host=pipeline_host, port=pipeline_port, mode=SUB) as stream:
# Receive next message.
data = stream.receive()
+9
View File
@@ -0,0 +1,9 @@
from multiprocessing import Process
def f(name):
print('hello', name)
p = Process(target=f, args=('bob',))
p.start()
p.join()
+35
View File
@@ -0,0 +1,35 @@
#stop_event = multiprocessing.Event()
#parameter_queue = multiprocessing.Queue()
#manager = multiprocessing.Manager()
#statistics = manager.Namespace()
stop_event = threading.Event()
parameter_queue = queue.Queue()
statistics=Namespace()
OUTPUT_PORT = 12005
viewer.show_stream("tcp://localhost:" + str(OUTPUT_PORT))
pipeline_config = PipelineConfig("test_pipeline", parameters={"camera_name": "simulation", "function":"transparent"})
def send():
print ("Startint pipeline on port: ", OUTPUT_PORT)
try:
processing_pipeline(stop_event, statistics, parameter_queue, camera_client, pipeline_config, OUTPUT_PORT, MockBackgroundManager())
except:
traceback.print_exc()
thread = Thread(target=send)
thread.start()
with source(host="127.0.0.1", port=OUTPUT_PORT, mode=SUB, receive_timeout = 3000) as stream:
data = stream.receive()
if not data:
raise Exception("Received None message.")
print (data.data.data.keys())
stop_event.set()
thread.join(5.0)