Forum Replies Created
-
AuthorPosts
-
NguyenBlocked
something like this:
<EulerImplicit name="cg odesolver" printLog="false" rayleighStiffness="0.01" rayleighMass="1"/> <CGLinearSolver iterations="100" name="linear solver" threshold="1e-20" tolerance="1e-20" /> <MechanicalObject template="Rigid3d" name="instrumentState" position="10 10 10 0 0 0 1 10 10 10 0 0 0 1 10 10 10 0 0 0 1 10 10 10 0 0 0 1" free_position="10 10 10 0 0 0 1 10 10 10 0 0 0 1 10 10 10 0 0 0 1 10 10 10 0 0 0 1"/> <UniformMass template="Rigid3d" name="mass" totalmass="0.1" /> <LCPForceFeedback activate="true" tags="Omni1" forceCoef="0.5" />
NguyenBlockedI know this problem.
You have to set free_position in the MechanicalObject in your scene file. This MechanicaObject is mapped to your haptic via tagging i.e. using the same tag as OmniDriver.
In old version, sofa initialize free_position for you, now it doesnt.
NguyenBlockedI made a mistake. It’s addContact, not createContact.
Now, I solved the problem. The solution is to use GenericSolver (or similar name) instead of LCPSolver. The interesting thing is when I create a scene with BilateralInteractionConstraint statically, it works with LCPSolver but does not work dynamically i.e. added and removed by C++ code. I guess, LCPSolver needs to be refreshed whenever constraints are changed.
By the way, could you explain for me the differences between Generic and LCP ?
Thanks a lot !
NguyenBlockedHi Hugo,
Thank you for your kind support.
Now, I can create the BilateralInteractionConstraint. I follow the code in the class StickContactConstraint. However, I sill have a problem that the haptic tool tip is not sticked to the object even though there is a interaction. What I dont understand is the function createContact in the class BilateralInteractionConstraint with many parameters and I dont understand the meaning of some parameters.
I am wondering if the BilateralInteractionConstraint only works with RigidMapping and IdentityMapping and does not work with BarycentricMapping ?
Any help is so much appreciated !
Thanks,
Thien.NguyenBlockedThank you all,
I was succeeded in creating a spring between the haptic tool and the collided point on the object. I used ContactMapper to create MechanicalState, then create a spring, then add the spring to the corresponding MechanicalState.
Now, instead of creating the spring, I create the BilateralInteractionConstraint, but it doesnt work.
NguyenBlockedI commented out the part that extracts quad mesh from hex mesh, then the scene worked fine and I can visualize force-field.
I am using old version (last year) of SOFA.
NguyenBlockedI have just modified the caduceus scene file by replace the snake by my object with some fixed points. I pull the object by mouse. When my object moves through the cylinder, i.e. collision resolve is failed, then some fixed points start floating around.
-
AuthorPosts