Page 1 of 1

Different weighting factors for each axis?

Posted: Wed Jun 29, 2022 10:03 pm
by graceg17
Hi there,

I was wondering if it would be possible to have different weighting factors for tracking goals in the x/y/z axes? In my case when tracking IMU signals I am having more success with a 2D model tracking signals with the OpenSim z axis components set to 0, so am considering whether reducing the weight on tracking these components could assist with obtaining a converged solution in 3D.
Is this something that could be added as a custom goal or potentially developed for a future release? Or would it be difficult to implement with the signals being wrapped in a TimeSeriesTableVec3? I imagine the same concept could also be applied to GRF/joint reaction/marker tracking if it was feasible.

Thanks!
Grace

Re: Different weighting factors for each axis?

Posted: Thu Jun 30, 2022 9:04 am
by rosshm
Hi Grace,

You can do this for GRF with MocoContactTrackingGoal, I do it like this:

Code: Select all

contactTracking1 = MocoContactTrackingGoal('name for this goal',weightForThisGoal)
...
contactTracking1.setProjection('vector');
contactTracking1.setProjectionVector(Vec3(0, 1, 0));
This tells this particular contact tracking goal to track just the vertical GRF component with weight weightForThisGoal. You can create other separate contact tracking goals with different weights for other components.

For motion-tracking, with MocoTrack and MocoStateTrackingGoal I think you can only track model states, e.g. generalized coordinates and speeds. I haven't used MocoOrientationFrameTrackingGoal much but it might be able to do what you described.

https://simtk.org/api_docs/opensim/api_ ... gGoal.html

Hope this helps,
Ross

Re: Different weighting factors for each axis?

Posted: Sun Jul 03, 2022 6:07 pm
by graceg17
Thanks Ross, yes I don't think that is an option for IMU signal related goals but would be very useful for GRF tracking!

Re: Different weighting factors for each axis?

Posted: Sun Jul 03, 2022 7:05 pm
by nbianco
Hi Grace, Ross,

No, there isn't an "projection" option for the IMU tracking goals. I realize now that we should have made this an option for all tracking goals with 3D data by default. But it's an easy enough addition. It won't make it into 4.4 since that's already in beta, but if you need a custom build for your project we can do that too.

-Nick

Re: Different weighting factors for each axis?

Posted: Tue Jul 05, 2022 7:41 pm
by graceg17
That sounds great thanks Nick, I don't think this should be crucial for my project at this point but will let you know if that changes, or if you do implement this in a future build/update please let me know!

Re: Different weighting factors for each axis?

Posted: Thu Jul 07, 2022 10:55 am
by nbianco
Sounds good! I'll create a GitHub issue for now and let you know when we get around to updating these goals.

-Nick