Rotations of simulink 3D animation do not correspond to mates in Solidworks assembly
1 次查看(过去 30 天)
显示 更早的评论
I am trying to export a simple solidworks model existing of two links. One is fixed, and the other one can rotate around the others end. If I test the model in simmechanics, it works fine. If I import it to the virtual reality world, the model rotates around different coordinate systems, but none of them correspond with the mates I created in solidworks.
This is what I did to create the model.
Create the solidworks assembly Create mates (concentric and coincident mate)
Export to xml file via Simmechanicslink, use smimport to create the slx file, test the model in simmechanics, see if it behaves correctly (the rotation of the hinge is correct in the simmechanics model)
Save the Solidworks assembly as a VRML file (uncheck the “save all components of the assembly file in a single file” box).
Insert a VR Sink block in a new slx file to connect Simulink to the virtual world
Create inputs for a rotation ( a vector [1 0 0] for the rotation axis and an input for the angle)
Click on the VR Sink block and open the source file (the wrl file created in solidworks)
Now I can select one of the many rotations as an input for the VR Sink, but none of them are linked to the mates I created in solidworks…. The part rotates around a different axis.
Do I need to recreate the constraints in the VR world (where can I find how) or am I doing something wrong while exporting the model?
Thanks!
Floris
1 个评论
Mohammad Okour
2020-4-24
Have you solved your problem? because iam facing the same problem , i think the problem related for the stl file because when you convert the assembly into stl file , the parts are being like one object and all relations and mates between parts disappear.
回答(1 个)
Jon Boerner
2014-10-22
Two things:
- If the model appears correctly in the SimMechanics Viewer, I would recommend trying to use the STL files you used for that with the stl2vrml function. Converting the STL files you know work may be easier than trying to re-export from SolidWorks.
- It is possible you'll need to take a few more things into consideration in order to get the axes right. This page describes these things.
If those two links don't help resolve the issue, comment on the answer and I can take another look.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model Import 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!