Visualizer is afraid of model

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
Ross Miller
Posts: 371
Joined: Tue Sep 22, 2009 2:02 pm

Visualizer is afraid of model

Post by Ross Miller » Fri Mar 19, 2021 6:16 am

Hi all,

I am having a strange problem with the Visualizer recently:

Normally when a simulation finished I send the MocoSolution to the Visualizer and it animates the solution from a sensible default camera view. Recently however, it has been animating the solution with the camera zoomed out very far away from the model (example attached).

The only change I've made recently is that the graphics are a mix of VTP and STL files. The STLs are some meshes for a lower limb prosthesis.

Any solutions/guesses on why this is happening and how to get it to default to a more useful view?

Ross
Screen Shot 2021-03-19 at 9.15.24 AM.png
Screen Shot 2021-03-19 at 9.15.24 AM.png (698.24 KiB) Viewed 377 times

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

Re: Visualizer is afraid of model

Post by Nicholas Bianco » Fri Mar 19, 2021 1:36 pm

Hi Ross,

I think the visualizer will zoom out to fit all visible graphics in the model. I saw similar thing happen when trying to visualize GRFs and I scaled the force visualization to be too large. You've double checked that all graphics added to the model are being added in the correct place? Also, perhaps your simulation is generating super high GRFs at some point during the simulation.

-Nick

User avatar
Ross Miller
Posts: 371
Joined: Tue Sep 22, 2009 2:02 pm

Re: Visualizer is afraid of model

Post by Ross Miller » Mon Mar 22, 2021 5:50 am

Thanks Nick. The GRF are normal-sized in this simulation. There must a rogue pixel in one of the STL files. When I animate it without those files the camera view is normal.

Ross

User avatar
Aaron Fox
Posts: 271
Joined: Sun Aug 06, 2017 10:54 pm

Re: Visualizer is afraid of model

Post by Aaron Fox » Mon Mar 22, 2021 8:04 pm

Hi Ross,

It looks like there's something in the foreground of that view - the little blue dot on the ground looks out of place.

Aaron

User avatar
Ross Miller
Posts: 371
Joined: Tue Sep 22, 2009 2:02 pm

Re: Visualizer is afraid of model

Post by Ross Miller » Tue Mar 23, 2021 4:35 pm

I noticed that as well. It doesn't appear in the video, just in screenshots, and there's no similar artifacts in the STL files I added. The mystery continues.

User avatar
Aaron Fox
Posts: 271
Joined: Sun Aug 06, 2017 10:54 pm

Re: Visualizer is afraid of model

Post by Aaron Fox » Wed Mar 24, 2021 2:54 pm

Hi Ross,

Where's the origin (0,0,0) in this context? I've noticed sometimes that my marker data or force data when there is 'nothing' becomes zeros, and if this is the case perhaps the visualiser views this as 'data' that needs to be encompassed in the visualisation? I'd be surprised if your origin was this far away though.

Aaron

User avatar
Ross Miller
Posts: 371
Joined: Tue Sep 22, 2009 2:02 pm

Re: Visualizer is afraid of model

Post by Ross Miller » Fri Mar 26, 2021 12:34 pm

It visualizes these same data normally when I hide the STL files I added to the model (they are for a prosthesis). It then doesn't animate the prosthesis of course but the view/angle of the visualizer is normal. So I think it's something with those STL files.

Ross

User avatar
Carlos Gonçalves
Posts: 127
Joined: Wed Jun 08, 2016 4:56 am

Re: Visualizer is afraid of model

Post by Carlos Gonçalves » Fri Jun 18, 2021 11:02 am

Hello everyone,

I just searched this forum entry right now because my models also started to be afraid of the screen.

For me was the case of really scary GRFs ... (the contact spheres are magically going under the floor)

Ross, if you still have a problem with the STL, maybe check it using Meshmixer (https://www.meshmixer.com/). It has a diagnostic tool that can quickly identify errors or floating triangles. Perhaps you already tried it.

About the GRFs, does anyone knows a way to restrain the feet over the ground? I thought of creating an auxiliary joint linking to toes to the ground and constrain it using problem.SetStateInfo.

Best regards.

User avatar
Aaron Fox
Posts: 271
Joined: Sun Aug 06, 2017 10:54 pm

Re: Visualizer is afraid of model

Post by Aaron Fox » Sun Jun 20, 2021 5:16 pm

Hi Carlos,

I assumed this relates to walking, and I can hopefully relate some of my issues from running simulations to your problem. I found that getting accurate pelvis_ty kinematics combined with appropriate contact sphere size and locations to be the best way to get good contact tracking, without too much sphere-floor penetration. At times my experimental data needs a bit of re-working via RRA to ensure the kinematics best align with the ground reaction forces - and I've found doing this before any contact tracking/prediction with Moco can be a useful step. Where I haven't done this, I think Moco struggles to change the pelvis_ty kinematics too much (i.e. adds too much to the tracking cost vs. contact cost) to get things right.

Aaron

User avatar
Carlos Gonçalves
Posts: 127
Joined: Wed Jun 08, 2016 4:56 am

Re: Visualizer is afraid of model

Post by Carlos Gonçalves » Mon Jun 21, 2021 4:46 pm

Thanks a lot for sharing your thoughts Aaron. Predictive simulation is an ocean of doubts sometimes.

Your comments follow my first experience with predictive simulation of 3D gait. I studied a patient gait and managed to get some really good results in both tracking and predicting.

"Some say, the model could identify hamstrings spasticity during stance" (Jeremy Clarkson voice). :shock:

Now I'm trying to compute a full predictive simulation, starting from my model, some initial constraints, and hoping for the best. The takeaway so far is that the states are way more than just the coordinate values, activations, and muscle lengths. The coordinate speeds were "loose" in my initial bounds, and the solver was trying to use a trampoline effect, pushing the heels in the ground. Maybe that's what I was missing ...

I tried to create additional joints with <is_free_to_satisfy_constraints>true</is_free_to_satisfy_constraints>, but it is not possible to connect the ground to the multibody in more than one joint. I thought of trying to create 3 PointOnLineConstraint for each heel so that it could always stay above ground, but it seems kind of extreme :lol:

After this endeavor, I will create a decent forum topic about this subject. Maybe it can help others.

Best regards.

Carlos

POST REPLY