matlab-use-scenario-builder

Generate driving scenarios and 3D scenes from recorded GPS, camera, and lidar data.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-use-scenario-builder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-use-scenario-builder
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/automotive/matlab-use-scenario-builder
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-use-scenario-builder

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Converting recorded driving sensor data (GPS, camera, lidar, actor tracks) into simulation-ready driving scenarios is a complex, error-prone pipeline involving timestamp synchronization, road network acquisition, trajectory smoothing, lane localization, and export to tools like RoadRunner. This Skill guides an AI agent through that entire workflow using Scenario Builder for Automated Driving Toolbox, preventing common mistakes like wrong timestamp scales, missing map origins, and floating actors.

Core Features & Use Cases

  • Scenario Generation from Recorded Data: Build ego and actor trajectories from GPS and actor track data, download OpenStreetMap roads, and export to RoadRunner, drivingScenario, OpenSCENARIO, OpenDRIVE, OpenCRG, or Unreal Engine.
  • Lane Localization and Validation: Snap ego trajectories to lane centers using camera-based lane detection (RVLD/CLRNet), with mandatory comparison videos and user confirmation gates.
  • Specialized Workflows: Extract road surfaces (OpenCRG) from lidar, georeference point clouds, generate 3D assets from images, extract critical events (cut-ins, hard brakes, near-misses), and augment scenes with aerial lidar or traffic signs.
  • Use Case: An ADAS engineer has a recorded drive with GPS, camera, and actor tracks and needs a RoadRunner scenario for SOTIF (ISO 21448) coverage. The Skill loads the data, normalizes timestamps, downloads OSM roads, localizes the ego trajectory, exports actors, simulates, and produces a side-by-side validation video.

Quick Start

Ask the agent to generate a RoadRunner scenario from your recorded sensor data file, for example: "Build a driving scenario from the GPS, camera, and actor track data in my sensorData.mat file and export it to RoadRunner."

Frequently Asked Questions about matlab-use-scenario-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a RoadRunner scenario from recorded driving data in MATLAB?

Load your GPS, camera, and actor track data into scenariobuilder sensor objects, normalize timestamps, download OpenStreetMap roads with getMapROI, build and smooth the ego trajectory, then export to RoadRunner with exportToRoadRunner. The Skill enforces this exact pipeline with validation videos at each stage.

How do I convert GPS logs to a driving scenario for ADAS testing?

Create a scenariobuilder.GPSData object from your timestamps and coordinates, convert it with trajectory(gpsData), smooth it, and export to RoadRunner or drivingScenario. Lane localization with camera detections can snap the trajectory to lane centers when raw GPS drifts.

What MATLAB toolboxes are required for Scenario Builder workflows?

You need MATLAB R2025a or later with Automated Driving Toolbox, the Scenario Builder for Automated Driving Toolbox support package, Sensor Fusion and Tracking Toolbox, and Computer Vision Toolbox. Verify installation with isfile(which("scenariobuilder.Trajectory")).

Why do my actors float above the road in the exported RoadRunner scene?

Floating actors happen on flat OpenStreetMap-derived scenes when trajectory Z values retain GPS altitude or sensor mount offsets. Flatten Z to zero for all ego and actor waypoints on OSM scenes; only terrain-aware scenes like HERE HD need height adjustment via adjustHeight.

When should I not use Scenario Builder for my driving data?

Do not use it for raw data import, visualization, or multi-sensor synchronization tasks — those belong to the matlab-import-driving-data skill with drivingLogAnalyzer. It also does not build scenarios from scratch without recorded data; use waypointTrajectory for synthetic scenarios instead.

Can Scenario Builder export to OpenSCENARIO and Unreal Engine?

Yes, Scenario Builder exports generated scenarios to RoadRunner, drivingScenario objects, ASAM OpenSCENARIO, ASAM OpenDRIVE, ASAM OpenCRG for road surfaces, and Unreal Engine. RoadRunner is the default export target unless you explicitly request Driving Scenario Designer.