Conditional tendon sites, moving tendon sites and joints.

Discussion in 'Simulation' started by AQLK, Mar 9, 2018.

  1. Hi. In the open-source software OpenSim musculo-skeletal models are made with rigid bodies and tendons for muscles. The tendons are routed through via-points (like tiny rings through which a tendon-wire would slide), and cannot wrap around spheres/cylinders like in MuJoCo.

    I am trying to 'port' some OpenSim models to be run by MuJoCo and want to avoid the wrapping objects, because finding an equivalent wrapping object that gives similar behavior as the OpenSim model is a bit tough.
    However, OpenSim (OS) can do some things that MuJoCo (MJC) cannot do straight out of the box. I was wondering if what I am planning is the best way to do it:

    1) OS: Tendon via-points can appear conditionally, based on e.g. if some joint angle is between some bounds. This is used to create something that approaches wrapping. In MJC believe there is no way to have a tendon from A to B with a via-point (site) C that is only sometimes enabled. Can such a site be created, added and destroyed at will at run-time? The only workaround I can think of is to force the 'disabled' via-point (site) C's position to be on the line between sites A and B, such that it has no influence on the tendon behavior. Or even aggregate all 'disabled' via-points between A and B at location A or B. I would do this by changing m->site_pos (the local coordinate) of that site.

    2) OS: Tendon via-points can move based on e.g. some joint angle, according to some spline. In MJC I would read the joint angle and change m->site_pos (local coordinate) of that site.

    3) OS: The location of a revolute joint can be dependent on the joint angle (e.g. the human knee joint axis translates relative to the upper leg while the knee flexes) based on some spline. In MJC I would change that by measuring the joint angle and change the joint position in m->jnt_pos (local coordinate).

    Second, very minor, question: the OpenGL visualizer shows a routed tendon as taking effectively a short-cut through the cylinder it wraps around. Can it be made to look like it actually wraps around the cylinder? Or what would be an easy way to program this myself?