# Stanley one-step steering command

Stanley one-step steering command. Parameterized bounded JSON adapter; numerical operation, no hardware execution.

Record version: `1.0.0` · Hub commit: `39b06d7a6016edcea27e348e49ffd86f29ec1811`

## Executable interface

```json
{
  "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": "planar_map_xy",
    "joint_order": "not_used",
    "quaternion_order": "not_used"
  },
  "input_schema": {
    "type": "object",
    "required": [
      "state",
      "path_xy"
    ],
    "additionalProperties": false,
    "properties": {
      "state": {
        "type": "array",
        "minItems": 4,
        "maxItems": 4,
        "items": {
          "type": "number",
          "minimum": -20,
          "maximum": 20
        },
        "x-unit": "mixed",
        "x-frame": "planar_map_xy",
        "x-order": [
          "x_m",
          "y_m",
          "yaw_rad",
          "speed_m_s"
        ],
        "description": "state; units=mixed; frame=planar_map_xy; component order=x_m,y_m,yaw_rad,speed_m_s"
      },
      "path_xy": {
        "type": "array",
        "minItems": 3,
        "maxItems": 256,
        "items": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "type": "number",
            "minimum": -100.0,
            "maximum": 100.0
          }
        },
        "x-unit": "m",
        "x-frame": "planar_map_xy",
        "x-order": [
          "x",
          "y"
        ],
        "description": "path_xy; units=m; frame=planar_map_xy; component order=x,y"
      }
    }
  },
  "output_schema": {
    "type": "object",
    "required": [
      "steering_rad",
      "target_index"
    ],
    "additionalProperties": false,
    "properties": {
      "steering_rad": {
        "type": "number",
        "minimum": -3.1416,
        "maximum": 3.1416,
        "x-unit": "rad",
        "x-frame": "planar_map_xy",
        "description": "steering_rad; units=rad; frame=planar_map_xy"
      },
      "target_index": {
        "type": "integer",
        "minimum": 0,
        "maximum": 255,
        "x-unit": "dimensionless",
        "x-frame": "planar_map_xy",
        "description": "target_index; units=dimensionless; frame=planar_map_xy"
      }
    }
  },
  "preconditions": [
    "State order [x_m,y_m,yaw_rad,speed_m_s]; upstream 2.9 m wheelbase model.",
    "Pure pursuit state is vehicle center with rear axle offset; Stanley uses its upstream front axle convention.",
    "Output is a requested steering command, not a robot action or convergence guarantee."
  ],
  "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": [
    "pythonrobotics-pathtracking-stanley-control-stanley-control-py"
  ],
  "origin_relationship": "adapted_from; inspect declared model and inputs, not original robot compatibility"
}
```



## Exact environment

| Runtime | Robot | Controller | Observation | OS | Python | Evidence |
| --- | --- | --- | --- | --- | --- | --- |
| pythonrobotics cdd0cc888802 | mathematical-model | json-contract-v1 | explicit-json-input | windows x86_64 | >=3.10,<3.11 | task_complete |

All inputs and outputs follow interface v1. Simulation adapters query exact synthetic simulator state; no perception or physical sensor compatibility.

Compatibility status: **hub_verified**. An environment match does not establish task completion. Runtime verification: **task_complete**.

## Source and license

