Main: scwips/cmd Command to everyone {"cmd": "shutdown"} ...also all commands from Camera / ImgProcs, will then be acted on by all. Cameras: scwips/cam/c0/info Camera static info dump. Camera posts on connect, and on "postinfo" cmd. { "name": "c0", "pixw": 1280, "pixh": 960, "type": {"name": "fisheye", "param": [1.23, 4.56, 7.89]}, "distortion": {"name": "xyshifted", "param": [1.23, 4.56, 7.89]} } scwips/cam/c0/pix Cam-detected blinker pixel coordinate and size {"pixx": 123.3, "pixy": 345.1, "pixw": 3.5, "pixh": 2.2} Width/height are optional, taken as 1 by default. {"lost": "fix"} Explicit no-fix report; but any receiver should also apply timeout ~1sec. {"lost": "connection"} Connection-lost report (last will). scwips/cam/c0/calcpix From objecttracking back to camera: object pixel that camera should be seeing (e.g. if occluded or out of range). {"pixx": 123, "pixy": 345} {"lost": "fix"} Objecttracking has no fix, But camera should also apply some timeout. scwips/cam/c0/status Various real-time information, mostly reported in separate posts. Report of #frames processed in last second {"fps": 21.0} Report of detected average binks per second. Should preferably be fps/4 or lower. {"blinkspersec": 3.5} Report of actual applied blink height threshold. Value in configfile should be ~half this value or so. {"blinkthres": 234.5} Report of actual fine-tuned color filter. Copy RGB value to configfile. {"blinkcolor": {"rgb": {"r": 123, "g": 234, "b":56}, "ycbcr": {"y": 321, "cb": 23, "cr": 123}}} scwips/cam/c0/img/orig/pnm scwips/cam/c0/img/orig/yuv4mpeg scwips/cam/c0/img/colfilt/pnm Image content (binary) posted by camera. Will be picked up by image processor(s), see below. "P6\n255\n640 480\nBinarydata..." for pnm "YUV4MPEG2 W640 H480 ...." for yuv4mpeg scwips/cam/cmd Command to all cameras scwips/cam/c0/cmd Command to specific camera {"cmd": "shutdown"} {"cmd": "postinfo"} --> cam will (re)post to /info {"cmd": "postimg", "img": "orig"} --> cam will post to /img/orig {"cmd": "postimg", "img": "colfilt"} --> cam will post to /img/colfilt scwips/cam/c0/log Line-based informative printable; and devel debugging. scwips/cam/c0/debug (Debug is high-traffic, ~every frame) Scene calculator(s): Multiple instances may run in parallel. Each uses different random starting positions, and calcultes repeatedly until solution found or commanded to stop. scwips/scene/observ From frontend to all scenecalc: full scene observation list. On receiving this, all scenecalc's will start doing full recalcs, until acceptable result found or "stopcalc" received. List of heights, distances, and camera pixels; may even be combined for same object. [ {"obj": "cam1", "z": 1.234}, {"obj": "o3", "obj2": "o5", "d": 2.3}, {"obj": "o4", "cam": "cam2", "pixx": 123.4, "pixy": 345.6, "pixw": 3, "pixh": 2}, "# starting guess instead of random (debug):", {"obj": "cam/obj", "x": 1.2, "y": 3.5, "a": 0.3, "b": 0.1, "g": -0.1}, "# optionally set maximum limit for acceptance:", "sumofsquares-limit": 0.050 ] Any cam that is not mentioned in any observation, will further be excluded. Mentioned cam that had no info posted, will also be excluded. scwips/scene/result Scene calculation results = positions for all cams (and first time only, object-"snapshots") [ {"cam": "cam2", "x": 2.34, "y": 3.45, "z": 1.23, "a": -2.1, "b": 0.34, "g": 1.23}, {"obj": "o4", "x": 2.34, "y": 3.45, "z": 1.23}, {"global": {"instance": "s0", "sumofsquares": 0.003, "rounds": 86}} ] Once a calculator has an acceptable result, it will first post "stopcalc" to /cmd so that other calculators will not continue, then post to /result. Object tracker uses this to start tracking. scwips/scene/sc0/log Detailed fitting results of every attempt, unformatted. scwips/scene/sc0/debug Debug messages, unformatted. Includes starting guesses of every attempt. scwips/scene/cmd Command to all scene calculators scwips/scene/sc0/cmd Command to one specific scene calculator {"cmd": "shutdown"} {"cmd": "stopcalc"} --> scenecalc will stop calculating {"cmd": "postresult"} --> if scenecalc had result before being stopped, it will repost to /result Object tracker: Waits for scene/result to be posted, then starts tracking object. scwips/objtrack/result Detected object coord x/y/z (meters) Can only start after successful scenecalib {"x": 1.234, "y": 5.678, "z": 9.012, "sumofsquares": 0.000123, "rounds": 12} {"lost": "fix"} = no fix {"lost": "connection"} = no connection But all users should also have timeout ~1sec. scwips/objtrack/cmd Command to object tracker {"cmd": "shutdown"} scwips/objtrack/log Line-based informative printable; and devel debugging. scwips/objtrack/debug Image processors/converters: Take binary images posted on mqtt, convert to file, and post location. Processors may run locally on multiple systems. scwips/imgproc/proc0/status Real-time information, may be in separate posts. {"state": "idle"} scwips/cam/c0/img/orig/jpeg/proc0/loc scwips/cam/c0/img/colfilt/jpeg/proc0/loc Report that image file is ready on specified location { "file": "/tmp/somewhere/file.jpg", "url": "http://server/path/file.jpg", "pixw": 640, "pixh": 480 } "file" and/or "url" may be absent. Size is reported to allow any receivers to set window/box dimensions before obtaining image. scwips/imgproc/proc0/cmd Command to specific img processor {"cmd": "shutdown"} scwips/imgproc/proc0/log scwips/imgproc/proc0/debug Line-based informative printable; and devel debugging. Spatial data collectors: Keep memory of data points and their location in 3D space. scwips/collect/cl0/info Collector static info dump / announcement. Collector posts after first data reception, and on "postinfo" cmd. {"name": "cl0"} scwips/collect/cl0/bindata Binary data dump, with json header. Collector posts after "postdata" cmd. <4bytes: value 55930 = 0x0000DA7A for endianness check> <4bytes: #bytes in json header> { "format": "xy,data:interleaved", "axes": [ { (opt. "label": "x",) "items": 300, "interval": 0.1, "firstitem": -15.0 }, { (opt. "label": "y",) "items": 400, "interval": 0.1, "firstitem": -20.0 } ], "planes": [ { "label": "meas1", "itemformat": "double-x86", "rounddata": 2.0 } ], "renders": [ { "name": "xy-z-tile", "type": "mathgl-tile", "plane-color": "meas1", "pixw": 1200, "pixh": 900 }, { "name": "xy-z-csv", "type": "csv", "plane": "meas1" } ], "last-received": {"x": 1.23, "y": 5.43} } [[format may have additional compat checking header overall or per plane]] For interleaved data, all data should really use same itemformat. Note that collectors and rendering processors only support very specific data formats. Unsupported formats will be ignored. In this example, the amount of useful binary data folowing any (fixed) binary compat checking header is expected to be exactly 300*400=120000 double values = 960000 bytes. When *any other* amount of data is present, it must be assumed to be corrupted, and entire message must be ignored completely. scwips/collect/cmd Command to all data collectors scwips/collect/cl0/cmd Command to specific data collector {"cmd": "shutdown"} {"cmd": "postinfo"} --> will post to /info {"cmd": "postdata"} --> will post to /bindata (so that render may pick it up) scwips/collect/cl0/log Line-based informative printable; and devel debugging. scwips/collect/cl0/debug Spatial rendering processors: Take binary data posted on mqtt, render as (image) file, and post location. Processors may run locally on multiple systems. scwips/render/r0/status Real-time information, may be in separate posts. {"state": "idle"} scwips/collect/cl0/img/xy-z-tile/jpeg/r0/loc scwips/collect/cl0/img/xy-z-csv/csv/r0/loc Output file locations as produced by renderings, from /bindata under same base topics. { "file": "/tmp/somewhere/file.jpg", "url": "http://server/path/file.jpg", "pixw": 640, "pixh": 480 } scwips/render/cmd Command to all renderers scwips/render/r0/cmd Command to specific renderer {"cmd": "shutdown"} scwips/render/r0/log Line-based informative printable; and devel debugging. scwips/render/r0/debug