Home › Forum › SOFA › Using SOFA › [SOLVED] How to construct a grasper scene(with force feedback) ?
Tagged: clamp, force feedback, grasp
- This topic has 13 replies, 2 voices, and was last updated 8 years, 4 months ago by Hugo.
-
AuthorPosts
-
17 May 2015 at 08:46 #3314WongBlocked
Hello everyone,
In our project, we need implement a grasping or clamping function in the simulation and it should involve force feedback. But after a period of consideration, I find that it may be tricky for me. So could anyone provide a relevant example or some hints?
I will appreciate it if anyone can help me.Sincerely,
Wong26 May 2015 at 00:01 #3330HugoKeymasterHi Wong,
You should have a look at the following example:
– applications/plugins/Xitact/examples/XitactGraspingWithForceFeedBack.scnand the code:
– sofa/modules/SofaUserInteraction/GraspingManager.hI would not be able to help you more, I am no haptic expert.
Hope this will help.Cheers,
Hugo
26 May 2015 at 07:24 #3332WongBlockedHello Hugo,
Do you know how to judge whether a collision model collides with another specific collision model and how to fix the position of a collision model relatively to a rigid DOF(the collision model is free initially) in animating by writing code?
Could you give me some further information or point out some examples to reference?
Sincerely,
Wong3 February 2016 at 16:44 #5529HugoKeymasterHi Wong,
First, detecting wheter a model is colliding with another one can be implemented in any component (you can write your own) in the handleEvent function. All you need to do is to detect the CollisionEndEvent, and when the event is detected you check the output of the collision detection (e.g. using collision::NarrowPhaseDetection::DetectionOutputMap). You can find an example of this in modules/SofaValidation/EvalSurfaceDistance.inl. I never did it myself, but I guess from this vector of DetectionOutputMap, it should be possible to detect what models are colliding each other.
To fix any model, you can use the FixedConstraint. This component ensures that the nodal positions do not change. If you fix a rigid node, and that you map a collision model on this node, this will work.
Hope this helps (sorry I am no collision expert).
Best,Hugo
6 June 2016 at 15:30 #7049HugoKeymasterDear Wong,
Did my previous message help you in the development of your grasping scene?
Do you need any further assistance?
With no answer from you, we’ll have to close the thread.Best regards,
Hugo
7 June 2016 at 04:10 #7068WongBlockedHello Hugo,
I did read the code in optitrackGrasping.scn(from Forest’s reply),GraspingManager.h and EvalSurfaceDistance.inl. But I did not have the device so I could not test the examples. What’s more, the GraspingManager did not work and its functionality was limited.
I realized that it was hard for me and I estimated that I would spend large amounts of effort. So I have not done relevant work for a long time. Besides, I also had other work to do.
But I plan to proceed with this wok in next month. Of course I need further assistance because I still do not know how to implement the dynamical relative fixity(not fixed when scene start, but when some event is triggered, fixed).
Thanks for helping me.
Wong
9 June 2016 at 09:52 #7086HugoKeymasterHi Wong,
To obtain such a behavior, the best would be to write your own constraint which would be activated depending on an event.
You can look at the code of FixedConstraint.inl or others.
Then your code should involve/listens to events (mouseclick, or any other) and activate the constraint regarding this event.You can already find documentation about events here.
Would you like us to keep this thread open?
Cheers,Hugo
12 June 2016 at 15:44 #7091WongBlockedHello Hugo,
I certainly know how to use the events mechanism in SOFA.
My focus is how to implement the constraint.In my scene, I use the BilateralInteractionConstraint to fix the position of the torus relative to the lower part of the tool.
But I also have the problem like “the constraint do not fix”. The relative displacement of the torus still will occur.
The package file is as follows:
https://www.dropbox.com/s/hm1pejsow5aqkxf/test3.zip?dl=0Why could this be?
Wong
28 June 2016 at 18:35 #7174HugoKeymasterDear Wong,
Could you please tell me what is your configuration so that I can try to reproduce your issue ?
OS: Windows, Linux, MacOS ?
version of SOFA : v15.12 ?For me the simulation seems to run properly and the torus is well constrained with the lower part of the tool.
If you have also a video of your problem, do not hesitate to share it.Cheers,
Hugo
29 June 2016 at 08:02 #7180WongBlockedHello Hugo,
My OS is Windows and the version of SOFA is two years ago(0b4eb1a15733b234d5df07d4fa74d50ad686ebbe).
But when I use another SOFA with version v15.12(4ec83a523e81bd7d7a1ce789a7e6045a43c95884), the problem still arises.
video link:
https://www.dropbox.com/s/rj9nti2kkyex6jm/problem.avi?dl=0Wong
29 June 2016 at 15:28 #7181HugoKeymasterJust to understand,
You got a tool with a jaw, right ? articulated.
But, why should the torus exactly be constrained?I got the same behavior as yours.
But would the unstability of the jaw be due to the fact that the torus becomes both:- in contact the upper jaw
- and constrained with the lower jaw ?
Then, the system becomes unstable.
Would that be possible (and therefore not directly due to BilateralInteractionConstraint) ?
Thanks.Hugo
30 June 2016 at 16:30 #7182WongBlockedHello Hugo,
My scene is just a test example because I think the .scn scene can be conveniently and quickly constructed. I certainly want to constrain the torus at some moment but it would make me write code.
Of course my scene will lead to instability. But I just want to test if the BilateralInteractionConstraint effects. Otherwise I really do not know how to construct my grasping scene with constraint component. I think even though the scene is unstable, the constraint component should still constrain the object.
And I have read the code of BilateralInteractionConstraint but I cannot understand. So I do not know how to do next.
Wong
20 July 2016 at 12:13 #7218WongBlockedHello,
I modified two parameters,alarmDistanceandcontactDistance of the component LocalMinDistance,respectively into 0.08 and 0.04.Then the simulation became better.
20 July 2016 at 14:00 #7222HugoKeymasterHi Wong,
Do you need any further assistance?
Best wishes,Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.