Forum Replies Created
-
AuthorPosts
-
bttBlocked
Hi @hugo, @nicklj,
I am interested in this topic as well, I also want to extract the force generated by collision as pressure on contact area. I followed all related post in forum especially this one. From Sofa documentation, I understand the principle of Lagrange-multiplier based method is to create forces on two objects potentially in contact to create constraint (in this case is a non-holonomic constraint)between them. However, I have been struggling in either extraction of the vector of lambda or computing contact pressure as guided in this. Could anyone give me a little more detail regarding this procedure? or any other clarification would be appreciated.
Furthermore, I have the following questions:
1. let say constraint number 0 1 2 impact on node 550 1 55 -0.172748 0.984895 0.0118137 1 1 55 -0.0161293 -0.0148211 0.99976 2 1 55 0.984834 0.172516 0.018446
then the total resulting force, so called Fs[55], generated from collision (in x y z) on node 55 will be the summation of those calculated from constraint 0, 1, 2 right?
2. Secondly, the term F in the equation p=F/S is the summation of all contact forces Fs[i], where i are the impacted nodes, generated in contact area, is it right?
Thank you for any help
best regardsbttBlockedThank you @nicklj for the explanation, I did exactly what you described above however calculated values for reaction forces seem unreliable (too big). For example, the constraint from the collision model for node 8 is:
9 1 8 0.969057 -0.104965 -0.223409 10 1 8 0.0651265 0.981735 -0.17876 11 1 8 0.238092 0.158679 0.958193 ... 15 1 8 0.971997 0.0886831 -0.217617 16 1 8 -0.0778631 0.995286 0.0578188 17 1 8 0.221718 -0.0392554 0.97432
Lambda values for row number 9 to 11 are:
[11293731.263678096], [-1448629.6310082236], [4136659.638746046]
whereas, those for row number 15 to 17 are zeros. Then the force for node 8 is
F = (constraint[9]*lamda[9]+constraint[10]*lamda[10]+constraint[10]*lamda[10])=[1.1835 -0.1951 0.1700] *10^7
The unit system i used is: mm, tonne, N
Even when I multiply this value with time step dt = 0.01 as indicated in sofa documentation, the final values are still unbelievably large. Do you have any comments on this issue? Or any other help will also be appreciated.
bestbttBlockedhi @hugo, @nhnhan
Interested as well. So far, I can export either lambda in constraint solver and constraint forces, let call it f, in the collision model by using sofapython. I presume the contact force at a node will be equal to dt*lambda*f. But I also feel confused with the @hugo comment as well:F_collis[58] += Deriv( 0.487691 -0.305337 0.146266) * lambda[9] F_collis[59] += Deriv( 0.333767 -0.208967 0.100102) * lambda[9]
Could you please clarify this in more detail? It is very interesting to me but I have been struggled for weeks to really understand that. Thank you
bestbttBlockedHi @hugo, @nicklj,
Sorry but my comment is somehow disappeared eventhough I got reported from email that comment has been successfully summitted. I am interested in this topic as well. However, I have been struggling in either extraction of the vector of lambda or computing contact pressure as guided in thisCould anyone give me a little more detail regarding this procedure? or any other clarification would be appreciated.
Furthermore, I have the following questions:
1. let say constraint number 0 1 2 impact on node 55 then the total resulting force, so-called Fs[55], generated from collision (in x y z) on node 55 will be the summation of those calculated from constraint 0, 1, 2 right?
2. Secondly, the term F in the equation p=F/S is the summation of all contact forces Fs[i], where i are the impacted nodes, generated in the contact area, is it right?
Thank you for any help
best regardsbttBlockedHi @Scheikl, it is successfully added in SOFA scene. Now I am curious how to extract contact information by using python. I open up the property table of this component and see nothing (it seems wrong). Thank you for your patient.
best
bttbttBlockedHi @Scheikl, in fact, I did it already but nothing changed :). I tried to play around with this component for the last couple of days but it is still not successful :D.
bttBlockedHi @Scheikl, I did follow your construction but the same error has appeared. Hope you have another idea. Anyway, I appreciate your kind support.
Best regards,
NhanbttBlockedThank you @scheikl for following up my problem, the general structure of my scene is shown below:
def createScene(rootNode): ... # Finger node finger = rootNode.createChild('finger') #collision collisionFinger = finger.createChild('collisionFinger') collisionFinger.createObject('MeshTopology', src='@loader', name='topo') collisionFinger.createObject('MechanicalObject', name='collisMech') collisionFinger.createObject('TriangleCollisionModel', name = 'triangle', selfCollision=0) collisionFinger.createObject('LineCollisionModel', name = 'line', selfCollision=False) collisionFinger.createObject('PointCollisionModel', name = 'point', selfCollision=False) # Skin node skin = rootNode.createChild('skin') # Collision skinCollision = skin.createChild('SkinCollision') skinCollision.createObject('MeshTopology', src='@loader', name='topology') skinCollision.createObject('MechanicalObject', name='collisMech') skinCollision.createObject('TriangleCollisionModel', name = 'triangle', selfCollision=0) skinCollision.createObject('LineCollisionModel', name = 'line', selfCollision=0) skinCollision.createObject('PointCollisionModel', name = 'point', selfCollision=0) # Contact listener contactlistener = rootNode.createChild('contactlistener') contactlistener.createObject('ContactListener', collisionModel1 = '@skin.SkinCollision', collisionModel2 = '@finger.collisionFinger')
However, an error message popped up when I loaded this scene:
[ERROR] [DAGNode(contactlistener)] Parsing Link "@skin.SkinCollision": a Data field name is specified while an object was expected. [ERROR] [DAGNode(contactlistener)] Parsing Link "@finger.collisionFinger": a Data field name is specified while an object was expected. [ERROR] [PythonScript] RuntimeError: Unable to create 'ContactListener' of type 'ContactListener' in node 'contactlistener'. Object type ContactListener<> was not created The object is in the factory but cannot be created. Requested template : None Used template : None Reason(s) : Data attributes 'collisionModel1' and 'collisionModel2' are not pointing to valid collision models.
It seems I did not set the paths for two propoerties ‘collisionModel1’ and ‘collisionModel2’. Could you (or any other suggestion will be appreciated) please point out what I did wrong? Thank you very much
Best regards,
bttbttBlockedThank you @scheikl, my simulation is built up using python2. So, it would be more convenient for me if your code can be converted to python2. I tried with this line but not success:
contactlistener.createObject('ContactListener', collisionModel1 = '@SkinCollision.LineCollisionModel', collisionModel2 = '@collisionFinger.LineCollisionModel')
bttBlockedDear @hugo, @tschuelia
I tried to add ContactListener to my scene but It seems unproperly constructed. Could you please share the line of code to add this component?
I use sofapython to build up simulation model. Thank you for any help
BestbttBlockedHi @hugo,
It is glad to hear your effort to help us. I do managed to install SofaCV by include the DataFilename.h as you suggested in here. I will try to create a PR regarding this issue later on.
In case of Imageprocessing plugin, you can find the most common types of error messages below:
`/home/btt/Desktop/sofa/src-master/SofaKernel/modules/SofaHelper/compat/sofa/core/visual/DrawToolGL.h:32:2: error: #error “OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include <sofa/gl/DrawToolGL.h> instead of this one.”
#error “OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include <sofa/gl/DrawToolGL.h> instead of this one.”
/home/btt/Desktop/ExtPlugins/ImageProcessing/src/ImageProcessing/camera/common/CameraSettings.h:14:10: fatal error: sofa/gl/template.h: No such file or directory
#include <sofa/gl/template.h>
/home/btt/Desktop/sofa/src-master/SofaKernel/modules/SofaHelper/compat/sofa/helper/gl/Transformation.h:28:13: warning: “Transformation has been stripped of its OpenGL code, use sofa::gl::TransformationGL if you need its OpenGL implementation.”
SOFA_PRAGMA_WARNING(“Transformation has been stripped of its OpenGL code, use sofa::gl::TransformationGL if you need its OpenGL implementation.”)These errors occurs to many files along with many warning regarding header. I have tried to link library of Open.GL as recommended in PR#1649 , but it did not work. Hope to see your attempt’s results. Thank you again for your great support
best,bttBlockedDear @amendiza,
I am very interested in your team’s plugins (SOFACV and imageprocessing). So far, I have successfully compiled Sofacv with SOFA but it is not the case for Imageprocessing plugin. It seems due to the fact that this plugin is no longer compatible with current sofa versions (I suppose). I have tried with v19, v20.06, v20.12 and master branch but not quite successful. I just wonder your team would have a plan to update such plugin (and also sofacv) to be more compatible with SOFA? It would be great if there are such things and I would love to play with them soon. Thank you for your wonderful works anyway and looking forward to your reply soon
best,bttBlockedHi @hugo,
Thank you for your help, I have managed to compile this plugin. So I will mark this topic as solved.
Best,
bttbttBlockedDear @bmarques,
I have successfully compiled SofaCV with Sofa, but things seem even rougher with Imageprocessing plugin. When I activated ninja, many fatal errors popped up and it seems this plugin is no longer compatible with the current versions of SOFA (I tried v19, v20.06 and master branch). I just wonder is there any update in the coding of this plugin to make it more compatible with the current version of SOFA? It would be great if you could update it. Anyway, thank you for your wonderful works and I can wait to play with it.
Best regards,
btt -
AuthorPosts