{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "dvrk-tool-list.schema.json",
    "title": "dVRK tool list",
    "type": "object",
    "description": "Configuration file format for the dVRK tool list.  See the [dVRK documentation](https://dvrk.readthedocs.io).\n\n - This format is used by the application `sawIntuitiveResearchKitSystem` and the ROS application `dvrk_robot dvrk_system`\n - This file defines the mapping between an instrument's name the the file used to define all the parameters for said instrument, i.e. DH, joint limits, maximum torques...\n - For details of implementation, see code under `sawIntuitiveResearchKit/core/components/code/mtsToolList.cpp`\n - [Schema file](dvrk-tool-list.schema.json)\n - Examples can be found in `sawIntuitiveResearchKit/share/tool/index.json` and `sawIntuitiveResearchKit/share/jhu-dVRK/custom-tool/custom-tool-index.json`",
    "additionalProperties": false,
    "properties": {

        "instruments": {
            "type": "array",
            "description": "List of supported instruments (i.e. tools)",
            "items": {
                "type": "object",
                "description": "Definition of an instrument",
                "required": ["model", "names", "description", "generation", "file"],
                "additionalProperties": false,
                "properties": {
                    "model": {
                        "type": "string",
                        "description": "6 digits model number.  The first 3 digits are 400 if the tool is based on a Classic tool, 420 for S.  If you have different instruments make sure this is unique.  For example, the Classic Large Needle Driver model number is \"400006\" and the S/Si Large Needle Driver is \"420006\"."
                    }
                    ,
                    "names": {
                        "type": "array",
                        "description": "Name(s) of the instrument.  This field is compared to the value reported by the instrument's Dallas chip and might vary.  You can provide multiple names.",
                        "items": {
                            "type": "string",
                            "description": "Name of the instrument.  By convention, use all caps with underscores.  For example \"LARGE\\_NEEDLE\\_DRIVER\".  The full name of the instrument is also including the required model and optional version, for example \"LARGE\\_NEEDLE\\_DRIVER:420006[12]"
                        }
                    }
                    ,
                    "version_min": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Minimum version supported.  This is optional but if provided, one must make sure the ranges for a single instrument \"name:model\" don't overlap."
                    }
                    ,
                    "version_max": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Maximum version supported.  This is optional but if provided, one must make sure the ranges for a single instrument \"name:model\" don't overlap.  If \"version\\_min\" is provided but not \"version\\_max\", any instrument with a version higher than \"version_min\" will be using this instrument's \"file\"."
                    }
                    ,
                    "description": {
                        "type": "string",
                        "description": "Human readable string.  This string is used in the GUI in the drop-down menu to select an instrument if the \"tool-detection\" is set to \"MANUAL\".   For example \"Large Needle Driver\"."
                    }
                    ,
                    "generation": {
                        "type": "string",
                        "enum": ["Classic", "S"],
                        "description": "If you are re-using the \"Classic\" instrument, \"S\" otherwise.  For most instruments, this indicates what is the length of the shaft and therefore helps define at what depth the tool should start the engage process."
                    }
                    ,
                    "file": {
                        "type": "string",
                        "description": "File with the tool DH and other parameters.  You should use a path relative to `sawIntuitiveResearchKit/share`.  The file name should match \"<name>\\_<model>.json\", e.g. \"LARGE\\_NEEDLE\\_DRIVER\\_400006.json\""
                    }
                }
            }
        }
    }
}
