I've reproduced OpenSense pipeline in real-time and get a decent skeleton motion (visualizer shows perfectly valid skeleton movements) from a set of IMU sensors by using IK solver in such a way:
Code: Select all
...
_solver = std::make_unique<OpenSim::InverseKinematicsSolver>(_model, mrefs, refs, coords, SimTK::Zero);
_solver->setAccuracy(1e-5);
...
_solver->assemble(state);
...
_solver->track(state);
_model.realizePosition(state);
_model.findComponent<OpenSim::Body>("femur_r").getTransformInGround(state);
Code: Select all
...
_solver->track(state);
_model.realizeAcceleration(state);
_model.findComponent<OpenSim::Body>("femur_r").getAccelerationInGround(state);
Code: Select all
DEBUG 2020-08-28 16:13:33,544 linear acc: ~[-nan(ind),-nan(ind),-nan(ind)], ang acc: ~[-nan(ind),-nan(ind),-nan(ind)]
DEBUG 2020-08-28 16:13:33,544 linear velocity: ~[0,0,0]
DEBUG 2020-08-28 16:13:33,560 pos: ~[0.0771322,1.0213,0.120613], rot:
[0.119981,-0.00990397,0.992727]
[-0.42229,0.904469,0.0600616]
[-0.898485,-0.426425,0.104337]
DEBUG 2020-08-28 16:13:33,561 linear acc: ~[-nan(ind),-nan(ind),-nan(ind)], ang acc: ~[-nan(ind),-nan(ind),-nan(ind)]
DEBUG 2020-08-28 16:13:33,561 linear velocity: ~[0,0,0]
DEBUG 2020-08-28 16:13:33,577 pos: ~[0.0895136,0.916742,0.0696376], rot:
[0.126829,0.00611909,0.991906]
[-0.453883,0.88951,0.0525481]
[-0.881989,-0.456874,0.115593]
Thanks!