Skip to main content
Loading navigation

Build a Volumetric Inspection Coverage Planner — implementation

Prompt source

implementation80 lines11 sectionsNo variables1 code block
## Build
Parse optical bounding box dimensions from initial inspection logs to coordinate robotic multi-camera volumetric scans. Synthesize secondary camera poses with MoveIt to eliminate occlusion zones.

## User
Robotics Vision Engineer

## Workflow
1. Parse initial optical inspection defect coordinates and bounding volume from telemetry logs.
2. Calculate occlusion zones and coverage deficits based on cell geometry and robot arm reach limits.
3. Generate secondary camera pose waypoints to achieve complete volumetric inspection coverage.
4. Compile an automated inspection sequence trajectory for the robot controller to execute.

## Interface
Terminal console outputting a trajectory plan and 3D coordinate visualizations for secondary camera sweeps.

## Data
Mock JSON test fixtures containing initial optical defect viewpoints, bounding box limits, and occlusion ratios. These are explicitly simplified synthetic app records, not complete official schema files.
Starter examples below are synthetic. They are not downloaded records.

## Source
[MoveIt robotics](https://raw.githubusercontent.com/moveit/moveit2/main/README.md)
Uses MoveIt kinematic reachability envelope principles from Source 1 to ensure secondary camera poses are valid within the robotic cell.

## Tools
mastra-ai, pydantic, numpy.
Mastra AI provides deterministic workflow state handling to orchestrate occlusion detection and secondary pose generation steps.
Local model to categorize inspection states and evaluate spatial coverage heuristics.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Calculates secondary poses correctly: if occlusion_ratio < 0.6, generates two offset poses by adding/subtracting 20 from x/y and adding 15 to z. Otherwise, requires manual inspection.
- Fails safely when requested camera poses exceed normalized robotic cell reach maximums.
- Outputs valid JSON with generated pose coordinates or manual inspection flags.

## Starter Examples
```json
[
  {
    "input": {
      "assembly_id": "WELD-01",
      "initial_view": {
        "x": 210,
        "y": 140,
        "z": 45
      },
      "occlusion_ratio": 0.4
    },
    "expected_output": {
      "assembly_id": "WELD-01",
      "action": "GENERATE_POSES",
      "new_poses": [
        {
          "x": 230,
          "y": 120,
          "z": 60
        },
        {
          "x": 190,
          "y": 160,
          "z": 60
        }
      ],
      "coverage_achieved": true
    }
  },
  {
    "input": {
      "assembly_id": "WELD-02",
      "initial_view": {
        "x": 620,
        "y": 140,
        "z": 45
      },
      "occlusion_ratio": 0.8
    },
    "expected_output": {
      "assembly_id": "WELD-02",
      "action": "MANUAL_INSPECTION_REQUIRED",
      "new_poses": [],
      "coverage_achieved": false
    }
  }
]
```

## Safety
Outputs are limited to recommended camera pose trajectories and require human confirmation before sending commands to actual robot controllers.
Use mock external writes. Require human review before any real deployment.