Back to prompt library
Build a MoveIt Joint Limit and Singularity Pre-Flight Checker — implementation
Linked challenge: Build a MoveIt Joint Limit and Singularity Pre-Flight Checker
Prompt source
implementation109 lines11 sectionsNo variables1 code block
## Build
Evaluate planned MoveIt robot trajectories for proximity to mechanical joint limits and kinematic singularities. Flag problematic path waypoints before physical execution on the shop floor.
## User
Automation Cell Maintenance Specialist
## Workflow
1. Ingest proposed MoveIt joint-space trajectory plans and robot URDF kinematic limits.
2. Analyze waypoint joint angles against maximum extension, velocity, and effort constraints.
3. Calculate Jacobian determinants along the path to detect approaching kinematic singularities.
4. Compile a pre-flight trajectory audit identifying specific waypoints that violate joint or singularity margins for human review.
## Interface
Review terminal displaying trajectory safety status and joint limit margin warnings.
## Data
Simulate simplified synthetic app records of MoveIt joint trajectories, not complete official schema files, combining joint states and calculated Jacobian determinants.
Starter examples below are synthetic. They are not downloaded records.
## Source
[MoveIt robotics](https://raw.githubusercontent.com/moveit/moveit2/main/README.md)
Uses MoveIt 2 documentation context for handling joint constraints and kinematic planning scenes.
## Tools
ray-serve, numpy, pydantic.
Ray Serve enables parallel evaluation of trajectory waypoints for rapid pre-flight kinematic checks.
Requires basic text evaluation for compiling pre-flight human-readable safety audit reports.
## 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 joint margin violations correctly against provided mechanical limits.
- Flags low Jacobian determinant values as singularity warnings based on threshold.
- Synthesizes structured pre-flight validation status for maintenance review.
- Rejects trajectory plans missing required joint angle definitions.
## Starter Examples
```json
[
{
"input": {
"trajectory_id": "PLAN-A",
"waypoints": [
{
"waypoint_index": 0,
"j1": 1.5,
"j2": 0.5,
"jacobian_det": 0.8
},
{
"waypoint_index": 1,
"j1": 1.6,
"j2": 3.2,
"jacobian_det": 0.7
}
],
"joint_limits": {
"j1": {
"min": -3.14,
"max": 3.14
},
"j2": {
"min": -3.14,
"max": 3.14
}
},
"singularity_threshold": 0.05
},
"expected_output": {
"trajectory_id": "PLAN-A",
"flight_status": "REJECTED_JOINT_LIMIT",
"violations": [
{
"waypoint_index": 1,
"joint": "j2",
"value": 3.2,
"limit": 3.14
}
],
"singularity_detected": false
}
},
{
"input": {
"trajectory_id": "PLAN-B",
"waypoints": [
{
"waypoint_index": 0,
"j1": 0,
"j2": 0,
"jacobian_det": 0.01
}
],
"joint_limits": {
"j1": {
"min": -3.14,
"max": 3.14
},
"j2": {
"min": -3.14,
"max": 3.14
}
},
"singularity_threshold": 0.05
},
"expected_output": {
"trajectory_id": "PLAN-B",
"flight_status": "REJECTED_SINGULARITY",
"violations": [],
"singularity_detected": true
}
}
]
```
## Safety
Maintains simulated validation only; does not send unverified trajectories to physical robot controllers.
Use mock external writes. Require human review before any real deployment.