Build and simulate UAV scenarios with terrain, buildings, platforms, and sensors using MATLAB's uavScenario framework, including mesh import, sensor adaptors, and simulation loops.
Ships in robotics-and-autonomous-systems. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Build and simulate UAV scenarios with terrain, buildings, sensor-equipped platforms, and 3D visualization using the UAV Toolbox uavScenario framework.
show3Dned2lla, lla2ned) — use these directlyuavScenario with ReferenceLocation and UpdateRateaddMesh(scene,"terrain",...) with GMTED2010 or custom DTEDaddMesh(scene,"buildings",...) from OSM fileuavPlatform with trajectory, then updateMeshuavSensor adaptor binding sensor to platformsetup → advance → updateSensors → read loopshow3D with FastUpdate for animation| Function | Purpose | Toolbox |
|---|---|---|
uavScenario | Create simulation scenario | UAV Toolbox |
addMesh | Add terrain, buildings, or custom meshes | UAV Toolbox |
uavPlatform | Add UAV platform to scenario | UAV Toolbox |
updateMesh | Set platform body mesh | UAV Toolbox |
uavSensor | Attach sensor to platform | UAV Toolbox |
setup | Initialize scenario for simulation | UAV Toolbox |
advance | Step simulation forward one time step | UAV Toolbox |
updateSensors | Update all sensors at current time | UAV Toolbox |
show3D | 3D visualization | UAV Toolbox |
waypointTrajectory | Define flight path from waypoints | Navigation Toolbox |
gpsSensor | GPS noise model | Navigation Toolbox |
insSensor | INS/IMU noise model | Navigation Toolbox |
scene = uavScenario( ...
"UpdateRate", 10, ...
"StopTime", 60, ...
"ReferenceLocation", [42.355 -71.066 0]);
ReferenceLocation is [lat lon alt] in degrees and meters. All local coordinates are relative to this origin. Set this before adding any meshes or platforms.
Use geographic coordinates with UseLatLon=true:
latLim = [42.350 42.360];
lonLim = [-71.072 -71.060];
addMesh(scene, "terrain", {"gmted2010", latLim, lonLim}, [0.3 0.6 0.2], ...
UseLatLon=true);
Or use local ENU coordinates (meters) without UseLatLon:
xLim = [-500 500];
yLim = [-500 500];
addMesh(scene, "terrain", {"gmted2010", xLim, yLim}, [0.3 0.6 0.2]);
The geometry cell for terrain is 3 elements: {"gmted2010", xOrLatLim, yOrLonLim}.
The color argument is required — it is not optional.
If user used addCustomTerrain to import DTED file with a terrain name, this terrain can be used in addition to gmted2010.
addCustomTerrain("myterrain", "myterrain.dt1");
xLim = [-500 500];
yLim = [-500 500];
addMesh(scene, "terrain", {"myterrain", xLim, yLim}, [0.3 0.6 0.2]);
osmFile = "boston_common.osm";
latLim = [42.350 42.360];
lonLim = [-71.072 -71.060];
addMesh(scene, "buildings", {osmFile, latLim, lonLim, 'auto'}, ...
[0.6 0.6 0.6], UseLatLon=true);
Or use local ENU coordinates (meters) without UseLatLon:
xLim = [-500 500];
yLim = [-500 500];
addMesh(scene, "buildings", {osmFile, xLim, yLim, 'auto'}, [0.3 0.6 0.2]);
The geometry cell for buildings is 4 elements: {osmFile, latOrXLim, lonOrYLim, height}. height can either be 'auto' or a numerical scalar. Auto will snap buildings to terrain height if available.
The color argument is required — it is not optional.
traj = waypointTrajectory( ...
"Waypoints", [0 0 -50; 200 0 -50; 200 200 -50; 0 0 -50], ...
"TimeOfArrival", [0 20 40 60], ...
"ReferenceFrame", "NED");
plat = uavPlatform("UAV1", scene, "Trajectory", traj);
updateMesh(plat, "quadrotor", {1}, [0 0.4 0.8], [0 0 0], [0 1 0 0]);
updateMesh requires all arguments: (platform, type, geometries, color, position, orientation).
geometries — 1-element cell: {scaleFactor} for "quadrotor"/"fixedwing", {[L W H]} for "cuboid"color — RGB triplet (required, not optional)position — [x y z] offset, use [0 0 0] for defaultorientation — quaternion [w x y z], use [0 1 0 0] for NED scenarios (180-degree roll to flip z-down body frame upright)Valid mesh types: "fixedwing", "quadrotor", "cuboid", "custom".
There is NO "multirotor" type — use "quadrotor" for any multirotor UAV.
Always use uavSensor to bind sensors to platforms. Do not feed sensor models manually.
% Create sensor model
gps = gpsSensor("SampleRate", 10, "ReferenceFrame", "NED");
% Bind to platform via uavSensor adaptor
gpsSensorObj = uavSensor("GPS", plat, gps, "UpdateRate", 10);
For INS:
ins = insSensor;
insSensorObj = uavSensor("INS", plat, ins, "UpdateRate", 10);
Sensor UpdateRate must divide evenly into the scenario UpdateRate. For example, a 10 Hz scenario supports sensor rates of 1, 2, 5, or 10 Hz — not 100 Hz.
setup(scene);
while advance(scene)
updateSensors(scene);
% Read sensor data (3 outputs: isUpdated, timestamp, readings)
[isUpdated, t, position, velocity, groundspeed, course] = read(gpsSensorObj);
if isUpdated
% position is 1x3 [lat lon alt] for gpsSensor
gpsLLA = position;
end
% Read platform state directly
[motion, lla] = read(plat);
% motion: 1x16 vector [pos(3) orient(4) vel(3) acc(3) angvel(3)]
% lla: [lat lon alt]
end
read(sensor) returns variable number outputs:
isUpdated — logical, true when sensor has new data at this time stept — timestamp in secondssensorReadings1 to sensorReadingsN — sensor-specific output (position, velocity, groundspeed, course for gpsSensor)read(plat) returns exactly 2 outputs:
motion — 16-element vector: position(1:3), orientation quaternion(4:7), velocity(8:10), acceleration(11:13), angular velocity(14:16)lla — 3-element vector: [latitude, longitude, altitude]setup(scene);
ax = show3D(scene);
while advance(scene)
updateSensors(scene);
show3D(scene, "FastUpdate", true, "Parent", ax);
drawnow limitrate
end
Use "FastUpdate", true after the first call for efficient animation.
show3D only renders the UAV at its current position — it does NOT draw the flight path. To show the trajectory trail, create a line object once, then update its data each step:
setup(scene);
[ax, plottedFrames] = show3D(scene);
hold(ax, "on");
% Draw trajectory in the platform's reference frame
trajLine = plot3(plottedFrames.(plat.ReferenceFrame), NaN, NaN, NaN, "r-", "LineWidth", 1.5);
hold(ax, "off");
% acceptable for short loops; pre-allocate for long simulations
xHist = []; yHist = []; zHist = [];
while advance(scene)
show3D(scene, "FastUpdate", true, "Parent", ax);
[motion, ~] = read(plat);
xHist(end+1) = motion(1);
yHist(end+1) = motion(2);
zHist(end+1) = motion(3);
set(trajLine, "XData", xHist, "YData", yHist, "ZData", zHist);
drawnow limitrate
end
Do NOT call plot3 inside the loop — it creates a new graphics object each step and kills performance.
When scenes span 500m+, the platform mesh becomes invisible regardless of scale factor. Instead of inflating the scale (which distorts the mesh), parent a marker to the platform's body frame so it tracks at any zoom level:
setup(scene);
[ax, plottedFrames] = show3D(scene);
hold(ax, "on");
bodyFrame = plottedFrames.UAV1.BodyFrame;
plot3(ax, 0, 0, 0, "r^", "MarkerSize", 15, "MarkerFaceColor", "r", ...
"Parent", bodyFrame);
hold(ax, "off");
while advance(scene)
show3D(scene, "FastUpdate", true, "Parent", ax);
drawnow limitrate
end
Replace UAV1 with the actual platform name. The marker moves with the UAV automatically via the parent transform.
| Mistake | Consequence | Fix |
|---|---|---|
addMesh(...,latLim,lonLim) without UseLatLon=true | 0 buildings imported, terrain at wrong location | Add UseLatLon=true when passing geographic coordinates |
updateMesh(plat,"multirotor",...) | Error — invalid mesh type | Use "quadrotor" |
updateMesh with [1 0 0 0] (identity quaternion) in NED scenario | Inverted or invisible mesh — body frame is z-down | Use [0 1 0 0] (180-degree roll) to flip mesh upright |
[pos, orient, vel] = read(plat) | Error — too many outputs | Use [motion, lla] = read(plat) (2 outputs) |
[isUpdated, data] = read(sensor) | Gets timestamp instead of readings | Use [isUpdated, t, sensorReadings] = read(sensor) (3 outputs) |
Feeding gpsSensor manually each step | Works but bypasses the scenario framework | Use uavSensor adaptor + updateSensors(scene) |
Missing color argument in addMesh | Error — not enough input arguments | Always provide RGB triplet as 4th argument |
waypointTrajectory in ENU with NED platform | Error — reference frame mismatch | Set "ReferenceFrame","NED" on trajectory |
Forgetting setup(scene) before loop | Sensors not initialized, no readings | Always call setup(scene) before advance |
Sensor UpdateRate > scenario UpdateRate | Error — rate must divide evenly | Sensor rate must be ≤ scenario rate and divide evenly into it |
uavPlatform. Match all trajectories and sensors to NED.ReferenceLocation must be set at scenario creation — it is read-only after construction.UpdateRate on the scenario controls the simulation time step. Sensor UpdateRate can differ (sensors skip steps when not due).addMesh("buildings",...) expects a file path, not a URL.addCustomTerrain for DTED files when GMTED2010 resolution is insufficient.Copyright 2026 The MathWorks, Inc.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/robotics-and-autonomous-systems:matlab-create-uav-scenariofrom robotics-and-autonomous-systems
npx claudepluginhub matlab/matlab-agentic-toolkit --plugin robotics-and-autonomous-systems6 skills in this plugin
/matlab-compute-gnss-positionComputes multi-constellation Global Positioning System (GPS) or Global Navigation Satellite System (GNSS) positions from RINEX v3 data using rinexread, gnssmeasurements, receiverposition, and gnssoptions. Filters by constellation, elevation mask, C/N0, and observation code. Reports DOP, scatter RMS, and satellite count. Use when processing GNSS data, computing positions from RINEX files, analyzing accuracy, comparing constellations, or evaluating satellite geometry. Do NOT use for carrier-phase RTK/PPP, IMU fusion, orbit propagation, NMEA streaming, or RINEX v4.
/matlab-connect-mavlinkEstablish MAVLink connections between MATLAB and PX4/ArduPilot autopilots. Use when connecting to a drone, flight controller, or autopilot via MAVLink protocol over UDP. Covers dialect setup, UDP transport, timer-based heartbeat, and client discovery. Use when: "connect to PX4", "MAVLink connection", "heartbeat", "ground control station", "GCS", "connect to ArduPilot", "drone communication", "mavlinkio", "SITL".
/matlab-fuse-inertial-sensorsAnalyzes sensor configurations and creates inertial fusion filters in MATLAB Navigation Toolbox. Manages filter selection (imufilter, ahrsfilter, complementaryFilter, insfilterMARG, insfilterAsync, insfilterNonholonomic, insfilterErrorState, insEKF, insCF), construction, tuning, and fusion loops. Use when fusing IMU/AHRS/INS/GPS+IMU data, estimating orientation or pose, or choosing a filter. Do NOT use for vision-only SLAM, Simulink fusion, or IMU simulation.
/matlab-model-robot-kinematicsUse whenever a MATLAB robot model (rigidBodyTree) is needed — whether for simulation, visualization, IK, motion planning, pick-and-place, or trajectory generation. Triggers on: any mention of a manipulator by name (UR3, UR5, UR5e, UR10, UR10e, UR16e, UR20, KUKA iiwa, Fanuc, ABB, Panda, Kinova, Sawyer, Baxter), robot modeling verbs (load, create, build, import, simulate, model), tasks implying a robot model (pick, place, lift, reach, move, grasp, plan motion for, animate), kinematics keywords (IK, FK, inverse kinematics, forward kinematics, joint configuration, end-effector pose, gripper), or working with rigidBodyTree, loadrobot, importrobot, URDF, DH parameters, addVisual, addCollision.
/matlab-plan-robot-motionPlan manipulator motion and generate trajectories in MATLAB. Use when the task involves moving a robot arm between configurations or poses — whether the user says "trajectory," "motion," "path," "move from A to B," or "plan." This skill applies regardless of whether the user explicitly mentions collisions or obstacles; if geometry exists in the workspace, collision safety is implicit. Triggers on: manipulatorRRT, manipulatorCHOMP, dlCHOMP, contopptraj, trapveltraj, collision-free path, motion planner, RRT, CHOMP, TOPPRA, path shortening, obstacle avoidance for manipulators, time-optimal trajectory, velocity limits, acceleration limits, occupancyMap3D, meshtsdf, collision objects as environment, trajectory between waypoints, joint interpolation, move between poses, constant velocity, trapezoidal profile, feed rate. Also triggers when a user has IK solutions or waypoints and needs to connect them — whether for time-optimal motion, constant-speed welding/cutting, or any other trajectory parameterization.
Other plugins' skills for the same job