Setting the system state in a model with constraints
Posted: Thu Mar 06, 2014 1:44 pm
Hi,
I've been trying to use the API to compute moment arms for my musculoskeletal model for different values of the generalized coordinates. Out of around 15 dofs in the model, only 4 are truly independent and each of the remaining 11 are functions of one of the 4, linked through a 'CoordinateCouplerConstraint'. I am thus only interested in computing moment arms about these 4 independent dofs.
In my C++ code, I tried using coordinate.setValue(state,Q), for the independent coordinates and expected that this procedure will automatically call system assembly to satisfy the constraints and automatically update the coordinate values for the corresponding dependent coordinates. This doesn't seem to be happening, and I'd be very grateful if someone could suggest how I could accomplish this? Thank you.
P.S: Another approach I tried was to first come up with a fairly accurate guess value for all 15 coordinates using an independently computed jacobian, and then do the following. This met with little success as well.
state.setQ(q_guess);
model.getMatterSubsystem().getSystem().projectQ(state);
I've been trying to use the API to compute moment arms for my musculoskeletal model for different values of the generalized coordinates. Out of around 15 dofs in the model, only 4 are truly independent and each of the remaining 11 are functions of one of the 4, linked through a 'CoordinateCouplerConstraint'. I am thus only interested in computing moment arms about these 4 independent dofs.
In my C++ code, I tried using coordinate.setValue(state,Q), for the independent coordinates and expected that this procedure will automatically call system assembly to satisfy the constraints and automatically update the coordinate values for the corresponding dependent coordinates. This doesn't seem to be happening, and I'd be very grateful if someone could suggest how I could accomplish this? Thank you.
P.S: Another approach I tried was to first come up with a fairly accurate guess value for all 15 coordinates using an independently computed jacobian, and then do the following. This met with little success as well.
state.setQ(q_guess);
model.getMatterSubsystem().getSystem().projectQ(state);