NaN values when attempting Motion Read for a UAV Scenario
20 views (last 30 days)
Show older comments
I'm currently attempting to get platform or sensor related motion data from my UAV 3d scenario Simulink Model. Attached is the current block diagram:
I have the UAV scenario configuration block, the SImulation 3D scene configuration block, and the UAV Scenario Motion Read block, connected to my workspace as shown above. The UAV scenario block is configured for the singleUAVScenario function, which spawns a single quadrotor. The control part and this configuration were taken from an example in MATLAB's documentation, so all bus, signal, and data blocks' names are unchanged. When I run the model, initially the values are updating, as shown:
However, more or less after a single second passes in my simulation, for some reason, my data goes to NaN values for the rest of the simulation, no matter how long it is, as shown here:
Obviously, when I take the data to MATLAB using a To Workspace block, I have the same issue.
I've tried running another MATLAB example; quick access for that is this:
openExample('uav/SimulateUAVScenarioUsingScenarioBlocksExample')
In that simulink model, the displays constantly update and there are no nan issues. Can anyone provide any answers? Sorry if it's an easy fix, I don't have too much experience in this particular area. Is it the sampling time, some inherent issue? I'm assuming that, according to the matlab documentation for the UAV scenario configuration block...
This block internally stores motion states from platforms and sensors in a global data store memory block as buses within a bus with a name specified in the Scenario motion bus name parameter.
That the motion parameters are automatically stored in this global data store memory block, and by using the read block, I can simply get the motion data. Do let me know if any additional information is needed, I can provide.
Note: Data goes to NaN after an exact second in simulation time has elapsed. No matter what the simulation step size is, the data seems constant except for the Position data for the first second, but instantly after, everything goes to NaN (except platform ID). The constant data also may be wrong, I suspect.
1 Comment
Ashok
on 30 Dec 2024 at 6:58
Hi Hasan,
Could you attach the relevant files to take a look at the issue?
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!