- Repository: https://github.com/AtsushiSakai/PythonRobotics
- Source commit: `cdd0cc888802b584c2d654ca85e3c5460973487d` (no tag)
- Original authors: Atsushi Sakai and PythonRobotics contributors
- License: [MIT](https://github.com/AtsushiSakai/PythonRobotics/blob/cdd0cc888802b584c2d654ca85e3c5460973487d/LICENSE)
- Source archive SHA256: `6d3ccf43be4ae770a9e8dffd463c2561665847df5b7ddf693b01130004dbcee5`
- Upstream files: `ArmNavigation/n_joint_arm_to_point_control/NLinkArm.py`, `ArmNavigation/n_joint_arm_to_point_control/n_joint_arm_to_point_control.py`, `InvertedPendulum/inverted_pendulum_lqr_control.py`, `LICENSE`, `Localization/extended_kalman_filter/ekf_with_velocity_correction.py`, `Localization/extended_kalman_filter/extended_kalman_filter.py`, `Localization/unscented_kalman_filter/unscented_kalman_filter.py`, `PathPlanning/AStar/a_star.py`, `PathPlanning/BSplinePath/bspline_path.py`, `PathPlanning/BezierPath/bezier_path.py`, `PathPlanning/BidirectionalAStar/bidirectional_a_star.py`, `PathPlanning/BidirectionalBreadthFirstSearch/bidirectional_breadth_first_search.py`, `PathPlanning/BreadthFirstSearch/breadth_first_search.py`, `PathPlanning/Catmull_RomSplinePath/catmull_rom_spline_path.py`, `PathPlanning/CubicSpline/cubic_spline_planner.py`, `PathPlanning/DepthFirstSearch/depth_first_search.py`, `PathPlanning/Dijkstra/dijkstra.py`, `PathPlanning/DubinsPath/dubins_path_planner.py`, `PathPlanning/DynamicWindowApproach/dynamic_window_approach.py`, `PathPlanning/GreedyBestFirstSearch/greedy_best_first_search.py`, `PathPlanning/PotentialFieldPlanning/potential_field_planning.py`, `PathPlanning/ProbabilisticRoadMap/probabilistic_road_map.py`, `PathPlanning/QuinticPolynomialsPlanner/quintic_polynomials_planner.py`, `PathPlanning/RRT/rrt.py`, `PathPlanning/RRT/rrt_with_pathsmoothing.py`, `PathPlanning/RRTStar/rrt_star.py`, `PathPlanning/ReedsSheppPath/reeds_shepp_path_planning.py`, `PathTracking/pure_pursuit/pure_pursuit.py`, `PathTracking/stanley_control/stanley_control.py`, `utils/__init__.py`, `utils/angle.py`, `utils/plot.py`, `ArmNavigation/n_joint_arm_to_point_control/__init__.py`, `ArmNavigation/__init__.py`, `__init__.py`, `Localization/__init__.py`, `PathPlanning/__init__.py`, `PathPlanning/CubicSpline/__init__.py`, `PathPlanning/DubinsPath/__init__.py`, `PathPlanning/RRT/__init__.py`, `PathPlanning/RRTStar/__init__.py`, `PathTracking/__init__.py`
- Upstream contribution rules: https://github.com/AtsushiSakai/PythonRobotics

## Find, inspect, prepare

```sh
python /PATH_TO_SKILL/scripts/rsh.py find "controller" --runtime pythonrobotics --runtime-version cdd0cc888802 --robot mathematical-model --json
python /PATH_TO_SKILL/scripts/rsh.py inspect pythonrobotics-stanley-steering --json
python /PATH_TO_SKILL/scripts/rsh.py prepare pythonrobotics-stanley-steering --project ./experiment --expected-source-commit cdd0cc888802b584c2d654ca85e3c5460973487d --expected-record-version 1.0.0 --plan --json
```

Remove `--plan` to download the checksum-verified pinned source and create an isolated project environment. Preparation returns the remaining configuration. Dependency installation is an explicit `--install-deps` step; it can execute package build hooks. Robot simulation is a separate command returned by prepare, never run by find/inspect.

Direct package pins: `contourpy==1.3.2`, `cycler==0.12.1`, `fonttools==4.65.0`, `kiwisolver==1.5.1`, `matplotlib==3.9.4`, `numpy==1.26.4`, `packaging==26.3`, `pillow==12.3.0`, `pyparsing==3.3.3`, `python-dateutil==2.9.0.post0`, `scipy==1.13.1`, `six==1.17.0`.

Runtime dependency versions are pinned for the supported Python 3.10 x86_64 CPU environments and checked against execution receipts. Platform-specific wheel hashes are not represented as a universal artifact lock; prepare captures pip freeze.

Hardware: x86_64 CPU; no GPU or robot required.

Rendering: No display. Matplotlib Agg for numerical imports; PyBullet DIRECT for simulation..

External API keys: none.

## Invocation contract

Entrypoint: `python run.py`.

```json
{
  "argv": [
    "{python}",
    "{recipe_dir}/run.py",
    "--source-dir",
    "{source_dir}",
    "--example"
  ],
  "inputs": {
    "state": [
      0,
      0,
      0,
      2
    ],
    "path_xy": [
      [
        0,
        0
      ],
      [
        1,
        0
      ],
      [
        2,
        0
      ],
      [
        3,
        0
      ],
      [
        4,
        0
      ],
      [
        5,
        0
      ],
      [
        6,
        0
      ],
      [
        7,
        0
      ],
      [
        8,
        0
      ],
      [
        9,
        0
      ],
      [
        10,
        0
      ],
      [
        11,
        0
      ],
      [
        12,
        0
      ],
      [
        13,
        0
      ],
      [
        14,
        0
      ],
      [
        15,
        0
      ],
      [
        16,
        0
      ],
      [
        17,
        0
      ],
      [
        18,
        0
      ],
      [
        19,
        0
      ],
      [
        20,
        0
      ]
    ]
  },
  "outputs": {
    "format": "single JSON object on stdout",
    "payload_selector": "outputs",
    "schema": {
      "type": "object",
      "required": [
        "steering_rad",
        "target_index"
      ],
      "additionalProperties": false,
      "properties": {
        "steering_rad": {
          "type": "number",
          "minimum": -3.1416,
          "maximum": 3.1416,
          "x-unit": "rad",
          "x-frame": "planar_map_xy",
          "description": "steering_rad; units=rad; frame=planar_map_xy"
        },
        "target_index": {
          "type": "integer",
          "minimum": 0,
          "maximum": 255,
          "x-unit": "dimensionless",
          "x-frame": "planar_map_xy",
          "description": "target_index; units=dimensionless; frame=planar_map_xy"
        }
      }
    }
  }
}
```

Success: Exit 0, status=task_complete, success=true, finite outputs satisfying interface.output_schema and all declared numerical/model checks. This is not a physical robot or general task-success claim.

Timeout: 30 seconds. Caller must terminate the separate adapter process after 30 seconds; adapters bound iterations/scene steps and close simulation clients.

Failures: Invalid or oversized JSON; Source checksum mismatch; Unavailable pinned dependency; No valid path or postcondition failure; Execution exceeding the declared bounded algorithm budget.

## Actual evidence

Three frozen positive cases passed against this exact adapter; see per-case receipts. This does not estimate general accuracy.

Reviewer: Hub maintainer runtime harness · 2026-10-19.

Commands/checks actually performed:

- python tools/verify_executable_recipes.py --source-cache SOURCE_CACHE --output OUTPUT --backend pythonrobotics

Submitted evidence and hub verification remain separate. A schema check, PR creation or merge does not establish task success or publication.

## Reusable fixes

Preserve upstream origin/license and interface semantics. Edit the finite manifest/templates and regenerate; record new exact-byte evidence for behavior changes.

# Stanley one-step steering command

Parameterized adaptation of `PathTracking/stanley_control/stanley_control.py` from https://github.com/AtsushiSakai/PythonRobotics at `cdd0cc888802b584c2d654ca85e3c5460973487d`. Original authors: Atsushi Sakai and PythonRobotics contributors. Upstream license: MIT. Source license and all notices remain in the prepared checkout; the Hub adapter is MIT.

Use the record interface for input/output schemas, units, frames, prerequisites and failures. `--describe` reads the contract; `--example` runs the declared case. Replace `--example` with `--input TASK.json` for a different input. This adapter does not command physical hardware.

