Page 1 of 1

External object simulation

Posted: Mon Jan 17, 2022 3:34 am
by yeti500
Hi everyone,
We are currently working on the simulation of a rugby pass through OpenSim. We have our model ready but we would like to add the ruby ball to the simulation. We have the .trc file of the ball displacements (represented with four markers around the ball), but we don't know how to implement it into the model. The purpose is to be able don't determine accurately the speed of the ball and its trajectory compared to body segments.

Do you know a way to do it ?

Regards,

Antoine & Axel

Re: External object simulation

Posted: Mon Jan 17, 2022 5:17 am
by tkuchida
You could add a new rigid body to the model, connect it to Ground with a FreeJoint, and track the markers on the ball. You can use methods like OpenSim::Frame::findStationLocationInAnotherFrame (https://simtk.org/api_docs/opensim/api_ ... aa78c66f79) to relate the trajectory of the ball to the player.

Re: External object simulation

Posted: Tue Jan 18, 2022 7:31 am
by yeti500
Thanks a lot, we successfully added the body and FreeJoint to the model. But as we don't know anything about C++ programming, we are unable to create the coordinates for the ball mobilities. Is there another way to do that than programming ? Or maybe using python ?

Re: External object simulation

Posted: Mon Jan 31, 2022 12:42 am
by nassila
Hi,

If you are connecting your body to the ground, you can find an implementation in python here: https://github.com/pyomeca/pyosim/blob/ ... le.py#L205

Hope it helps.