{
  "schema_version": "1",
  "interpretation": "data_only",
  "hub_commit": "ede75c00118e9808e5099da43c26f4619cc3bc37",
  "skill_id": "pythonrobotics-pendulum-lqr",
  "name": "Inverted-pendulum discrete LQR feedback",
  "example_input": {
    "state": [
      0,
      0,
      0.1,
      0
    ],
    "state_cost_diagonal": [
      1.0,
      1.0,
      10.0,
      1.0
    ],
    "force_cost": 1.0
  },
  "environment": [
    {
      "runtime": "pythonrobotics",
      "runtime_version": "cdd0cc888802",
      "robot": "mathematical-model",
      "controller": "json-contract-v1",
      "observation": "explicit-json-input",
      "os": "windows",
      "architecture": "x86_64",
      "python": "3.10",
      "status": "hub_verified"
    },
    {
      "runtime": "pythonrobotics",
      "runtime_version": "cdd0cc888802",
      "robot": "mathematical-model",
      "controller": "json-contract-v1",
      "observation": "explicit-json-input",
      "os": "linux",
      "architecture": "x86_64",
      "python": "3.10",
      "status": "hub_verified"
    }
  ],
  "interface": {
    "version": "1",
    "kind": "controller",
    "abstraction_level": 1,
    "execution_domain": "computation",
    "language": "python",
    "input_transport": "json_file_or_inline",
    "output_transport": "json_stdout",
    "conventions": {
      "linear_unit": "m",
      "angular_unit": "rad",
      "time_unit": "s",
      "coordinate_frame": "cart_axis_and_upright_pendulum; state=[x_m,v_m_s,theta_rad,omega_rad_s]",
      "joint_order": "not_used",
      "quaternion_order": "not_used"
    },
    "input_schema": {
      "type": "object",
      "required": [
        "state",
        "state_cost_diagonal",
        "force_cost"
      ],
      "additionalProperties": false,
      "properties": {
        "state": {
          "type": "array",
          "minItems": 4,
          "maxItems": 4,
          "items": {
            "type": "number",
            "minimum": -2,
            "maximum": 2
          },
          "x-unit": "mixed",
          "x-frame": "cart_axis_and_upright_pendulum; state=[x_m,v_m_s,theta_rad,omega_rad_s]",
          "x-order": [
            "x_m",
            "velocity_m_s",
            "theta_rad",
            "omega_rad_s"
          ],
          "description": "state; units=mixed; frame=cart_axis_and_upright_pendulum; state=[x_m,v_m_s,theta_rad,omega_rad_s]; component order=x_m,velocity_m_s,theta_rad,omega_rad_s"
        },
        "state_cost_diagonal": {
          "type": "array",
          "minItems": 4,
          "maxItems": 4,
          "items": {
            "type": "number",
            "minimum": 0.1,
            "maximum": 100
          },
          "x-unit": "positive_state_cost_weights",
          "x-frame": "cart_axis_and_upright_pendulum; state=[x_m,v_m_s,theta_rad,omega_rad_s]",
          "description": "Explicit positive state costs; unlike the upstream demo default, cart position is included."
        },
        "force_cost": {
          "type": "number",
          "minimum": 0.1,
          "maximum": 100,
          "x-unit": "positive_control_cost_weight",
          "x-frame": "cart_axis_and_upright_pendulum; state=[x_m,v_m_s,theta_rad,omega_rad_s]"
        }
      }
    },
    "output_schema": {
      "type": "object",
      "required": [
        "force_n",
        "gain",
        "closed_loop_spectral_radius"
      ],
      "additionalProperties": false,
      "properties": {
        "force_n": {
          "type": "number",
          "minimum": -10000,
          "maximum": 10000,
          "x-unit": "N",
          "x-frame": "cart_axis_and_upright_pendulum; state=[x_m,v_m_s,theta_rad,omega_rad_s]",
          "description": "force_n; units=N; frame=cart_axis_and_upright_pendulum; state=[x_m,v_m_s,theta_rad,omega_rad_s]"
        },
        "gain": {
          "type": "array",
          "minItems": 4,
          "maxItems": 4,
          "items": {
            "type": "number",
            "minimum": -10000,
            "maximum": 10000
          },
          "x-unit": "mixed",
          "x-frame": "cart_axis_and_upright_pendulum; state=[x_m,v_m_s,theta_rad,omega_rad_s]",
          "description": "State-feedback gain components multiply [cart position, cart velocity, pendulum angle, angular velocity].",
          "x-order": [
            "N/m",
            "N/(m/s)",
            "N/rad",
            "N/(rad/s)"
          ]
        },
        "closed_loop_spectral_radius": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "x-unit": "dimensionless",
          "x-frame": "cart_axis_and_upright_pendulum; state=[x_m,v_m_s,theta_rad,omega_rad_s]",
          "description": "closed_loop_spectral_radius; units=dimensionless; frame=cart_axis_and_upright_pendulum; state=[x_m,v_m_s,theta_rad,omega_rad_s]"
        }
      }
    },
    "preconditions": [
      "Inputs use the declared units and frame; no implicit transforms.",
      "This exact numerical/simulation model is not a physical robot configuration.",
      "Explicit positive Q/R costs apply to the pinned cart-pendulum linear model; this is not a nonlinear simulation or hardware controller."
    ],
    "postconditions": [
      "All declared checks must pass and all outputs must be finite.",
      "Success applies only to this operation and model, not higher-level task completion."
    ],
    "failure_codes": [
      "invalid_input_or_environment",
      "execution_failed",
      "task_failed"
    ],
    "composition": {
      "depends_on": [],
      "automatic_frame_conversion": false,
      "automatic_hardware_execution": false
    },
    "output_selector": "outputs",
    "origin_reference_ids": [],
    "origin_relationship": "adapted_from; inspect declared model and inputs, not original robot compatibility"
  },
  "source_commit": "cdd0cc888802b584c2d654ca85e3c5460973487d",
  "record_version": "1.0.0",
  "evidence": {
    "level": "task_complete",
    "verified_by": "Hub maintainer runtime harness",
    "date": "2026-10-19",
    "environment": {
      "scope": "computation",
      "platforms": [
        "linux",
        "windows"
      ],
      "physical_robot": false
    },
    "commands": [
      "python tools/verify_executable_recipes.py --source-cache SOURCE_CACHE --output OUTPUT --backend pythonrobotics"
    ],
    "result": "Three frozen positive cases passed against this exact adapter; see per-case receipts. This does not estimate general accuracy.",
    "artifacts": [
      "https://raw.githubusercontent.com/Superfast-Robotics/robot-skill-hub/ede75c00118e9808e5099da43c26f4619cc3bc37/evidence/runtime/executable-conversions-v1/pythonrobotics-pendulum-lqr.json"
    ],
    "runtime_verification": "task_complete",
    "contributor_reported": null,
    "hub_verification": {
      "runtime": "task_complete",
      "scope": "computation",
      "case_count": 3,
      "source_unchanged": true
    }
  },
  "record_url": "https://hub.superfastrobotics.com/skills/pythonrobotics-pendulum-lqr/skill.json",
  "inspect_url": "https://api.superfastrobotics.com/v1/skills/pythonrobotics-pendulum-lqr?hub_commit=ede75c00118e9808e5099da43c26f4619cc3bc37&record_version=1.0.0&include=experience",
  "execution_performed": false
}
