Home › Forum › SOFA › Programming with SOFA › Need Help With the Rigidify function from stlib.physics.mixedmaterial
Tagged: 64_bits, Linux_ubuntu, Plugin_SoftRobots, rigidify, SOFA, SOFA_2006, SoftRobot, STlib
- This topic has 1 reply, 2 voices, and was last updated 4 years, 1 month ago by Hugo.
-
AuthorPosts
-
19 September 2020 at 01:35 #17184momoBlocked
This question is for anyone who knows this function or @damien-marchaluniv-lille1-fr as he is one of the people listed in the example Header.
So I am very confused on how to use this function, I took a look at rigidification.py but I am still not understanding how groupIndices and Frames parameters are used in that function.
This is what I am trying to do:
As you can see there is the middle cylinder which is the backbone of the robot and that should be elastic but I want all the disks around that cylinder to be rigid.
I made a FixedBox around one of the disks to test out the coordinates but I am not sure how to transfer that over to the Rigidify function.
FixedBox(eobject, doVisualization=True, atPositions=[-40,13,40,40,7,-40])
So I guess my question is how do I use groupIndices and Frames parameters to specify that I want the rigid part to be that box’s coordinates?
Here is the format of the rigidify function:
# Rigidification of the elasticobject for given indices with given frameOrientations. o = Rigidify(arm, eobject, name="RigidifiedStructure", frames=[[0., 0., 0]], groupIndices=[[-40,13,40,40,7,-40]])
5 October 2020 at 22:09 #17278HugoKeymasterHi @momo2000
Have you taken a look at the comment on the function:
def Rigidify(targetObject, sourceObject, groupIndices, frames=None, name=None, frameOrientation=None): """ Transform a deformable object into a mixed one containing both rigid and deformable parts. :param targetObject: parent node where to attach the final object. :param sourceObject: node containing the deformable object. The object should be following the ElasticMaterialObject template. :param list groupIndices: array of array indices to rigidify. The length of the array should be equal to the number of rigid component. :param list frames: array of frames. The length of the array should be equal to the number of rigid component. The orientation are given in eulerAngles (in degree) by passing three values or using a quaternion by passing four values. [[rx,ry,rz], [qx,qy,qz,w]] User can also specify the position of the frame by passing six values (position and orientation in degree) or seven values (position and quaternion). [[x,y,z,rx,ry,rz], [x,y,z,qx,qy,qz,w]] If the position is not specified, the position of the rigids will be the barycenter of the region to rigidify. :param str name: specify the name of the Rigidified object, is none provided use the name of the SOurceObject. """
Rigidification is a numerical technique defining one or several rigid frames in your deformable object, in order to make your object locally more rigid. You can also find an example in SOFA: examples/Components/animationloop/MechanicalMatrixMapper.pyscn
The field frame should therefore contain the quaternions corresponding to the rigid frames while the group of indices are the indices of your deformable model impacted by these frames, the “rigidified” nodes.
I hope this helps.
BestHugo
-
AuthorPosts
- You must be logged in to reply to this topic.