Home › Forum › SOFA › Using SOFA › auto-resetting problem when doing grasp using BilateralInteractionConstraint
Tagged: 64_bits, SOFA_1608, Windows_10
- This topic has 6 replies, 2 voices, and was last updated 7 years, 5 months ago by Hugo.
-
AuthorPosts
-
6 June 2017 at 21:37 #9282ruiliangBlocked
Hi all,
I have noticed a bug of grasping when i use two haptic devices. Look at the attached video :https://www.dropbox.com/s/9xeo9vsk0vj2p91/biliterial.avi?dl=0
We use BilateralInteractionConstraint for the grasping implementation, and it works pretty good with one haptic device. But every time when the second haptic collide with any model, the bilateral constraint between the first haptic and the organ seems to be reset(see the behavior of green lines in the video). To debug, I tried printing out the indexes of the two collision models related to the first haptic at every frame. The result shows the indexes are always fixed once the constraint is created, which indicates the collision happened with second haptic doesn’t interfere with the contacts of the first haptic.
In our grasp implementation, we use “addContact(c.normal, c.point[0], c.point[1], distance, index1, index2, c.point[0], c.point[1])” for creating the contact of bilateral constraint.
What could be the cause of my problem?
Thanks in advance!–Ruiliang
6 June 2017 at 21:53 #9283HugoKeymasterHi Ruilang,
That’s very strange indeed. I never used two haptic interfaces in the same time. Maybe other users did .. otherwise you could later on (if no reply) point this out on GitHub. Sorry not to be able to help more 🙁
Hugo
6 June 2017 at 22:45 #9284ruiliangBlockedThank you Hugo,
Can you tell me where exactly on GitHub I can ask questions?
Also I wonder if someone can confirm that the way i am using bilateral constraint is correct or not?7 June 2017 at 04:25 #9287HugoKeymasterHi,
Could you maybe provide us a part of your scene that displays your use of the BilateralConstraint ? This might help.
7 June 2017 at 22:40 #9293ruiliangBlockedHi Hugo,
It is not displayed in the xml. We use it in our plugin to implement the grasping function of haptic device.
We have the following c++ code that relates to BilateralInteractionConstraint in our plugin://Initiate the m_constraints toolState.m_constraints = sofa::core::objectmodel::New<sofa::component::constraintset::BilateralInteractionConstraint<DataTypes> >(mstateCollision1, mstateCollision2); toolState.m_constraints->clear(1); ... //add contact in m_constraints toolState.m_constraints->addContact(c.normal, c.point[0], c.point[1], distance, index1, index2, c.point[0], c.point[1]);
12 June 2017 at 22:10 #9321ruiliangBlockedHi,
It seems the rayleighStiffness of the EulerImplicitSolver has some effects on this problem. If i set the rayleighStiffness of the EulerImplicitSolver to zero, this problem disappears. But no rayleigh damping made the models deform too vividly(reactions too much), which makes me in a dillema.
19 June 2017 at 18:07 #9338HugoKeymasterHi ruiliang
Pretty strange that the numerical damping of the solver impacts your two constraints. Rayleigh damping coefficients are numerical damping and should be zero by default. Removing this damping will therefore make your object “softer”. All you need is to adjust the elasticity to match the expected behaviour.
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.