跳到正文
cccskills
免费在 GitHub 公开

matlab-robotics-autonomy

MATLAB robotics and autonomy workflow for ROS Toolbox, Robotics System Toolbox, Navigation Toolbox, UAV Toolbox, sensor fusion, trajectory planning, simulation, and reproducible robot experiments. Use for ROS/ROS 2 bags, robot models, path planning, SLAM, state estimation, and autonomy prototyping.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(6)

  • SKILL.md6.5 KB
  • scripts/mas_ekf_check.m6.9 KB
  • scripts/mas_frame_check.m8.6 KB
  • scripts/mas_kin_check.m4.5 KB
  • scripts/mas_kin_ik.m6.1 KB
  • tests/test_robotics.m13.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

MATLAB Robotics Autonomy

Use this skill for robotics, autonomy, and ROS workflows.

Workflow

  1. Confirm environment: ROS or ROS 2, bag files, robot model, coordinate frames, sensors, and MATLAB toolboxes.
  2. Load data or simulator deterministically.
  3. Validate frames, units, timestamps, and message types before algorithms.
  4. Build the smallest loop first: read data, process one frame, save one metric.
  5. Scale to full trajectory, bag, or simulation only after the small loop passes.

Preferred APIs

  • ROS: ros2bagreader, rosbagreader, message readers, publishers, subscribers.
  • Robotics: rigidBodyTree, inverseKinematics, manipulatorRRT.
  • Navigation: occupancy maps, planners, controllers, localization.
  • Sensor fusion: Kalman filters, tracking filters, coordinate transforms.
  • UAV: scenario, trajectory, and sensor simulation APIs when installed.

Acceptance Checks

Use at least one:

  • Bag metadata and topic count parsed correctly.
  • Frame transform chain is valid.
  • Path has finite waypoints and no obvious obstacle collision.
  • State estimator output has finite covariance.
  • Trajectory tracking error is within tolerance.
  • Figures or videos are exported with reproducible scripts.

Risk Checklist

Watch for:

  • ENU/NED/body/world frame mixups.
  • Degrees vs radians.
  • Timestamp drift.
  • Sensor rate mismatch.
  • ROS domain ID or middleware mismatch.
  • Large bag files that need sampled processing.

Tools

r = mas_kin_check(L, q);                    % FK + Jacobian vs finite difference
r = mas_kin_ik(L, pTarget, q0, opts);       % DLS IK, joint limits, step diagnostics
r = mas_ekf_check(model);                   % NEES / NIS consistency, Monte Carlo
r = mas_frame_check(T);                     % SE(3)/SO(3) hygiene, chain closure

Check the Jacobian against something that is not the Jacobian

mas_kin_check returns the analytic Jacobian and a central-difference Jacobian computed by differentiating the forward kinematics, then reports the disagreement. Every consumer of J -- resolved-rate control, IK, singularity maps, the manipulability ellipsoid, force/torque mapping -- is built on it, and a sign error or a dropped outer sum does not throw and does not look wrong on a plot of the arm; it produces a controller that drives the tip the wrong way.

The analytic form: for a planar chain with absolute link angles theta_i = sum_{k<=i} q_k,

dx/dq_j = -sum_{i>=j} L_i sin(theta_i)     dy/dq_j = sum_{i>=j} L_i cos(theta_i)

The OUTER sum is the part that gets dropped: joint j moves every link from j outward. The test pins this by building the naive per-link Jacobian inline and asserting that the returned J disagrees with it while agreeing with the finite difference to ~1e-9.

IK: bounded steps, and the unbounded value still reported

mas_kin_ik solves dq = J'(JJ' + lambda^2 I)^{-1} e. The update is then clamped to stepLimit rad per joint, because J is a first-order model and a large Cartesian error produces a step that overshoots the region where that model holds.

Measured at a near-singular configuration (q2 = 1e-4, arm almost straight) with a target demanding radial motion:

q2cond(J)DLS raw stepnormal-equations raw step
0.014.9e23.7464.4
1e-34.9e30.41641
1e-44.9e40.126.4e3
1e-64.9e60.121.4e5

