Page 1 of 1

Visualizer can't show mesh geometry

Posted: Fri Nov 13, 2020 8:16 am
by davitor3
Hi everyone.
I have been working on transtibial amputee gait using MOCO and Matlab. I modified 2D walking example model removing ankle joint and adding prosthesis model. I ran my matlab script, it worked well, but when I want to visualize given results, I can't see prosthesis mesh geometry despite these can visualize in Opensim windows application.

Image

Image

Someone knows why it don't show geometries? I have tried changing geometry file format but it still doesn't work .

Thank you for your attention

Re: Visualizer can't show mesh geometry

Posted: Fri Nov 13, 2020 1:02 pm
by nbianco
Hi David,

Where are you keeping the prosthesis geometry? The visualize() function in Moco uses the Simbody visualizer, which doesn't use the same Geometry path as the GUI. Try adding the geometry to the MATLAB working directory where you are running your simulations.

-Nick

Re: Visualizer can't show mesh geometry

Posted: Sat Nov 14, 2020 9:09 am
by davitor3
Hi Nicholas.
Thank you for you answer.
The mesh geometries are located in working directory, more specifically in a folder named geometry, just like 2D walking example. What else can it be?

David

Re: Visualizer can't show mesh geometry

Posted: Mon Nov 16, 2020 1:01 pm
by nbianco
What is the format of these files? For example, I don't think the Simbody visualizer supports .stl files.

Re: Visualizer can't show mesh geometry

Posted: Wed Nov 18, 2020 9:31 am
by davitor3
Hi Nicholas.
The format of these files is .stl. I had changed the format to .vtp or .obj but it didn't work. In the last days I find out that unlocking prosthetic ankle joint, the simbody visualizer was able to show prosthesis mesh geometries. Then, I modified osim model adding Coordinate limit force instead of locking prosthetic joints. I don't know the right reason but it worked. In adittion, I dont know if the model stament is correct too.
Image


David

Re: Visualizer can't show mesh geometry

Posted: Wed Nov 18, 2020 1:01 pm
by nbianco
Hi David,

Glad you got it to work! I think locked joints can create issues with the visualizer if the model can't meet the constraint (since locked joint are enforced as a constraint in the multibody system).

-Nick

Re: Visualizer can't show mesh geometry

Posted: Thu Nov 19, 2020 12:28 pm
by davitor3
Hi,
Glad you got it to work!
Thanks Nicholas! 😃

I think locked joints can create issues with the visualizer if the model can't meet the constraint (since locked joint are enforced as a constraint in the multibody system)
Is there any way to replace locked joints by model constraints?

Re: Visualizer can't show mesh geometry

Posted: Thu Nov 19, 2020 4:29 pm
by nbianco
It's better to just replace a joint with a locked coordinate with a weld joint. You can do this with the ModelOperator ModOpReplaceJointsWithWelds.

-Nick