{
  "_comment": "Robot definition file for Blender/Robot/URDF-style kinematic rendering",

  "coordinateSystem": {
    "_comment": "Global coordinate system definition",

    "system": "right-handed",

    "axes": {
      "x": "right",
      "y": "backward",
      "z": "up"
    },

    "_important": [
      "This coordinate system is intentionally identical to Blender.",
      "All positions are expressed in millimeters.",
      "All rotations are expressed in degrees.",
      "Positive rotations follow the right-hand rule."
    ]
  },

  "units": {
    "length": "mm",
    "rotation": "degree"
  },

  "renderingInfo": {
    "_comment": "Pure rendering settings. Does NOT affect robot kinematics.",

    "cameraPosition": [-400, -700, 300],

    "cameraTarget": [0, 0, 150],

    "_cameraTargetInfo": [
      "cameraTarget defines the world-space point the camera looks at.",
      "Values may also reference state variables like 'x'."
    ],

    "cameraUpVector": [0, 0, 1],

    "lightPosition": [-500, -500, 500],

    "lightTarget": [0, 0, 0],

    "lightUpVector": [0, 0, 1],

    "metric": "mm",

    "materials": {
      "wood": {
        "baseColor": [0.72, 0.52, 0.33],
        "roughness": 0.85,
        "metallic": 0.0
      },

      "plaWhite": {
        "baseColor": [0.95, 0.95, 0.95],
        "roughness": 0.45,
        "metallic": 0.0
      },

      "steel": {
        "baseColor": [0.72, 0.72, 0.75],
        "roughness": 0.25,
        "metallic": 1.0
      },

      "powderCoatBlue": {
        "baseColor": [0.15, 0.25, 0.70],
        "roughness": 0.55,
        "metallic": 0.0
      },

      "defaultPlastic": {
        "baseColor": [0.95, 0.95, 0.95],
        "roughness": 0.40,
        "metallic": 0.0
      }
    }
  },

  "defaultPosition": {
    "_comment": "Robot zero/home position",

    "_important": [
      "These values define the robot's neutral pose.",
      "All joints are evaluated relative to this pose."
    ],

    "x": 0,
    "y": 0,
    "z": 0,

    "a": 0,
    "b": 0,
    "c": 0,

    "e": 0
  },

  "recognized": {
    "_comment": "Pose reconstructed from machine vision / markers",

    "x": null,
    "y": null,
    "z": null,

    "a": null,
    "b": null,
    "c": null,

    "e": null
  },

  "movements": {
    "_comment": "Current commanded movement state (e.g. from GCode)",

    "x": null,
    "y": null,
    "z": null,

    "a": null,
    "b": null,
    "c": null,

    "e": null
  },

  "_statePriority": [
    "movements overrides recognized",
    "recognized overrides defaultPosition",
    "defaultPosition overrides zero"
  ],

  "links": {
    "Board": {
      "_comment": "Static world/base object",

      "parent": null,

      "_mountPositionMeaning": [
        "Position of THIS LINK coordinate system",
        "relative to the PARENT LINK coordinate system"
      ],

      "mountPosition": [0, 0, 0],

      "_mountRotationMeaning": [
        "Mechanical installation rotation",
        "Defines how the LINK coordinate system",
        "is rotated relative to its parent link",
        "This is NOT the joint movement."
      ],

      "mountRotation": [0, 0, 0],

      "_modelMeaning": [
        "One link may consist of multiple STL surfaces.",
        "Each STL is positioned relative to the LINK coordinate system."
      ],

      "model": [
        {
          "_comment": "Visual geometry only",

          "stlFile": "surfaces/Board.stl",

          "_originOfModelMeaning": [
            "Position of STL inside the LINK coordinate system",
            "Purely visual adjustment",
            "Used to compensate CAD export offsets"
          ],

          "originOfModel": [0, 0, 0],

          "_rotationOfModelMeaning": [
            "Rotation of STL inside LINK coordinate system",
            "Purely visual adjustment",
            "Used to compensate CAD export orientation"
          ],

          "rotationOfModelDegree": [0, 0, 90],

          "material": "wood"
        }
      ]
    },

    "Base": {
      "_comment": "Linear axis mounted on Board",

      "parent": "Board",

      "mountPosition": [0, 0, 25],

      "mountRotation": [0, 0, 0],

      "_jointToParentMeaning": [
        "Defines the kinematic transformation",
        "between parent link and this link"
      ],

      "jointToParent": {
        "name": "Slider",

        "_jointTypeMeaning": [
          "fixed      = no movement",
          "linear     = translational movement",
          "revolute   = rotational movement"
        ],

        "type": "linear",

        "_axisMeaning": [
          "Joint movement axis in LOCAL joint coordinates",
          "[1,0,0] = local X axis",
          "[0,1,0] = local Y axis",
          "[0,0,1] = local Z axis"
        ],

        "axis": [1, 0, 0],

        "_originMeaning": [
          "Position of joint coordinate system",
          "inside the parent link coordinate system"
        ],

        "origin": [0, 0, 0],

        "_rotationMeaning": [
          "Orientation of joint coordinate system",
          "inside the parent link coordinate system"
        ],

        "rotation": [0, 0, 0],

        "_variableMeaning": [
          "Maps robot state variable",
          "to this joint"
        ],

        "variable": "x"
      },

      "model": [
        {
          "stlFile": "surfaces/Base.stl",

          "originOfModel": [0, 0, 0],

          "rotationOfModelDegree": [0, 0, 0],

          "material": "plaWhite"
        }
      ]
    },

    "Arm1": {
      "_comment": "Rotational arm",

      "parent": "Base",

      "mountPosition": [150, 0, 150],

      "mountRotation": [0, 0, 0],

      "jointToParent": {
        "name": "Joint1",

        "type": "revolute",

        "_important": [
          "Positive rotation follows right-hand rule."
        ],

        "axis": [1, 0, 0],

        "origin": [0, 0, 0],

        "rotation": [0, 0, 0],

        "variable": "a"
      },

      "model": [
        {
          "stlFile": "surfaces/Holm.stl",

          "originOfModel": [0, 0, 0],

          "rotationOfModelDegree": [0, 0, 0],

          "material": "powderCoatBlue"
        }
      ]
    }
  },

  "_kinematicStructure": {
    "_comment": "Conceptual hierarchy",

    "hierarchy": [
      "ParentLink",
      "-> JointOrigin",
      "-> JointMotion",
      "-> ChildLink",
      "-> VisualMeshes"
    ],

    "_important": [
      "All children automatically inherit parent movement.",
      "This creates full forward kinematics automatically.",
      "No manual propagation of child transformations is required."
    ]
  },

  "_futureExtensions": {
    "_comment": "Planned future capabilities",

    "possibleFeatures": [
      "marker definitions",
      "inverse kinematics",
      "collision geometry",
      "joint limits",
      "joint damping",
      "mass/inertia",
      "vision calibration",
      "urdf export",
      "gcode import",
      "trajectory playback"
    ]
  }
}