- Use the "coder.screener" function for your code to identify if any parts of your code are not suitable for code generation.
- After using the "predict" function check the validity of the "insfilterMARG" object, as it is possible that is is overwritten.
- For the "fusegps" function the "position" should be in the geodetic coordinates and the "velocity" should be in the local (North-East-Down) coordinate system.
- For a typical workflow, you may need to call the "predict" function to propogate the state of the "insfilterMARG" object forward in time before using the "fusegps" to correct the estimate with new GPS measurments.
The insfilterErrorState function appears predict method Function call failed during code generation.
조회 수: 1 (최근 30일)
이전 댓글 표시
function [Pose,Orient] = GetPose(accel,gyro,gpsLLA,gpsVel,idx)
%UNTITLED 此处提供此函数的摘要
% 此处提供详细说明
filt = insfilterErrorState;
filt.IMUSampleRate = 100;
filt.ReferenceLocation = [42.28,25,-71.343,53.0352];
filt.State = [0.70605;0;0;0.708155;8.4199;0.0250020;0;-0.0068;2.5002;0;0;0;0;0;0;0;1];
filt.StateCovariance = eye(16)*1e-9;
Rvel = eye(3)*0.01;
Rpos = eye(3);
% Use predict to estimate the filter state based on the accelData and
% gyroData arrays.
predict(filt,accel,gyro); %Function call failed error form here.
% GPS data is collected at a lower sample rate than IMU data. Fuse GPS
% data at the lower rate.
if mod(idx, 10) == 0
% Correct the filter states based on the GPS data.
fusegps(filt,gpsLLA,Rpos,gpsVel,Rvel);% and here.
end
% Log the current pose estimate
[Pose, Orient] = pose(filt);
end
I want to use insfilterErrorState to mcu so i try to generate embedded code but i get two error "Function call failed.", it form predict function but i see the predict function documentation this function can be generare c code.
matlab coder interface screenshot as follows
somebody can help me?
댓글 수: 0
답변 (1개)
Maneet Kaur Bagga
2024년 2월 23일
Hi,
As per my understanding, you are encountering an error during the code generation process for an embedded system. From the above mentioned function it is visible that thw "GetPose" funtion utilizes te "insfilterErrorState" object from the Sensor Fusion and Tracking Toolbox to estimate pose using the sensor data from an accelerometer, gyroscope, and GPS.
Please refer to following as a possible workaround for the error encountered:
Please refer to the MathWorks Documentation for further understanding:
coder.screener: https://www.mathworks.com/help/coder/ref/coder.screener.html
Hope this helps!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!