6 June 2017 at 21 h 37 min #9282
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, c.point, distance, index1, index2, c.point, c.point)” for creating the contact of bilateral constraint.
What could be the cause of my problem?
Thanks in advance!
–Ruiliang6 June 2017 at 21 h 53 min #9283
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 🙁
Hugo6 June 2017 at 22 h 45 min #9284
Thank 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 4 h 25 min #9287
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 h 40 min #9293
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, c.point, distance, index1, index2, c.point, c.point);12 June 2017 at 22 h 10 min #9321
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 h 07 min #9338
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.
- You must be logged in to reply to this topic.