biorbd icon indicating copy to clipboard operation
biorbd copied to clipboard

Declaration LoopConstraint

Open AnaisFarr opened this issue 1 year ago • 2 comments

Good news @Ipuch , LoopConstraint works !

We created an example of a triple bar with the bar2 and 3 are attached with the loopconstraints. The simulated movement makes the bar2 fall with the gravity (the bar2, attached to the bar1, have an angle of 90°). The bar3 stay attached by the loopconstraints to the bar2 when the loopconstraints is declared 2 times in the BioMod (one for each axis).

loopconstraint
    predecessor Bar2
    successor Bar3
    RTpredecessor 0 0 0 xyz 0 -1 0
    RTsuccessor 0 0 0 xyz 0 0 0
    axis 0 0 0 0 1 0 // in predecessor frame
    enableStabilization 1
    stabilizationParameter 0
endloopconstraint

loopconstraint
    predecessor Bar2
    successor Bar3
    RTpredecessor 0 0 0 xyz 0 -1 0
    RTsuccessor 0 0 0 xyz 0 0 0
    axis 0 0 0 1 0 0 // in predecessor frame
    enableStabilization 1
    stabilizationParameter 0
endloopconstraint

It doesn't work if the two axis are declared in the same loopconstraints.

We tried to simulate the same thing by calculating the external forces and by introducing these external forces in the calculation of the dynamics. It works when the pendulum doesn't move. We have created an example with three pendulums aligned in y and with gravity in y. The bar3 remains attached to the bar2 in this case. But as soon as there are several loop constraint, we can not make it work, we have the error :

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

AnaisFarr avatar May 10 '23 19:05 AnaisFarr

Nice advancement. I can't wait to see the results and talk about it !

Ipuch avatar May 12 '23 12:05 Ipuch

This is the expected behavior that it won't work, this is on RBDL side... Maybe we could raise a more descriptive error though...

pariterre avatar May 12 '23 12:05 pariterre