Data Type Mismatch (expects single, driven by double) at Input of Simulation 3D General Aviation Pack NED Block

4 visualizzazioni (ultimi 30 giorni)
Title: Data Type Mismatch (expects single, driven by double) at Input of Simulation 3D General Aviation Pack NED Block
Body:
Hi MathWorks Community,
I am encountering a data type mismatch error while trying to perform 3D visualization in Simulink.
My Model Structure:
  1. I am using the Simulation 3D General Aviation Pack NED block (from the 3D Aerospace Pack library) in my model.
  2. I am connecting signals to the Body_T (Translation/Position) and Body_R (Rotation) inputs of this block.
  3. These input signals are generated by standard Simulink blocks (like Vector Concatenate, Rate Transition, etc.) and are inherently of the double data type by default.
  4. The Body_T input expects a [1x3] vector, and the Body_R input expects a [1x3] vector (I have checked this in the block parameters).
  5. I am running my model with a Fixed-step solver (e.g., 0.02 step size).
The Problem:
When I run the model, I get the following error originating from internal sub-blocks of the Simulation 3D General Aviation Pack NED block (such as Geospatial Body Transform/Vector Concatenate1 and Switch):
Data type mismatch. '[BLOCK_PATH]' expects a signal of data type 'single'. However, it is driven by a signal of data type 'double'.
Attempted Solution (Unsuccessful):
To resolve this error, I added Data Type Conversion blocks immediately before the Body_T and Body_R inputs of the GA NED block, and set the "Output data type" of these conversion blocks to single. So the flow became:
[double signal] $\rightarrow$ Data Type Conversion (single) $\rightarrow$ Body_T / Body_R
However, despite adding these Data Type Conversion blocks, I am still receiving the same Data type mismatch... expects single... driven by double error.
My Question:
Why does the Simulation 3D General Aviation Pack NED block still claim it's receiving a double, causing this error, even when I explicitly send it a signal converted to single via Data Type Conversion? What is the correct way to send single type data to this block, or is there a setting I might be overlooking?
Data type mismatch. 'Input Port 1' of 'hazir_sitl/Subsystem/Simulation 3D General Aviation Pack/Geospatial Body Transform/Vector Concatenate1' expects a signal of data type 'single'. However, it is driven by a signal of data type 'double'.
Data type mismatch. 'Output Port 1' of 'hazir_sitl/Subsystem/Simulation 3D General Aviation Pack/Geospatial Body Transform/Switch' is a signal of data type 'double'. However, it is driving a signal of data type 'single'.
  4 Commenti
Nishan Nekoo
Nishan Nekoo il 27 Ott 2025
Hi Gürkan,
What version of MATLAB are you using? I can't seem to replicate this behavior in the latest version.
Nishan
Gürkan
Gürkan il 27 Ott 2025
I use R2025 a, I argued with artificial intelligence again, I guess it's something that shouldn't normally happen, I couldn't understand it either.

Accedi per commentare.

Risposte (1)

Matt Overholt
Matt Overholt il 28 Ott 2025
Hi Gürkan,
Please check the Signal Attributes > Data type setting on your Translation and Rotation out ports. If they are set to 'inherit: auto' and you remove your 'single' Data Type Conversion blocks in your model feeding the pack block, then it should be fine.
The problem stems from double type Constant blocks inside of the pack block which don't play well with the incoming singles. The error message is not very helpful, unfortunately.
Matt

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by