Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: The logical indices contain a true value outside of the array bounds. #28598

Open
Husseinhajjsleiman opened this issue Nov 12, 2024 · 11 comments

Comments

@Husseinhajjsleiman
Copy link

timePlaus = plausibilizeTime(log.(prop).TimeS(idxVec));

Hi,

I am using this bin file for testing the simulink model. I am aware that this model is built for system identification mode however, I noticed that the code is capable of also handling different modes by simply selecting the subflight that I am interested in.

Once the code start to resample the data (specifically when it reaches to BAT struct in logResampled) an error occurs showing the following:
The logical indices contain a true value outside of the array bounds.
Error in resampleLog (line 76)
timePlaus = plausibilizeTime(log.(prop).TimeS(idxVec));
Error in sid_pre (line 429)
sidLogs(numOldSubflights + i).data = resampleLog(log, true, 'linear');

Is this error caused by the log bitmask? I have it set to 2242559

Thank you.

@IamPete1
Copy link
Member

@fbredeme can you take a look please.

@Husseinhajjsleiman
Copy link
Author

Anyone?

@fbredeme
Copy link
Contributor

Hi @Husseinhajjsleiman, what copter version are you using and what is the sample time of the BAT data?

@Husseinhajjsleiman
Copy link
Author

Hi @Husseinhajjsleiman, what copter version are you using and what is the sample time of the BAT data?

Thank you for reaching back. I am using this ArduCopter V4.5.6 (7ce11b4) and its the bdshot version.
I am not sure what sampling rate battery is in. This is a question that ive been looking for an answer for it on how to impact (increase or decrease) the sampling rate the dataflash logs (without synchronization or resampling)

I think its around 25 Hz but please double check after me. You can find the bin file in the link i shared in my first post. Note that I am using PM02D Holybro power module to measure battery params.

@Husseinhajjsleiman
Copy link
Author

any ideas why the error is occurring when Battery data getting resampled? I was debugging and I knew the error was occurring on battery logs. @fbredeme

@fbredeme
Copy link
Contributor

@Husseinhajjsleiman I need to set up Matlab again to check your bin file and how the code is handling it. I will reach back to you as soon as I managed to do so.
I looked at the logs in Mission Planner and it appears to me that the sample rate is 10 Hz. I will check that again in Matlab.
Please note that the last time that the Simulink model and the scripts have been updated was shortly before 4.3.

@Husseinhajjsleiman
Copy link
Author

Okay, thanks alot for reaching back. One question about sample rate: is there a way to increase the sample rate of the data flash logs? I am trying to impact the sample rate of position, velocities, gyros, imu and rpms - esc telem. Obviously they're from different sources and i am not sure if the attitudes are estimated. But i was wondering if you have an idea about increasing the sampling rate for those data sources? similar effect when sysid mode is activated and the data is sampled to 400 Hz. Any ideas are highly appreciated. I am looking forward to your comment about the error Im facing. Thanks.

@Husseinhajjsleiman
Copy link
Author

Hi, any updates about this issue @fbredeme ?

@Husseinhajjsleiman
Copy link
Author

I have fixed the issue. Thank you.

@Zhujingxi
Copy link

Hi I'm also facing the smiler error can you share how you slove it?

@Husseinhajjsleiman
Copy link
Author

Honestly i thought that I fixed it but it worked with one case and I don't know why it worked with this one specific case. The person who implemented it must correct it as it is published in arducopter latest release. For some reason this is not clarified and no one is answering anymore. I am working on something else now but i will get back into it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants