# Checks_CancelReachStatus

`POST /v1/accounts/{account}/datasets/{dataset}/reachStatus:cancel`

Stops the dataset's current press (REQUESTED or RUNNING), including its
selected legacy group of per-upload runs, as CANCELLED. Independent
presses on member uploads keep running.
Takes not yet sent to the solver are dropped, op runs already on it are
stopped (within a dispatcher tick or two), and takes already solved keep
their results: a later RunCheck on `checks/reach` answers them from
storage and queues the rest. A run whose takes are all answered ends
SUCCEEDED instead. Answers the status as it reads after the cancel; with
no run under way it changes nothing. Needs what RunCheck needs (a write
on the dataset). NOT_FOUND outside the caller's workspace.

- Base URL: `https://api.qualia.dev`
- Authentication: an API key in the `X-API-Key` header

## Parameters

- `account` (path, string, required): The account id.
- `dataset` (path, string, required): The dataset id.

## Request body

Required: `application/json` `qualia.v1.CancelReachStatusRequest`

## Responses

- `200` OK: `application/json` `qualia.v1.ReachStatus`
- `default` Default error response: `application/json` `google.rpc.Status`

## Schemas

```yaml
qualia.v1.CancelReachStatusRequest:
  required:
    - name
  type: object
  properties:
    name:
      type: string
      description: accounts/{account}/datasets/{dataset}/reachStatus
  description: Request for Checks.CancelReachStatus.
qualia.v1.ReachStatus:
  type: object
  properties:
    name:
      type: string
      description: accounts/{account}/datasets/{dataset}/reachStatus
    settings:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.ReachSettings"
      description: |-
        The settings a RunCheck on `checks/reach` would use now, resolved: the
        target robot's solver, and the dataset's base and heading, else the robot
        model's reach_base, else 0, 0, 0. A dataset has no solver of its own, and
        there is no default solver: `solver` is SOLVER_UNSPECIFIED whenever none
        was resolved (no target robot, the robot removed, without a model or in
        another workspace, a robot without a solver, or fleet could not be
        asked).
    currentKey:
      readOnly: true
      type: string
      description: |-
        The reach key those settings make with the target robot's current model
        config. Empty when the dataset has no target robot, the robot cannot be
        solved against (removed, no model, no solver, in another workspace), a
        merged dataset's uploads hold their poses at different frames, or fleet
        could not be asked.
    lastRun:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.ReachRun"
      description: The newest run of any state; unset until the first press.
    lastFinishedRun:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.ReachRun"
      description: |-
        The newest run that ended (SUCCEEDED, FAILED or CANCELLED); unset until
        one has.
    stale:
      readOnly: true
      type: boolean
      description: |-
        Whether last_run was made under another key than current_key: the
        target robot, model, placement, pose frame or calibration changed since,
        and a RunCheck would compute something new. Nothing runs by itself.
    targetRobot:
      readOnly: true
      type: string
      description: accounts/{account}/robots/{robot}; empty if no target robot is assigned.
    calibrationMix:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.ReachCalibrationMix"
      description: |-
        Set when the uploads a reach would read hold their TCP poses under more
        than one capture calibration, and whenever the solver is refused for a mix
        (see ReachCalibrationMix.refused); unset otherwise, always for a dataset
        of one calibration and for one of only robot-joint (arm) recordings
        (arm uploads beside handheld ones are a refused mix). It says which
        calibrations, which rigs recorded them and whether each is current, and
        whether the solver is refused or runs. Also unset when the uploads'
        frames or calibrations cannot be read: the reach is refused then
        (current_key is empty), but no mix is reported.
  description: |-
    Where a dataset's reach check stands (Checks.GetReachStatus): one per
    dataset, always there. Reading it writes nothing and asks for no run.

    Served by qds-api.
qualia.v1.ReachSettings:
  type: object
  properties:
    solver:
      enum:
        - SOLVER_UNSPECIFIED
        - PYROKI
        - DLS
        - MINK
      type: string
      description: |-
        The IK solver the dataset is solved with: always its target robot's, and
        set only on a status read (a run's resolved settings). A dataset does not
        pick one: a request that names a solver here (UpdateDataset, CreateDataset)
        is refused with INVALID_ARGUMENT ("a dataset uses its robot's solver;
        change it on the robot's Solver page"), and a solver stored on a dataset
        before that is ignored. A robot with no solver cannot be solved on.
      format: enum
    baseM:
      type: array
      items:
        type: number
        format: double
      description: |-
        Where the takes' start sits from the relaxed grippers' midpoint, metres
        in the robot's base frame (x forward, y left, z up): empty or exactly
        three numbers, each finite and within 5 m either way. Empty follows the
        target robot model's `reach_base`, else 0, 0, 0. Stored to 0.1 mm and
        applied to both hand paths as one rigid translation from the robot's home
        hand midpoint.
    homeHeadingRad:
      type: number
      description: |-
        Rotate both paired paths around world up before placing their first-row
        midpoint at the shared home reference. Radians; finite and within +/- pi.
        The robot base remains at world (0, 0, 0).
      format: double
    poseSource:
      readOnly: true
      enum:
        - POSES_AT_UNSPECIFIED
        - ROOT
        - TCP
      type: string
      description: |-
        Where the source episode's hand poses were recorded. Set by qds-api on
        reads; clients do not set it. TCP runs consume already-resolved TCP
        channels and never apply calibration again.
      format: enum
    calibrationDigest:
      readOnly: true
      type: string
      description: |-
        Digest of the TCP calibration already applied to the published upload,
        empty for root poses. Set by qds-api on reads.
  description: |-
    How a dataset's reach check is walked: where the takes
    start and which way they face. It is stored on the dataset, so two datasets
    over one robot keep their own, and it is part of the key a reach result is
    stored under: a result is shared by every dataset that asks the same
    question (same robot config, solver, base and walk), and a change here
    leaves the old results as they are until the next RunCheck on
    `checks/reach`. The solver is not a dataset's to choose: a dataset uses its
    robot's, tuned in the robot's solver file.

    Served by qds-api.
qualia.v1.ReachRun:
  type: object
  properties:
    operation:
      readOnly: true
      type: string
      description: "accounts/{account}/operations/{operation}: the RunCheck that recorded it."
    key:
      readOnly: true
      type: string
      description: The key its results are stored under (ReachStatus.current_key).
    settings:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.ReachSettings"
      description: |-
        What it was keyed with, resolved: the solver is PYROKI, DLS or MINK and base_m
        has three numbers.
    robot:
      readOnly: true
      type: string
      description: "accounts/{account}/robots/{robot}: the target robot it ran on."
    requestTime:
      readOnly: true
      type: string
      description: When Run solver was pressed.
      format: date-time
    state:
      readOnly: true
      enum:
        - STATE_UNSPECIFIED
        - REQUESTED
        - RUNNING
        - SUCCEEDED
        - FAILED
        - CANCELLED
      type: string
      description: Where it stands.
      format: enum
    total:
      readOnly: true
      type: integer
      description: |-
        The takes it covers (handheld and egocentric episodes that carry hand
        poses): those of the dataset when it was pressed
        (or the selection), the ones answered from stored results included.
      format: int32
    done:
      readOnly: true
      type: integer
      description: Takes with a result.
      format: int32
    failed:
      readOnly: true
      type: integer
      description: Takes that could not be solved.
      format: int32
    note:
      readOnly: true
      type: string
      description: |-
        Why a run that stands REQUESTED or RUNNING has not moved, or why it was
        given up, in a sentence a person reads ("waiting for the reach service",
        "some takes are not ready yet", "the robot model changed; run again").
        Empty while it is moving.
  description: |-
    One press of Run solver: a RunCheck on `checks/reach`, as the dataset
    recorded it.
qualia.v1.ReachCalibrationMix:
  type: object
  properties:
    refused:
      readOnly: true
      type: boolean
      description: |-
        True when the solver will not run on the mix: ReachStatus.current_key is
        empty and a press sends nothing. That is so when the uploads read sit at
        different frames (some at the gripper root or holding no poses, some at
        the TCP; an upload that holds no poses is read at the root), or are read
        at calibrations or rigs that no one pose walk carries (a mixture of
        differently calibrated uploads). False when it runs: the uploads keep one
        key and each take is read with the calibration of the upload that holds
        it, so a calibration change on any upload makes the old answers stale
        together.
    calibrations:
      readOnly: true
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.ReachCalibration"
      description: |-
        The calibrations read, in that order. A refused mix can carry a single
        entry, when all that differs between the uploads is the kind of rig.
  description: |-
    The capture calibrations a dataset's uploads are mixed from (see
    ReachStatus.calibration_mix), one entry per calibration and the rig that
    recorded it: the TCP ones first, most uploads first, ties by robot resource
    name, entries with no robot last; then the root entry, if any, then the entry
    of the uploads that hold no poses, if any.
qualia.v1.ReachCalibration:
  type: object
  properties:
    frame:
      readOnly: true
      enum:
        - POSES_AT_UNSPECIFIED
        - ROOT
        - TCP
      type: string
      description: |-
        The frame the uploads holding it have their poses at: TCP for a
        calibration; ROOT for the uploads that hold their poses at the gripper
        root and so carry none; UNSPECIFIED for the uploads that hold no poses at
        all (a recording never converted, or one with no handheld poses, such as
        an arm recording). ROOT and UNSPECIFIED are one entry each for all their
        uploads, without a robot, calibration or current flag.
      format: enum
    robot:
      readOnly: true
      type: string
      description: |-
        accounts/{account}/robots/{robot}: the UMI rig the uploads holding this
        calibration were recorded on. Empty when no rig was recorded for them,
        which is so for every upload recorded before uploads kept their rig.
    current:
      readOnly: true
      type: boolean
      description: |-
        Whether this is the calibration `robot` holds now: false when the rig
        holds another one, none, or is gone. Unset when that could not be read: no
        rig was recorded, or the calibration could not be compared, or the rigs
        could not be asked for.
    uploadCount:
      readOnly: true
      type: integer
      description: |-
        How many of the uploads read hold it. A mixture can read one upload's
        episodes at two calibrations; that upload counts in each.
      format: int32
    calibration:
      readOnly: true
      allOf:
        - $ref: "#/components/schemas/qualia.v1.TcpCalibration"
      description: |-
        The calibration itself, as the poses were resolved with it (like
        Dataset.poses_calibration), so that it can be told apart when no rig was
        recorded. Unset at the ROOT frame.
  description: "One calibration among those a reach reads: see ReachCalibrationMix."
qualia.v1.TcpCalibration:
  required:
    - filename
    - hands
  type: object
  properties:
    filename:
      type: string
      description: The uploaded file's name, e.g. "tcp_calibration.json".
    deriveDate:
      type: string
      description: |-
        When the calibration was made, "YYYY-MM-DD": the leading date of the
        file's `calibrated` or else its `derived` text. Empty when the file gives
        none.
    hands:
      type: array
      items:
        $ref: "#/components/schemas/qualia.v1.TcpCalibration_Hand"
      description: Both hands, left then right.
    eeLink:
      type: string
      description: |-
        The link of the rig's gripper design that `Hand.ee_to_tcp` is a pose in,
        with `{side}` for "left" or "right" (the gripper joint's convention in
        RobotModel.Gripper), e.g. "openarm_{side}_ee_base_link". Read from the
        file's own description of its end-effector frame. Empty when the file
        names none, lacks the end-effector poses, or they disagree with its
        controller_to_tcp (then no `ee_to_tcp` is set either). Display only.

        `ee_to_tcp` is drawn in this link's own frame, which must be the plain
        end-effector frame the file means. An export whose link sits elsewhere
        draws the TCP off by the difference: an OpenArm exported with the xacro
        default collapse_internal_empty_links puts openarm_<side>_ee_base_link at
        link7, 20.5 mm behind the frame the calibration is in.
  description: |-
    A handheld rig's calibration of its trackers to the gripper's tool centre
    point (TCP, the midpoint of the closed fingertips). It is what a tcp_calibration.json holds as `<side>.controller_to_tcp`: the TCP's pose in
    the tracker's frame, so a pose recorded at a tracker becomes the pose of the
    TCP by composing it with this transform.

    A file that also names the gripper's end-effector link gives the same TCP in
    that link's frame (`ee_link`, `Hand.ee_to_tcp`), which is what a rig's
    gripper design (Rig.gripper) draws the TCP with. Those two are for display:
    poses are resolved and uploads converted with `tracker_to_tcp`, `filename`
    and `derive_date` alone, never with `ee_to_tcp`. So compare two calibrations
    on those, `hands[].side` and `hands[].tracker_to_tcp` only: a copy kept
    elsewhere (a dataset keeps the calibration its poses were resolved with)
    carries just those, and a whole-message comparison would call every
    calibration that has the end-effector fields replaced.
qualia.v1.TcpCalibration_Hand:
  required:
    - side
    - trackerToTcp
  type: object
  properties:
    side:
      enum:
        - SIDE_UNSPECIFIED
        - SIDE_LEFT
        - SIDE_RIGHT
      type: string
      description: Which hand.
      format: enum
    trackerToTcp:
      allOf:
        - $ref: "#/components/schemas/qualia.v1.Transform"
      description: |-
        The TCP's pose in the tracker's frame: xyz in metres and rpy in radians
        (URDF convention, extrinsic XYZ), the file's rotation matrix converted.
        A rotation whose pitch is within a hair of +-90 degrees has no unique
        roll and yaw; it is stored with roll 0.
    eeToTcp:
      allOf:
        - $ref: "#/components/schemas/qualia.v1.Transform"
      description: |-
        The same TCP in the frame of the gripper design's `ee_link` for this
        hand, in the form of `tracker_to_tcp` (so the same pitch limit). Display
        only. Set with `ee_link` or not at all, and only when it composes with
        the file's controller_to_ee to the file's controller_to_tcp, which is
        what makes the TCP drawn the TCP used.
  description: One hand's transform.
qualia.v1.Transform:
  type: object
  properties:
    xyz:
      type: array
      items:
        type: number
        format: double
      description: x, y, z in metres.
    rpy:
      type: array
      items:
        type: number
        format: double
      description: roll, pitch, yaw in radians.
  description: |-
    A 3D rigid transform: translation in metres and roll, pitch, yaw in radians
    (URDF convention, extrinsic XYZ).
google.rpc.Status:
  oneOf:
    - $ref: "#/components/schemas/ApiError"
    - $ref: "#/components/schemas/GatewayError"
  description: "The body of a failed call: one of the two shapes below."
ApiError:
  title: API error
  type: object
  required:
    - code
    - message
    - retryable
    - details
  properties:
    code:
      type: string
      description: The gRPC code name in upper case, e.g. `NOT_FOUND`.
    message:
      type: string
    retryable:
      type: boolean
      description: Whether the same call may succeed if retried.
    details:
      type: array
      items:
        type: object
      description: "Empty, except when a dataset copy or move is refused: then one `google.rpc.ErrorInfo` with the refusal's `reason` code, its `domain` and, in `metadata`, the datasets it names."
  description: A refusal from the API itself.
GatewayError:
  title: Gateway error
  type: object
  required:
    - detail
  properties:
    detail:
      type: string
      description: What went wrong.
  description: A refusal from the gateway before the call reaches the API, for example `401` bad or missing API key, `403` key lacks the scope or environment closed, `413` body too large.
```
