Visualizer can't show mesh geometry

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
POST REPLY
User avatar
David Torres
Posts: 17
Joined: Wed Feb 11, 2015 6:38 am

Visualizer can't show mesh geometry

Post by David Torres » Fri Nov 13, 2020 8:16 am

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

User avatar
Nicholas Bianco
Posts: 963
Joined: Thu Oct 04, 2012 8:09 pm

Re: Visualizer can't show mesh geometry

Post by Nicholas Bianco » Fri Nov 13, 2020 1:02 pm

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

User avatar
David Torres
Posts: 17
Joined: Wed Feb 11, 2015 6:38 am

Re: Visualizer can't show mesh geometry

Post by David Torres » Sat Nov 14, 2020 9:09 am

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

User avatar
Nicholas Bianco
Posts: 963
Joined: Thu Oct 04, 2012 8:09 pm

Re: Visualizer can't show mesh geometry

Post by Nicholas Bianco » Mon Nov 16, 2020 1:01 pm

What is the format of these files? For example, I don't think the Simbody visualizer supports .stl files.

User avatar
David Torres
Posts: 17
Joined: Wed Feb 11, 2015 6:38 am

Re: Visualizer can't show mesh geometry

Post by David Torres » Wed Nov 18, 2020 9:31 am

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

User avatar
Nicholas Bianco
Posts: 963
Joined: Thu Oct 04, 2012 8:09 pm

Re: Visualizer can't show mesh geometry

Post by Nicholas Bianco » Wed Nov 18, 2020 1:01 pm

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

User avatar
David Torres
Posts: 17
Joined: Wed Feb 11, 2015 6:38 am

Re: Visualizer can't show mesh geometry

Post by David Torres » Thu Nov 19, 2020 12:28 pm

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?

User avatar
Nicholas Bianco
Posts: 963
Joined: Thu Oct 04, 2012 8:09 pm

Re: Visualizer can't show mesh geometry

Post by Nicholas Bianco » Thu Nov 19, 2020 4:29 pm

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

POST REPLY