@depz/camera-sdk 0.0.0-stage → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // GENERATED by packages/depz-camera-sdk-ts/tools/gen_bindings.py from contracts/sdk/include/depz/{depz,inference,depth}.h and contracts/errors.json. Do not edit: change the contract, then run the generator.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.ERROR_CODES = exports.ErrorCode = void 0;
6
+ /** A stable error code (contracts/errors.json). Its frozen value is the C status;
7
+ * {@link errorCodeName} gives its name ("camera_busy"). */
8
+ var ErrorCode;
9
+ (function (ErrorCode) {
10
+ /** an operation was cancelled on request (an inference aborted by stop); not a fault */
11
+ ErrorCode[ErrorCode["Aborted"] = 1] = "Aborted";
12
+ /** a model download failed (network, HTTP status, truncated file, a slug the registry does not resolve, a file or archive whose size or SHA-256 is not the declared one) */
13
+ ErrorCode[ErrorCode["DownloadFailed"] = 2] = "DownloadFailed";
14
+ /** the camera has old firmware without its calibration (the legacy-v1 firmware); it is used once its firmware is updated */
15
+ ErrorCode[ErrorCode["LegacyCamera"] = 3] = "LegacyCamera";
16
+ /** the camera's serial is not a valid DEPZ serial (a catalog prefix + 8 characters), or its USB product id is not the one of the serial's variant */
17
+ ErrorCode[ErrorCode["InvalidSerial"] = 4] = "InvalidSerial";
18
+ /** the camera's name or USB serial number is not of the form a DEPZ camera has, and it is not old firmware either */
19
+ ErrorCode[ErrorCode["UnrecognisedCamera"] = 5] = "UnrecognisedCamera";
20
+ /** no DEPZ camera is attached, or none with the requested serial */
21
+ ErrorCode[ErrorCode["CameraNotFound"] = 6] = "CameraNotFound";
22
+ /** the camera did not open after retries: another program holds it, or its USB connection is in a wedged state */
23
+ ErrorCode[ErrorCode["CameraBusy"] = 7] = "CameraBusy";
24
+ /** the system refused this program access to the camera (Linux: no permission on its video device; Windows: camera access is off in the privacy settings) */
25
+ ErrorCode[ErrorCode["CameraPermissionDenied"] = 8] = "CameraPermissionDenied";
26
+ /** the camera has no calibration (number 0), or none of its sources gave one that can be read */
27
+ ErrorCode[ErrorCode["NoCalibration"] = 9] = "NoCalibration";
28
+ /** the camera carries a calibration of a scheme this SDK cannot use */
29
+ ErrorCode[ErrorCode["UnsupportedScheme"] = 10] = "UnsupportedScheme";
30
+ /** the camera names a camera family this SDK does not know */
31
+ ErrorCode[ErrorCode["UnknownCameraFamily"] = 11] = "UnknownCameraFamily";
32
+ /** not enough USB bandwidth for this mode: too many cameras on this USB hub/controller, or the mode needs more than the port gives (not another program holding the camera) */
33
+ ErrorCode[ErrorCode["UsbBandwidth"] = 12] = "UsbBandwidth";
34
+ /** a live source delivers no frames although its stream is open (reported while the pipeline runs; nothing is restarted) */
35
+ ErrorCode[ErrorCode["NoFrames"] = 13] = "NoFrames";
36
+ /** the camera's stream stopped while capturing (the device went away or failed) */
37
+ ErrorCode[ErrorCode["CaptureStopped"] = 14] = "CaptureStopped";
38
+ /** the recording is of schema 3: it is opened once it is migrated to schema 6 */
39
+ ErrorCode[ErrorCode["RecordingNeedsMigration"] = 15] = "RecordingNeedsMigration";
40
+ /** the pipeline cannot take a calibration correction now; retried later */
41
+ ErrorCode[ErrorCode["RecalibrationDeferred"] = 16] = "RecalibrationDeferred";
42
+ /** a stereo depth model was asked for a source with one eye (a mono camera, a single-eye recording) */
43
+ ErrorCode[ErrorCode["ModelNeedsStereo"] = 17] = "ModelNeedsStereo";
44
+ /** the file is a recording of a schema that is neither opened nor migrated (1, 2, 4, 5, or newer than the SDK), or no DEPZ recording (no schema tag) */
45
+ ErrorCode[ErrorCode["RecordingUnsupported"] = 18] = "RecordingUnsupported";
46
+ /** the model, or the model at this input size, is not offered on the engine (contracts/models/compat.json: never, a TensorRT precision it is not verified for, below the engine's minimum input or at its maximum, a size not built for the Rockchip NPU or measured there outside the tolerance); nothing was downloaded */
47
+ ErrorCode[ErrorCode["ModelNotOffered"] = 19] = "ModelNotOffered";
48
+ /** a capture mode the camera's firmware advertises but the SDK does not offer: its picture is a crop of the sensor's or squeezed unevenly, so the calibration does not map onto it (asked for, or a recording made in one) */
49
+ ErrorCode[ErrorCode["ModeNotOffered"] = 20] = "ModeNotOffered";
50
+ /** a calibration string, record or correction does not follow the format */
51
+ ErrorCode[ErrorCode["CalibrationMalformed"] = 21] = "CalibrationMalformed";
52
+ /** the calibration web API did not answer as its contract says */
53
+ ErrorCode[ErrorCode["CalibrationWeb"] = 22] = "CalibrationWeb";
54
+ /** the camera to flash is missing, is not a camera the flasher knows, or does not answer as expected */
55
+ ErrorCode[ErrorCode["FlashDevice"] = 23] = "FlashDevice";
56
+ /** the firmware image could not be built or fails a structural check (the camera was not written) */
57
+ ErrorCode[ErrorCode["FirmwareImage"] = 24] = "FirmwareImage";
58
+ /** a firmware flash, update or restore stopped; the exception's camera_state says what the camera runs now (unchanged, isp: recovery mode, flashed, partial, unknown) */
59
+ ErrorCode[ErrorCode["FlashAborted"] = 25] = "FlashAborted";
60
+ /** the system does not offer what was asked (no controls, no serial, no engine) */
61
+ ErrorCode[ErrorCode["Unavailable"] = 26] = "Unavailable";
62
+ /** writing a camera's firmware or calibration is not available on this operating system yet (Windows: until that path is verified on hardware); nothing was written */
63
+ ErrorCode[ErrorCode["UnsupportedPlatform"] = 27] = "UnsupportedPlatform";
64
+ /** an argument has the wrong type or value, or names a choice that is not one of the allowed ones */
65
+ ErrorCode[ErrorCode["InvalidArgument"] = 28] = "InvalidArgument";
66
+ /** a file, camera, model, stage, control or other named thing does not exist */
67
+ ErrorCode[ErrorCode["NotFound"] = 29] = "NotFound";
68
+ /** the operating system refused an operation or a file could not be read or written */
69
+ ErrorCode[ErrorCode["IoError"] = 30] = "IoError";
70
+ /** an operation did not finish in time */
71
+ ErrorCode[ErrorCode["Timeout"] = 31] = "Timeout";
72
+ /** anything else: a bug, or a failure without a more precise code */
73
+ ErrorCode[ErrorCode["Internal"] = 32] = "Internal";
74
+ /** the object is not in a state that allows the call: a pipeline started twice or used after stop, a source read while a pipeline owns it, an operation on something closed */
75
+ ErrorCode[ErrorCode["InvalidState"] = 33] = "InvalidState";
76
+ /** another job runs that holds what the call needs (a flash, an update, a calibration, an extension unit another program uses); try again when it ends */
77
+ ErrorCode[ErrorCode["Busy"] = 34] = "Busy";
78
+ /** the call is part of the interface but this build of the SDK does not carry it out yet (the native SDK while it is ported); not a fault of the arguments or of the system */
79
+ ErrorCode[ErrorCode["NotImplemented"] = 35] = "NotImplemented";
80
+ /** the program and the SDK library do not agree on the interface: the program was built for a newer API version than the library has, or passed a struct whose struct_size is too small to read (the native C interface) */
81
+ ErrorCode[ErrorCode["UnsupportedVersion"] = 36] = "UnsupportedVersion";
82
+ /** a finite source (a recording that does not loop) has delivered its last frame: none follows until it is repositioned (a seek, a step) or opened again; not a fault. The reference says it without raising: grab() and the pipeline's get() give None with at_eof set, iterating the pipeline stops; the C interface returns this code there */
83
+ ErrorCode[ErrorCode["EndOfStream"] = 37] = "EndOfStream";
84
+ /** an inference engine could not build or compile the model for this device (a TensorRT plan that this GPU, precision and TensorRT version cannot build). It is not a fault of the model file or of the arguments. details: model, precision, gpu, sm, cause (the engine's first error line), and suggestion when another engine is expected to work (tensorrt-fp32 after a failed fp16 build) */
85
+ ErrorCode[ErrorCode["EngineBuildFailed"] = 38] = "EngineBuildFailed";
86
+ /** a file or record the call reads does not follow its format (a JSON file of the wrong shape, a lens-model file, settings read from a file); not an argument of the call and not a calibration string (calibration_malformed) */
87
+ ErrorCode[ErrorCode["InvalidData"] = 39] = "InvalidData";
88
+ /** a calibration or a correction could not be computed from what was given: too few usable board views, the cameras never see the board together, the solver found no start, a correction larger than a camera can drift; nothing was changed */
89
+ ErrorCode[ErrorCode["CalibrationFailed"] = 40] = "CalibrationFailed";
90
+ })(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
91
+ /** Every code in the order of errors.json: [code, name, meaning]. */
92
+ exports.ERROR_CODES = [
93
+ [ErrorCode.Aborted, "aborted", "an operation was cancelled on request (an inference aborted by stop); not a fault"],
94
+ [ErrorCode.DownloadFailed, "download_failed", "a model download failed (network, HTTP status, truncated file, a slug the registry does not resolve, a file or archive whose size or SHA-256 is not the declared one)"],
95
+ [ErrorCode.LegacyCamera, "legacy_camera", "the camera has old firmware without its calibration (the legacy-v1 firmware); it is used once its firmware is updated"],
96
+ [ErrorCode.InvalidSerial, "invalid_serial", "the camera's serial is not a valid DEPZ serial (a catalog prefix + 8 characters), or its USB product id is not the one of the serial's variant"],
97
+ [ErrorCode.UnrecognisedCamera, "unrecognised_camera", "the camera's name or USB serial number is not of the form a DEPZ camera has, and it is not old firmware either"],
98
+ [ErrorCode.CameraNotFound, "camera_not_found", "no DEPZ camera is attached, or none with the requested serial"],
99
+ [ErrorCode.CameraBusy, "camera_busy", "the camera did not open after retries: another program holds it, or its USB connection is in a wedged state"],
100
+ [ErrorCode.CameraPermissionDenied, "camera_permission_denied", "the system refused this program access to the camera (Linux: no permission on its video device; Windows: camera access is off in the privacy settings)"],
101
+ [ErrorCode.NoCalibration, "no_calibration", "the camera has no calibration (number 0), or none of its sources gave one that can be read"],
102
+ [ErrorCode.UnsupportedScheme, "unsupported_scheme", "the camera carries a calibration of a scheme this SDK cannot use"],
103
+ [ErrorCode.UnknownCameraFamily, "unknown_camera_family", "the camera names a camera family this SDK does not know"],
104
+ [ErrorCode.UsbBandwidth, "usb_bandwidth", "not enough USB bandwidth for this mode: too many cameras on this USB hub/controller, or the mode needs more than the port gives (not another program holding the camera)"],
105
+ [ErrorCode.NoFrames, "no_frames", "a live source delivers no frames although its stream is open (reported while the pipeline runs; nothing is restarted)"],
106
+ [ErrorCode.CaptureStopped, "capture_stopped", "the camera's stream stopped while capturing (the device went away or failed)"],
107
+ [ErrorCode.RecordingNeedsMigration, "recording_needs_migration", "the recording is of schema 3: it is opened once it is migrated to schema 6"],
108
+ [ErrorCode.RecalibrationDeferred, "recalibration_deferred", "the pipeline cannot take a calibration correction now; retried later"],
109
+ [ErrorCode.ModelNeedsStereo, "model_needs_stereo", "a stereo depth model was asked for a source with one eye (a mono camera, a single-eye recording)"],
110
+ [ErrorCode.RecordingUnsupported, "recording_unsupported", "the file is a recording of a schema that is neither opened nor migrated (1, 2, 4, 5, or newer than the SDK), or no DEPZ recording (no schema tag)"],
111
+ [ErrorCode.ModelNotOffered, "model_not_offered", "the model, or the model at this input size, is not offered on the engine (contracts/models/compat.json: never, a TensorRT precision it is not verified for, below the engine's minimum input or at its maximum, a size not built for the Rockchip NPU or measured there outside the tolerance); nothing was downloaded"],
112
+ [ErrorCode.ModeNotOffered, "mode_not_offered", "a capture mode the camera's firmware advertises but the SDK does not offer: its picture is a crop of the sensor's or squeezed unevenly, so the calibration does not map onto it (asked for, or a recording made in one)"],
113
+ [ErrorCode.CalibrationMalformed, "calibration_malformed", "a calibration string, record or correction does not follow the format"],
114
+ [ErrorCode.CalibrationWeb, "calibration_web", "the calibration web API did not answer as its contract says"],
115
+ [ErrorCode.FlashDevice, "flash_device", "the camera to flash is missing, is not a camera the flasher knows, or does not answer as expected"],
116
+ [ErrorCode.FirmwareImage, "firmware_image", "the firmware image could not be built or fails a structural check (the camera was not written)"],
117
+ [ErrorCode.FlashAborted, "flash_aborted", "a firmware flash, update or restore stopped; the exception's camera_state says what the camera runs now (unchanged, isp: recovery mode, flashed, partial, unknown)"],
118
+ [ErrorCode.Unavailable, "unavailable", "the system does not offer what was asked (no controls, no serial, no engine)"],
119
+ [ErrorCode.UnsupportedPlatform, "unsupported_platform", "writing a camera's firmware or calibration is not available on this operating system yet (Windows: until that path is verified on hardware); nothing was written"],
120
+ [ErrorCode.InvalidArgument, "invalid_argument", "an argument has the wrong type or value, or names a choice that is not one of the allowed ones"],
121
+ [ErrorCode.NotFound, "not_found", "a file, camera, model, stage, control or other named thing does not exist"],
122
+ [ErrorCode.IoError, "io_error", "the operating system refused an operation or a file could not be read or written"],
123
+ [ErrorCode.Timeout, "timeout", "an operation did not finish in time"],
124
+ [ErrorCode.Internal, "internal", "anything else: a bug, or a failure without a more precise code"],
125
+ [ErrorCode.InvalidState, "invalid_state", "the object is not in a state that allows the call: a pipeline started twice or used after stop, a source read while a pipeline owns it, an operation on something closed"],
126
+ [ErrorCode.Busy, "busy", "another job runs that holds what the call needs (a flash, an update, a calibration, an extension unit another program uses); try again when it ends"],
127
+ [ErrorCode.NotImplemented, "not_implemented", "the call is part of the interface but this build of the SDK does not carry it out yet (the native SDK while it is ported); not a fault of the arguments or of the system"],
128
+ [ErrorCode.UnsupportedVersion, "unsupported_version", "the program and the SDK library do not agree on the interface: the program was built for a newer API version than the library has, or passed a struct whose struct_size is too small to read (the native C interface)"],
129
+ [ErrorCode.EndOfStream, "end_of_stream", "a finite source (a recording that does not loop) has delivered its last frame: none follows until it is repositioned (a seek, a step) or opened again; not a fault. The reference says it without raising: grab() and the pipeline's get() give None with at_eof set, iterating the pipeline stops; the C interface returns this code there"],
130
+ [ErrorCode.EngineBuildFailed, "engine_build_failed", "an inference engine could not build or compile the model for this device (a TensorRT plan that this GPU, precision and TensorRT version cannot build). It is not a fault of the model file or of the arguments. details: model, precision, gpu, sm, cause (the engine's first error line), and suggestion when another engine is expected to work (tensorrt-fp32 after a failed fp16 build)"],
131
+ [ErrorCode.InvalidData, "invalid_data", "a file or record the call reads does not follow its format (a JSON file of the wrong shape, a lens-model file, settings read from a file); not an argument of the call and not a calibration string (calibration_malformed)"],
132
+ [ErrorCode.CalibrationFailed, "calibration_failed", "a calibration or a correction could not be computed from what was given: too few usable board views, the cameras never see the board together, the solver found no start, a correction larger than a camera can drift; nothing was changed"],
133
+ ];