Home › Forum › SOFA › Programming with SOFA › [SOLVED] How to achieve respiratory motion?
Tagged: SOFA_2106, Windows_11
- This topic has 6 replies, 2 voices, and was last updated 2 years, 7 months ago by
Times.
-
AuthorPosts
-
13 January 2022 at 05:46 #21382
Times
BlockedHello @Hugo,
As discussed, I was hoping to create some respiratory motion for my simulation and I was wondering how I could achieve this? Thanks13 January 2022 at 09:53 #21393Hugo
KeymasterHey @akthetimes
Thanks for posting it on the forum.
The way I would recreate a desired motion of an object would be to implement this change of position (dofs) as a controller, whether a python or a C++ one, which would overwrite the new positions of your object at each time step.For oscillatory motion, we also have a projective constraint (similar to what I wrote just previously, projecting at the end of the time step the new positions) named: OscillatorConstraint.
Would this suit you?
Is a whole object moving or would you like just to impose an oscillatory motion of a part of an object?Best,
Hugo
14 January 2022 at 06:20 #21401Times
Blocked@Hugo Thank you! The OscillatorConstraint does the job, I think I would like to later implement this as a controller. In my case, the whole object is moving, is there a way I can achieve this too? Thanks 🙂
14 January 2022 at 11:56 #21402Hugo
KeymasterHey @akthetimes
Great that OscillatorConstraint does the job!
Regarding a later implementation as a controller, all you would need in your controller is a link to the MechanicalObject of your object so that you can write in it the new position at each time step.The MechanicalStateController (C++ class in SOFA) could be worth looking at.
Best wishes,
Hugo
—
NOTE: we are now moving the forum to GitHub Discussions. Do not hesitate to start using it already!
More information on the migration process can be found online.14 January 2022 at 21:33 #21403Times
BlockedHey @Hugo,
Thanks!Regarding the forum migration, interesting move. Does this mean that in the future, users will be unable to ask questions on the SOFA Forum?
17 January 2022 at 08:46 #21404Hugo
KeymasterHey @akthetimes
Correct. Starting from this week:
– new registration on the Forum will be prevented and redirected towards GitHub Discussions
– Users will not be able to create new topics
– All admin replies will include the footer your noticedThe issue #2591 has been opened for you to follow the migration process.
Any feedback is most welcome.
Best wishes,Hugo
—
NOTE: we are now moving the forum to GitHub Discussions. Do not hesitate to start using it already!
More information on the migration process can be found online.17 January 2022 at 12:27 #21407Times
BlockedI see. For what it’s worth, I think it’s a good move
-
AuthorPosts
- You must be logged in to reply to this topic.