Selects, constructs, and tunes inertial sensor fusion filters in MATLAB Navigation Toolbox, including imufilter, ahrsfilter, insfilterMARG, and related filters for IMU/AHRS/INS/GPS+IMU data.
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.
Select, implement, or tune an inertial sensor fusion filter in MATLAB Navigation Toolbox.
Configured filters cover these sensor combinations exactly:
Is your sensor set one of the above?
│ No ─────────────────────────────────────────────────────► Step 2B (Flexible)
│ Yes
▼
Need a custom motion model (constant-velocity, bicycle, etc.)?
│ Yes ────────────────────────────────────────────────────► Step 2B (Flexible)
│ No
▼
Need RTS smoothing, StateCovariance output, or optimizer-based tune()?
│ Yes ────────────────────────────────────────────────────► Step 2B (Flexible)
│ No
▼
Batch-only processing (no real-time predict/fuse loop needed)?
│ Yes ────────────────────────────────────────────────────► Step 2B (Flexible)
│ No
▼
Step 2A (Configured)
What output do you need?
│
├─ Orientation only (no position)
│ │
│ ├─ Accel + Mag only (no gyro)
│ │ └──► ecompass [function, not object; single-shot; useful for filter init]
│ │
│ ├─ Accel + Gyro (no mag)
│ │ └──► imufilter [heading drifts over time without mag]
│ │
│ ├─ Accel + Gyro + Mag
│ │ ├──► ahrsfilter [default; KF-based, statistically tunable]
│ │ └── lowest compute cost needed?
│ │ └──► complementaryFilter [gain-based only; no KF, no tune()]
│ │
│ └─ Accel + Gyro + Mag + Altimeter
│ └──► ahrs10filter [adds altitude + vertical velocity output]
│
└─ Full pose (orientation + position + velocity)
│
├─ No motion constraints (aerial, or ground vehicle without side-slip constraint)
│ ├─ Accel + Gyro + Mag + GPS, all sensors sync
│ │ └──► insfilterMARG
│ └─ Accel + Gyro + Mag + GPS, mixed rates or dropped samples
│ └──► insfilterAsync
│
└─ Ground vehicle with zero side-slip constraint
├─ Accel + Gyro + GPS
│ └──► insfilterNonholonomic
└─ Accel + Gyro + GPS + monocular visual odometry
└──► insfilterErrorState
Need real-time fusion, StateCovariance output, or optimizer-based tune()?
│ Yes ──► insEKF [production use; full KF; real-time and batch APIs]
│ No
▼
Batch-only processing, no covariance needed, quick setup (R2026a+)?
└──► insCF [complementary filter; gain-based; not for production]
SampleRate (Group A filters) and IMUSampleRate (Group B filters) must match the actual data rate — a mismatch directly scales the noise model and corrupts all filter outputs. insfilterAsync, insEKF, and insCF are timestamp-driven and have no rate property.
Convert timestamps to seconds first, then infer the rate:
tSec = rawTimestamp / 1e6; % µs → s; divide by 1e3 for ms, or skip if already seconds
fs = 1 / median(diff(tSec));
If timestamps are unusable (all identical, or non-finite result):
if numel(unique(tSec)) < 2 || ~isfinite(fs)
fs = 100; % use the stated or datasheet rate
end
All stateful filters accumulate error across a recording gap (a large jump in timestamps). Split the data at each gap and reset the filter at the start of each segment.
gapThreshold = 5 / fs; % 5× the expected sample interval
gapIdx = find(diff(tSec) > gapThreshold);
segments = [1; gapIdx+1]; % start index of each segment
Group A System object filters (imufilter, ahrsfilter, complementaryFilter): call release(filt) between segments — resets state while preserving all tuned noise properties.
Group B and other filters: re-construct the filter object at the start of each segment.
Consult the reference file for the filter you chose:
| Filter group | Reference |
|---|---|
| Attitude filters | references/attitude-filters.md |
| Navigation filters | references/navigation-filters.md |
insEKF | references/insekf.md |
insCF | references/inscf.md |
Two tune signatures exist — mixing them up is a common error:
imufilter, ahrsfilter) — modifies filter in-place:
tune(filt, sensorData, groundTruth)ahrs10filter, insfilterMARG, insfilterAsync, insfilterNonholonomic, insfilterErrorState, insEKF) — returns noise struct:
tunedNoise = tune(filt, tunernoise(filt), sensorData, groundTruth)Not tunable via tune:
ecompass, complementaryFilter — no tune method; adjust properties manuallyinsCF — use gainparts(filt, sensorName, value) insteadinsEKF only: tunerconfig requires a filter instance — tunerconfig(filt), not tunerconfig('insEKF')
| Property | Default | Description |
|---|---|---|
MaxIterations | 20 | Stop after this many iterations |
ObjectiveLimit | 0.1 | Stop when cost drops below this value |
Display | "iter" | "iter" prints progress each iteration; "none" suppresses output |
Cost | "RMS" | "RMS" minimizes RMS error; "Custom" uses CustomCostFcn |
CustomCostFcn | [] | Function handle; active only when Cost = "Custom" |
Signature B filters require tunernoise(filt) before calling tune. Signature A filters (imufilter, ahrsfilter) do not use tunernoise — tune modifies their noise properties directly in-place.
| Filter | Fields returned by tunernoise |
|---|---|
ahrs10filter | MagnetometerNoise, AltimeterNoise |
insfilterMARG | MagnetometerNoise, GPSPositionNoise, GPSVelocityNoise |
insfilterAsync | AccelerometerNoise, GyroscopeNoise, MagnetometerNoise, GPSPositionNoise, GPSVelocityNoise |
insfilterNonholonomic | GPSPositionNoise, GPSVelocityNoise |
insfilterErrorState | MVOOrientationNoise, MVOPositionNoise, GPSPositionNoise, GPSVelocityNoise |
insEKF | Named by filt.SensorNames + Noise suffix (e.g. AccelerometerNoise, GPSNoise) |
Fields use the ...Noise suffix — omitting it is a common mistake.
tunerPlotPose is an OutputFcn callback — pass it to tunerconfig to plot pose estimates live during each tuning iteration. It is not a standalone post-hoc plotting function; calling it directly with filter and data arguments will error ("Too many input arguments").
config = tunerconfig(filt);
config.OutputFcn = @tunerPlotPose;
tunedNoise = tune(filt, tunernoise(filt), sensorData, groundTruth, config);
For post-tuning visualization, extract the filter state and plot against your ground truth manually. Configured filters (ahrs10filter, insfilterMARG, insfilterAsync, insfilterNonholonomic, insfilterErrorState) have a pose() method — use it. insEKF and insCF have no pose() method — use stateparts(filt, 'Orientation'), stateparts(filt, 'Position'), etc. instead. For batch workflows, plot from the estimateStates output timetable.
For advanced patterns (controlling TunableParameters, custom cost functions, OutputFcn for logging/early stopping), see references/insekf.md and references/navigation-filters.md.
Reference frame: default is "NED". To use ENU:
imufilter, ahrsfilter, complementaryFilter, ahrs10filter, insfilterMARG, insfilterAsync, insfilterNonholonomic, insfilterErrorState): filt.ReferenceFrame = "ENU"ecompass (a function, not an object): the orientationFormat positional arg is required before any name-value pairs — ecompass(a, m, 'quaternion', 'ReferenceFrame', 'ENU'). Omitting it errors: "Expected input number 3, FORMAT..."insEKF/insCF: ReferenceFrame is read-only after construction; set via insOptions/insCFOptions at construction timeOrientation output: quaternion object by default.
GPS position input: LLA vector in degrees / degrees / meters.
Sample rate property:
imufilter, ahrsfilter, complementaryFilter: SampleRateahrs10filter, insfilterMARG, insfilterNonholonomic, insfilterErrorState: IMUSampleRateinsfilterAsync, insEKF, insCF: no sample rate property (sensors carry their own timestamps)ReferenceLocation: must be set on insfilterMARG, insfilterAsync, insfilterNonholonomic, and insfilterErrorState before the fusion loop. For insEKF/insCF, set it on the insGPS/insCFGPS sensor object instead.
If this skill's guidance was wrong, incomplete, or didn't work, emit a plain-text feedback marker in your response, then continue with the task.
Format: NAV-SKILL-FEEDBACK [matlab-fuse-inertial-sensors] [category]: what failed; what you did instead
Categories: wrong-command (incorrect/outdated), missing-guidance (omitted step),
discovery-failure (suggested approach didn't work), platform-issue (environment-specific)
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-fuse-inertial-sensorsfrom 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-create-uav-scenarioCreate and simulate UAV scenarios with terrain, buildings, platforms, and sensors using uavScenario. Use when building a UAV simulation, UAV simulator, or UAV scenario in MATLAB. Covers addMesh for terrain/building import, uavPlatform with updateMesh, uavSensor adaptor pattern for GPS/IMU, and the setup/advance simulation loop. Triggers on: uavScenario, UAV simulation, UAV simulator, multirotor simulation, quadrotor scenario, terrain import, building import, GPS sensor 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