Home › Forum › SOFA › Getting Started › Simulating contracting actuator
Tagged: 64_bits, SOFA_2006, Windows_10
- This topic has 7 replies, 2 voices, and was last updated 3 years, 10 months ago by Andrija.
-
AuthorPosts
-
4 December 2020 at 09:28 #17819AndrijaBlocked
Hi everyone,
I am a bit new in SOFA, and hope you could help me out.
I am trying to simulate simple spring like contracting actuator for my University project. The actuator can be in form of a simple axial spring, or similar. But I have some specific requirements. The actuator needs to be attached on both ends to the two planes or cubes, or some other geometry, this does not matter. Then the actuator needs to be elastic in only its axical direction, and have large stiffens in other directions, in other words, something like heaving a spring that has small stiffness in axial direction and large stiffness in other directions. So that at the end when I apply ‘LinearForceFiled’ on both ends of the actuator/spring, the two attached planes(cubes, or what ever), will start to approach each other and realize only axical movement in direction of spring.
In general the setup above would be a part of system where I would translate the whole system in different directions, meaning like this system would carry the actuator and two planes. You can imagine like the actuator with two planes is on top of some bigger cube, where I could move/translate the cube in different directions, thus normally the whole setup above would move with it.
I can explain in more detail the second part, if you can help me out first to solve the first part of the problem. I have tried to illustrate what I am trying to do in image below.
I know how to setup a general scene, import models, set solvers apply the LinearForceFiled, and general basic things in SOFA. But I have been struggling to solve the problem I explain above, for two weeks and no luck.
I am using Python based description of a scene.
I hope you can help out. I would be grateful for any ideas and thoughts.
Many thanks!
Best,
Andrija18 December 2020 at 22:32 #18056HugoKeymasterHey @andrija987
I have a hard time to understand what you are aiming at.
Do you have any literature, image, scheme of the setup you want to simulate ?Sorry about it.
Looking forward to reading more about your project.Best wishes,
Hugo
5 January 2021 at 13:19 #18107AndrijaBlockedHey @hugo!
Many thanks for your reply and please sorry for my slow response, but I was on a holiday the past two weeks.
First I want to say my big congrats for the SOFA! It is really an amazing tool and nothing I had the chance to work with before. Truly impressive simulation tool, and many thanks for making it possible and open source for the community! Really appreciate it.
About my questions. Sorry for not being more clear. I will try to explain better. I am trying to simulate simple linear actuator, where this actuator would be attached to a robot body. Further this robot body would “carry” the actuator on its top, meaning that the actuator would realize linear translation in axial direction, relative to a robot body but would globally move with the whole robot in space, as robot carries it. I would apply
LinearForceField
to the actuator or maybe input displacement to realize motion of the actuator i.e. simulate its input force or input displacement (both would work for my case). Here is link to a pdf where I illustrated what I am trying to do:https://drive.google.com/file/d/1DnT40U2oJecc5ph3IwjWj1-986yFUS-_/view?usp=sharing
To explain further. The linear actuator is attached on both ends to two input ports that are part of the robot mechanism/body (not so important maybe). Maybe I didn’t illustrate it good but hope you will got the point.
In essence I am trying to simulate linear actuator and just attach this linear actuator to my robot system to actuate it, where normally actuator can only realize linear axial translation, as any linear actuator do. But the things get complicated as I actually need actuator to behave like a spring that would be elastic in only its axial direction but have infinite stiffens in other directions or that the motion of the spring is constrained in all other directions except axial direction.
Also the two input ports to which the actuator is attached on its ends are model not as rigid objects but as
MechanicalObject
withtemplate="Vec3d"
.I have been struggling with this over a month, and still I don’t know how to do it. I first tried to place a simple spring between my two input ports by attach it to two indices of the input ports. Then I applied
LinearForceField
to both ends of the spring to actuate the input ports, but normally as the spring is “free” in all directions it realizes not only axial motion but also some motion in other directions, which is not desirable in my case. I also tired to usePartialLinearMovementConstraint
between the two input ports, and this worked. But then as the two input ports are part of the overall robot body, this constrained the motion of the whole robot globally. I also triedOscillatorConstraint
, this worked but again somehow my robot motion globally is constrained due to Oscialltor being applied to one indecies. Further I also tried using Articulations which should work, but as my input ports are modeled with “Vec3d” somehow I am having problems with this one as Aritculations are modeled withtemplate="Rigid3d"
, I can share my code if you believe that Articulations are the way to go.
Currently I am trying to figure our things using theSlidingConstraint
between my two input ports, but I don’t know again if this would work out as again the whole robot motion could be constrained as two input ports are part of a robot.I would really much appreciate for any help!!! I am really struggling with this one to make it work.
Many thanks!
Best,
Andrija14 January 2021 at 10:12 #18213HugoKeymasterHey @andrija987
Thanks for the explanation and mostly the drawing it helps understanding.
On your scheme, which part(blue/red/green) is rigid which is deformable?From what I got blue is deformable, red is a spring along the axis between the two ports and the ports are rigid. Is that correct?
Best
Hugo
14 January 2021 at 14:37 #18223AndrijaBlockedHey @hugo,
Thanks again for the reply. I know that you must be very busy with all ongoing things, and thanks for still wanting to help out.
To reply to your questions and further clarify things.
In the drawing, the red part along the axis is a spring like element, the two green input ports are deformable bodies, and the blue part (what I call robot body) is actually deformable body as well. So basically read part is a spring like element, all other parts are deformable bodies.
But to provide more in depth explanation. At the moment the bottom blue part is maybe not so important, as I would know how to connect my two green input ports to a blue part. We can pose the issue I am having like this. How to simulate a linear contracting actuator between my two green input ports so when I apply the force in axial direction, the actuator would move my two input ports only in axial direction, thus acting as a linear actuator for my system, where the actuator is in a form of a spring element (for example). Further the two input ports with my linear actuator could move globally in space (for example could freely move on some floor) – meaning that linear actuator/spring element can realize only linear axial motion relative to two input ports (green parts) but can globally move in space.
I posted some other specific questions regarding my issue in another topic, that I closed now as we could not find solution for this. But there @scheikl proposed that maybe using
ArticulatedSystemMapping
could help. But what I don’t know is how to use this between two deformable bodies. Below is a code of my initial scene. And you can download the meshes here:https://drive.google.com/drive/folders/1rCwFsuc9sYQZy3WmxnlZRbrnRGopb3mT?usp=sharing
Code:
# Simulating contracting actuator import Sofa import os from stlib.scene import MainHeader, ContactHeader # Defining a scene def createScene(rootNode): # Inicilaize disply rootNode.createObject('VisualStyle', displayFlags='showForceFields showBehaviorModels showBehavior') # Required plugins rootNode.createObject('RequiredPlugin', name='soft', pluginName='SoftRobots') rootNode.createObject('RequiredPlugin', name='SofaPython', pluginName='SofaPython') rootNode.createObject('RequiredPlugin', name='OpenVis', pluginName='SofaOpenglVisual') # Animation loops # rootNode.createObject('FreeMotionAnimationLoop') # Constrain solver rootNode.createObject('GenericConstraintSolver', tolerance="1e-12", maxIterations="100000") # Input port 1 Input_port1 = rootNode.createChild('Input_port1') Input_port1.createObject('EulerImplicit', name='odesolver') Input_port1.createObject('SparseLDLSolver', name='directSolver') Input_port1.createObject('MeshGmshLoader', name='loader', filename='mesh\CubeBlock.msh') Input_port1.createObject('Mesh', src='@loader', name='container') Input_port1.createObject('MechanicalObject', name='tetras', template='Vec3d', showObject='true', showObjectScale='1') Input_port1.createObject('TetrahedronFEMForceField', template='Vec3d', name='FEM', method='large', poissonRatio='0.4', youngModulus='8000', drawAsEdges="true") Input_port1.createObject('UniformMass', totalMass='0.1') # Adding supports Input_port1.createObject('BoxROI', name='boxROI', box='10 5 4 16 22 -3', drawBoxes='true') Input_port1.createObject('RestShapeSpringsForceField', points='@boxROI.indices', stiffness='1e12', angularStiffness='1e12') # Visualization modelVisu1 = Input_port1.createChild('visu1') modelVisu1.createObject('MeshSTLLoader', name="loader", filename="mesh\CubeBlock.stl") modelVisu1.createObject('OglModel', src="@loader", template='ExtVec3f', color='0.7 0.7 0.7 0.6') modelVisu1.createObject('BarycentricMapping') #Input_port1.createObject('LinearSolverConstraintCorrection', solverName='directSolver') Input_port1.createObject('UncoupledConstraintCorrection') # Input port 2 Input_port2 = Input_port1.createChild('Input_port2') Input_port2.createObject('EulerImplicit', name='odesolver') Input_port2.createObject('SparseLDLSolver', name='directSolver') Input_port2.createObject('MeshGmshLoader', name='loader2', filename='mesh\CubeBlock.msh', translation=[0.0, 0.0, 20.0]) Input_port2.createObject('Mesh', src='@loader2', name='container2') Input_port2.createObject('MechanicalObject', name='tetras2', template='Vec3d', showObject='true', showObjectScale='1') Input_port2.createObject('TetrahedronFEMForceField', template='Vec3d', name='FEM', method='large', poissonRatio='0.4', youngModulus='8000', drawAsEdges="true") Input_port2.createObject('UniformMass', totalMass='0.1') # Adding supports Input_port2.createObject('BoxROI', name='boxROI2', box='10 5 25 16 22 18', drawBoxes='true') Input_port2.createObject('RestShapeSpringsForceField', points='@boxROI2.indices', stiffness='1e12', angularStiffness='1e12') # Visualization modelVisu2 = Input_port2.createChild('visu2') modelVisu2.createObject('MeshSTLLoader', name="loader", filename="mesh\CubeBlock.stl", translation=[0.0, 0.0, 20.0]) modelVisu2.createObject('OglModel', src="@loader", template='ExtVec3f', color='0.7 0.7 0.7 0.6') modelVisu2.createObject('BarycentricMapping') #Input_port1.createObject('LinearSolverConstraintCorrection', solverName='directSolver') Input_port2.createObject('UncoupledConstraintCorrection') # Creating connecting point for Input port 1 - Rigid body pointCon1 = Input_port1.createChild('pointCon1') pointCon1.createObject('MechanicalObject', name="DOFpoint1", template="Rigid3d", position="19 16 5 0 0 0 0") pointCon1.createObject('BarycentricMapping') # Creating connecting point for Input port 2 - Rigid body pointCon2 = Input_port2.createChild('pointCon2') pointCon2.createObject('MechanicalObject', name="DOFpoint2", template="Rigid3d", position="19 16 17 0 0 0 0") pointCon2.createObject('BarycentricMapping')
What I basically setup above are two prismatic deformable objects that represent my two input ports. In general these two input ports will belong to one overall body/system, but this is not important for the current thing I am trying to solve i.e. am asking help. Temporally I fixed the two input ports, but this is just so that they don’t fly away before setting the full scene i.e. placing the blue par (robot body), the floor and adding collisions. I added two points that represent Rigid body –
Rigid3d
and they are connected to my input ports withBarycentricMapping
. If theArticulatedSystemMapping
is the solution to the a problem I wrote above, the question is how I can set theArticulatedSystemMapping
between my two input ports, so that they do what I write above.I would really appreciate for help, as I am struggling with this for a while and could not find a solution.
Many thanks!
Best regards,
Andrija4 February 2021 at 16:09 #18499HugoKeymasterHey @andrija987
Your approach defining the two input ports as belonging to one overall body/system looks fine to me. Your question here seems more focused on how to define this “spring like” actuator.
Not being a robotic expert makes me unsure of the best approach to follow. I saw some examples of Cable-like constraints in Softrobot.
A documentation page about the CableConstraint and a doc/tutorial shows how to use itWould this fit your need?
If not, we can organize a joint chat about the topic.
Best wishes,Hugo
5 February 2021 at 08:45 #18511AndrijaBlockedHi @hugo,
Many thanks for your reply. I am still struggling with this one and I literary tried so many things. I think also it is a bit hard to explain like this without showing what is the problem. But let me try.
Yes you are right, the question is now how to define a spring like element that would be attacked to both input ports, so that when I apply for example
LinearForceField
at both ends, the input ports would move only in axial direction i.e. direction of spring element? The system should behave so like the spring has infinity stiffness in all directions except the axial direction. And keeping in mind that my two input ports can globally move within the work space, meaning that usingPartialFixedConstraint
would not work, as it would constrain the spring globally.I tried using the Cable but this will not do for my system as when I use it I get some undesired motion of input ports in other directions, beside the axial motion. But since I last posted this problem I tried many things. @scheikl proposed to use
ArticulatedSystemMapping
and I tired this as well. See the code below. What I did is I made the Articulation between my two input ports, where now when I apply displacement or force at the articulations it moves only in axial direction and the whole articulation system can move globally with the two input ports. Disregard that for the time being one input port is fixed (this is just so that the system don’t fly away as I didn’t yet put floor, not to complicate the scene at this stage), and also disregard that for the left input port, articulation base point is placed at the attached point of the input port. You will see in the code. But the problem here is when I tired to attach the other end of the articulation system to the right input port. This is not working. I tried to attach them by creating a connecting point at my Input port 2 in formMechanicalObject
,Rigid3d
then mapping this withBarycentricMapping
. Then I tired to connect this point with the articulation system, by using:
AttachConstraint
– this does not work properly for some reason, the Input port 2 can freely move in space, like it is connected with very weak spring to the articulation. And I tired usingtwoWay
nothing happens.
StiffSpringForceField
– this does not exactly connect them as there is some undesired motion, feel free to see. The input is attached to articualtion but it can rotate around connecting point.
RestShapeSpringsForceField
– the same like above.I know that
BilateralInteractionConstraint
would in general work for connecting these, but for some reason this does not work in my scene as it is required to useFreeMotionAnimationLoop
which when I use, then theArticulatedSystemMapping
does not work. You can try and see.In general, for me it would work as well if there is a way to somehow constrain the motion for example of my pointCon2, so that it can move only linearly in one direction (axial direction), but in such way that this constrain applies only to this point but you can normally golobaly move my two input ports. I tried applying
PartialFixedConstraint
andLinearMovementConstraint
to this point, but it does not work at all for some reason as pointCon2 is mapped to my Input_port2. When I remove mapping then normally all works. Maybe based on all this you will have more ideas.It would be great if you are open for a chat!!! That would be super helpful! Then I can share a couple of more things about my project what we are tying to do. I am a postdoc from LUT University in Finland. I know that you must be very busy but if you think it is possible to find the time to have a chat, feel free to write me! Don’t know how to reach you out?
Here is the code:
# Simulating contracting actuator import Sofa import os from stlib.scene import MainHeader, ContactHeader # Defining a scene def createScene(rootNode): # Inicilaize disply rootNode.createObject('VisualStyle', displayFlags='showForceFields showBehaviorModels showBehavior') # Required plugins rootNode.createObject('RequiredPlugin', name='soft', pluginName='SoftRobots') rootNode.createObject('RequiredPlugin', name='SofaPython', pluginName='SofaPython') rootNode.createObject('RequiredPlugin', name='OpenVis', pluginName='SofaOpenglVisual') # Animation loops # rootNode.createObject('FreeMotionAnimationLoop') # Constrain solver rootNode.createObject('GenericConstraintSolver', tolerance="1e-12", maxIterations="100000") # Input port 1 Input_port1 = rootNode.createChild('Input_port1') Input_port1.createObject('EulerImplicit', name='odesolver') Input_port1.createObject('SparseLDLSolver', name='directSolver') Input_port1.createObject('MeshGmshLoader', name='loader', filename='mesh\\CubeBlock.msh', rotation = [0, 90, 0], translation = [0, -10, 25]) Input_port1.createObject('Mesh', src='@loader', name='container') Input_port1.createObject('MechanicalObject', name='tetras', template='Vec3d', showObject='true', showObjectScale='1') Input_port1.createObject('TetrahedronFEMForceField', template='Vec3d', name='FEM', method='large', poissonRatio='0.4', youngModulus='8000', drawAsEdges="true") Input_port1.createObject('UniformMass', totalMass='0.1') # Adding supports Input_port1.createObject('BoxROI', name='boxROI', box='-5 0 -1 5 20 3', drawBoxes='true') Input_port1.createObject('RestShapeSpringsForceField', points='@boxROI.indices', stiffness='1e12', angularStiffness='1e12') # Visualization modelVisu1 = Input_port1.createChild('visu1') modelVisu1.createObject('MeshSTLLoader', name="loader", filename="mesh\\CubeBlock.stl", rotation = [0, 90, 0], translation = [0, -10, 25]) modelVisu1.createObject('OglModel', src="@loader", template='ExtVec3f', color='0.7 0.7 0.7 0.6') modelVisu1.createObject('BarycentricMapping') #Input_port1.createObject('LinearSolverConstraintCorrection', solverName='directSolver') Input_port1.createObject('UncoupledConstraintCorrection') # Input port 2 Input_port2 = Input_port1.createChild('Input_port2') Input_port2.createObject('EulerImplicit', name='odesolver') Input_port2.createObject('SparseLDLSolver', name='directSolver') Input_port2.createObject('MeshGmshLoader', name='loader2', filename='mesh\\CubeBlock.msh', rotation = [0, 90, 0], translation = [20, -10, 25]) Input_port2.createObject('Mesh', src='@loader2', name='container2') Input_port2.createObject('MechanicalObject', name='tetras2', template='Vec3d', showObject='true', showObjectScale='1') Input_port2.createObject('TetrahedronFEMForceField', template='Vec3d', name='FEM', method='large', poissonRatio='0.4', youngModulus='8000', drawAsEdges="true") Input_port2.createObject('UniformMass', totalMass='0.1') # # Adding supports # Input_port2.createObject('BoxROI', name='boxROI2', box='20 0 -1 25 20 3', # drawBoxes='true') # Input_port2.createObject('RestShapeSpringsForceField', points='@boxROI2.indices', # stiffness='1e12', angularStiffness='1e12') # Visualization modelVisu2 = Input_port2.createChild('visu2') modelVisu2.createObject('MeshSTLLoader', name="loader", filename="mesh\\CubeBlock.stl", rotation = [0, 90, 0], translation = [20, -10, 25]) modelVisu2.createObject('OglModel', src="@loader", template='ExtVec3f', color='0.7 0.7 0.7 0.6') modelVisu2.createObject('BarycentricMapping') #Input_port1.createObject('LinearSolverConstraintCorrection', solverName='directSolver') Input_port2.createObject('UncoupledConstraintCorrection') # Creating connecting point for Input port 1 - Rigid body pointCon1 = Input_port1.createChild('pointCon1') pointCon1.createObject('MechanicalObject', name="DOFpoint1", template="Rigid3d", position="13 5.5 6 0 0 0 0") pointCon1.createObject('BarycentricMapping') #pointCon1.createObject('BarycentricMapping') #pointCon1.createObject('EulerImplicit', name='odesolver') #pointCon1.createObject('CGLinearSolver', name="linear solver") articulation = rootNode.createChild("articulation") articulation.createObject('EulerImplicit', name='odesolver') articulation.createObject('CGLinearSolver', name="linear solver") articulation.createObject("MechanicalObject", name="Articulations", template="Vec1d", position=[0, 0, 0, 0]) # translation=[19, 16, 5] mechanics = articulation.createChild("Mechanics") mechanics.createObject("MechanicalObject", template="Rigid3d", name="DOFs", position=[ [0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [3, 0, 0, 0, 0, 0, 1], [5, 0, 0, 0, 0, 0, 1], [7, 0, 0, 0, 0, 0, 1] ]) mechanics.createObject("BeamFEMForceField", name="FEM", radius=0.1, youngModulus=10000, poissonRatio=0.45) mechanics.createObject("MeshTopology", name="lines", lines="0 1 1 2 2 3 3 4 ") mechanics.createObject("UniformMass", template="Rigid3d", name="mass", vertexMass="0.1 0.1 [1 0 0,0 1 0,0 0 1]") mechanics.createObject("FixedConstraint", template="Rigid3d", name="fixOrigin", indices=0) mechanics.createObject("ArticulatedSystemMapping", input1=articulation.Articulations.getLinkPath(), input2=pointCon1.DOFpoint1.getLinkPath(), output=mechanics.DOFs.getLinkPath()) # # Defining viusal model Visu = mechanics.createChild('Visu') Visu.createObject('OglModel', name="Visual", position="-1 -0.5 -0.5 -1 0.5 -0.5 -1 0.5 0.5 -1 -0.5 0.5 1 -0.5 -0.5 1 0.5 -0.5 1 0.5 0.5 1 -0.5 0.5 -1 -0.5 -0.5 -1 0.5 -0.5 -1 0.5 0.5 -1 -0.5 0.5 1 -0.5 -0.5 1 0.5 -0.5 1 0.5 0.5 1 -0.5 0.5 -1 -0.5 -0.5 -1 0.5 -0.5 -1 0.5 0.5 -1 -0.5 0.5 1 -0.5 -0.5 1 0.5 -0.5 1 0.5 0.5 1 -0.5 0.5 -1 -0.5 -0.5 -1 0.5 -0.5 -1 0.5 0.5 -1 -0.5 0.5 1 -0.5 -0.5 1 0.5 -0.5 1 0.5 0.5 1 -0.5 0.5", triangles="3 1 0 3 2 1 3 6 2 3 7 6 7 5 6 7 4 5 4 1 5 4 0 1 5 1 2 2 6 5 4 7 3 4 3 0 11 9 8 11 10 9 11 14 10 11 15 14 15 13 14 15 12 13 12 9 13 12 8 9 13 9 10 10 14 13 12 15 11 12 11 8 19 17 16 19 18 17 19 22 18 19 23 22 23 21 22 23 20 21 20 17 21 20 16 17 21 17 18 18 22 21 20 23 19 20 19 16 27 25 24 27 26 25 27 30 26 27 31 30 31 29 30 31 28 29 28 25 29 28 24 25 29 25 26 26 30 29 28 31 27 28 27 24") Visu.createObject('RigidMapping', template="Rigid3d,ExtVec3f", rigidIndexPerPoint="1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4", input="@..", output="@Visual") articulation.createObject("ArticulatedHierarchyContainer") centers = articulation.createChild("articulationCenters") center1 = centers.createChild("center1") center1.createObject("ArticulationCenter", parentIndex=0, childIndex=1, posOnParent=[0, 0, 0], posOnChild=[-1, 0, 0]) rotation1 = center1.createChild("articulations") rotation1.createObject("Articulation", translation=True, rotation=False, translationAxis=[1, 0, 0], articulationIndex=0) center2 = centers.createChild("center2") center2.createObject("ArticulationCenter", parentIndex=1, childIndex=2, posOnParent=[1, 0, 0], posOnChild=[-1, 0, 0], articulationProcess=2) rotation2 = center2.createChild("articulations") rotation2.createObject("Articulation", translation=True, rotation=False, translationAxis=[1, 0, 0], articulationIndex=1) center3 = centers.createChild("center3") center3.createObject("ArticulationCenter", parentIndex=2, childIndex=3, posOnParent=[1, 0, 0], posOnChild=[-1, 0, 0], articulationProcess=0) rotation3 = center3.createChild("articulations") rotation3.createObject("Articulation", translation=True, rotation=False, translationAxis=[1, 0, 0], articulationIndex=2) center4 = centers.createChild("center4") center4.createObject("ArticulationCenter", parentIndex=3, childIndex=4, posOnParent=[1, 0, 0], posOnChild=[-1, 0, 0], articulationProcess=1) rotation4 = center4.createChild("articulations") rotation4.createObject("Articulation", translation=True, rotation=False, translationAxis=[1, 0, 0], articulationIndex=3) # # Creating connecting point for Input port 2 - Rigid body pointCon2 = Input_port2.createChild('pointCon2') pointCon2.createObject('MechanicalObject', name="DOFpoint2", template="Rigid3d", position="20 5.5 6 0 0 0 0") pointCon2.createObject('BarycentricMapping') #articulation.createObject("UncoupledConstraintCorrection") #mechanics.createObject('RestShapeSpringsForceField', stiffness="10000", angularStiffness="1e50", external_rest_shape="@Input_port1/Input_port2/pointCon2", points="4", external_points="0", drawSpring="true", springColor="1 1 1 1") #pointCon2.createObject('RestShapeSpringsForceField', stiffness="500", angularStiffness="1e50", external_rest_shape="@articulation/Mechanics/DOFs", points="0", external_points="4", drawSpring="true", springColor="1 1 1 1") pointCon2.createObject('StiffSpringForceField', object1="@pointCon2/DOFpoint2", object2="@articulation/Mechanics/DOFs", spring="0 4 500 0.0 0.0") #rootNode.createObject('AttachConstraint', object1="@Input_port1/Input_port2", object2="@articulation/Mechanics/DOFs", twoWay="true", radius="0.1", indices1 = "73", indices2 = "4", constraintFactor="1 1")
17 February 2021 at 08:25 #18693AndrijaBlockedHi @hugo,
My problem now is to effectively connect the Articulations with deformable bodies (my input ports). But do you (others) think that using Rigidify to for example transform some nodes of my inputs to rigid nodes (e.g. middle point node of my input ports), and then create Articulations between rigid DoF would help? It seems to me in theory it would work?
Below is a part of code I managed to find from the Triopd tutorial
https://github.com/SofaDefrost/SoftRobots/blob/master/docs/tutorials/Tripod/details/step4-3.pyscnBut this part is a bit hard to read, or impelement in my case since I used different setup of the scene. Any idea how I could adopt it to my scene in my previous comments?
# Rigidify the deformable part at extremity to attach arms rigidifiedstruct = Rigidify(self.node, deformableObject, groupIndices=groupIndices, frames=frames, name="RigidifiedStructure") rigidifiedstruct.DeformableParts.createObject("UncoupledConstraintCorrection") rigidifiedstruct.RigidParts.createObject("UncoupledConstraintCorrection")
I would appreciate any help!
Thanks!
Best,
Andrija -
AuthorPosts
- You must be logged in to reply to this topic.