问题:报个莫名其妙的错误。
Index exceeds the number of array elements。Index must not exceed 0;
在验证Matlab、simulink及固件均无问题情况下,对工具箱代码进行分析。
toolchainDir = fullfile(filesep,'opt','gcc-arm-none-eabi-9-2020-q2-update','bin');
if ~isfolder(toolchainDir) %@note 判断该路径下编译环境
toolchainDir = '';
end
其中判断为空,导致后续出现问题。matlab 无法判断WSL2 Ubuntu22.04中的路径。可能WSL2 与 工具箱适配问题。
把判断的3行注释掉就可以了。
环境版本:matlabR2024a
UAV Toolbox Support Package for PX4 Autopilot 24.1.2