Why are my Simscape Multibody solid files (STP/STEP) and icon images no longer found in R2023a when running the simulation via test case?
13 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2024-11-4
编辑: MathWorks Support Team
2024-11-4
I work with a Simulink project and have a model in Simulink with Simscape multibody.
I can simulate this model in Simulink just fine hitting the play button.
But when calling this model via a test (using the MATLAB unit test framework) I have issues as of R2023a while this worked fine in R2022b.
In R2023a: If I call the model via the test, it complains it cannot find the solids:
"The parameter Geometry/File Name is a file that does not exist. Resolve this issue in order to simulate the model."
Workaround 1 for running the test:
With an absolute path, it works.
With a relative path, it does not work.
(However, it works in both cases when running a simulation in Simulink.)
Workaround 2 for running the test:
The other solution that seems to work is adding the solids folder to the path and then only using the .stp file name without any paths.
Additional observation:
I noticed the same issue with icon images.
This occurs only if you change the block in r2023a.
Also here the workaround is to add the path to the project and remove it in the block.
采纳的回答
MathWorks Support Team
2024-11-4
In the older releases the test was passing because the infrastructure did not do any path manipulation and assumed that test was being run from the path where the test exists while in the newer release (R2023a onwards) Test Browser was introduced, which by design utilizes suite creation from file which is more robust when compared to suite creation from class and that is the reason why infrastructure cds to the parent folder path for the namespace tests. So the tests are being run from this parent folder and Simulink is unable to locate the path to STP file referred to in the model because it has been given a relative path.
The right approach here would be to switch to using absolute paths, which should fix the test failure.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multibody Modeling 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!