DLS stays bounded; (J'J)\J'e grows like 1/q2. method='normal' is kept deliberately as that negative control, and both maxStep (applied) and stepRawMax (requested) are returned, because suppressing the unbounded value would hide the information that tells you the configuration is bad.

A target outside the reachable annulus returns feasible=false and runs zero iterations. A target reachable only by violating the joint limits returns converged=false with limitHit=true -- it does not return the clamped pose as if it had succeeded.

Is the filter's uncertainty honest?

A filter can be stable, smooth, and confidently wrong. mas_ekf_check answers the one question that the estimate plot cannot:

eps_k = (x_k - xhat_k)' P_k^{-1} (x_k - xhat_k)          E[eps] = n

It draws ground truth from Qtrue/Rtrue and gives the filter Q/R, averages NEES over nRuns independent runs, and applies the two-sided band from N*ANEES ~ chi2(N*n).

Measured (2-state constant-velocity model, 120 runs x 60 steps, band 1.66..2.38):

caseANEESverdict
correctly tuned1.92PASS
R_filter = R_true/100107FAIL
Q_filter = Q_true/10051FAIL
R_filter = R_true*1000.81FAIL

The band is two-sided on purpose: "close to n" is not the same as "consistent", and a filter tuned by inflating R is pessimistic, not correct. The verdict also checks the fraction of time steps inside the band, since a filter can have the right mean while being inconsistent during transients.

Frames: the two checks that catch convention errors

mas_frame_check reports orthErr = max|R'R - I| and det(R) separately, because they catch different defects. A matrix stretched 0.1 % along one column still has det(R) = 1.001 -- det alone calls it a rotation -- while orthErr reads 2.0e-3. Conversely a reflection has orthErr = 0 and det(R) = -1.

Euler sequence is part of the data: the same three numbers mean different orientations under ZYX and XYZ, so .seq is required and never defaulted, and the sequence used is reported back. Where Robotics System Toolbox is licensed the result is cross-checked against eul2rotm / quat2rotm and the deviation reported (measured: 0 and 1.1e-16). Absence is reported as crossCheck.checked = false, never faked. angleUnit='rad' rejects input whose magnitude exceeds 2*pi, which is what degree-valued data looks like.

tests/test_robotics.m — cases are graded against an independent value, with a negative control for every metric that could pass vacuously.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

MATLAB code generation and deployment workflow for MATLAB Coder, Simulink Coder, Embedded Coder, GPU Coder, HDL Coder, fixed-point conversion, MEX validation, and embedded deployment readiness. Use whenever the user asks to generate C/C++/CUDA/HDL/code, deploy algorithms, or validate generated code.

中文简介正在准备中。当前显示原文说明。

wzyn20051216/matlab-agent-skills262026年10月21日 更新

MATLAB workflow for control systems, system identification, robust control, MPC, Simulink Control Design, parameter tuning, constrained optimization, and numerical validation. Use whenever the user asks for controllers, transfer functions, state-space models, tuning, identification, optimal control, or solver-based engineering.

中文简介正在准备中。当前显示原文说明。

wzyn20051216/matlab-agent-skills262026年10月21日 更新

MATLAB data analysis workflow for tables, timetables, statistics, fitting, optimization-assisted analysis, visualization, report artifacts, and reproducible paper figures. Use whenever the user asks MATLAB to analyze data, plot results, fit models, process CSV/Excel/MAT files, or reproduce figures.

中文简介正在准备中。当前显示原文说明。

wzyn20051216/matlab-agent-skills262026年10月21日 更新

MATLAB agentic workflow router. Use this whenever the user asks for MATLAB, Simulink, .m/.mlx/.slx work, toolbox-driven engineering, paper reproduction, simulation, code generation, data analysis, control, robotics, signal/image/AI workflows, or wants an end-to-end automated MATLAB task with validation. For Simulink tasks on this machine, default to a visible workflow: open MATLAB/Simulink windows first so the user can watch modeling, simulation, tuning, and plotting progress.

中文简介正在准备中。当前显示原文说明。

wzyn20051216/matlab-agent-skills262026年10月21日 更新

Run MATLAB tasks from Codex with reliable MCP-based execution, logs, artifacts, toolbox inventory, smoke tests, and reproducible validation. Use whenever MATLAB code, .m/.mlx scripts, MATLAB tests, local toolbox probing, or command-line automation is needed.

中文简介正在准备中。当前显示原文说明。

wzyn20051216/matlab-agent-skills262026年10月21日 更新

MATLAB workflow for signal processing, DSP, image processing, computer vision, lidar, medical imaging, deep learning, and AI-assisted reproducible experiments. Use for filters, spectrograms, wavelets, object detection, segmentation, classification, training, inference, and generated figures.

中文简介正在准备中。当前显示原文说明。

wzyn20051216/matlab-agent-skills262026年10月21日 更新

查看 wzyn20051216 的全部技能

报告此技能的问题