Home › Forum › SOFA › Using SOFA › Issue using BilateralInteractionConstraint
- This topic has 9 replies, 2 voices, and was last updated 5 years, 7 months ago by
Hugo.
-
AuthorPosts
-
15 November 2018 at 09:07 #12459
Nassim
BlockedHello !
For a Project, I have to create a hopping robot. To do that, the first step has been to create a Soft cylinder. After that, I need to incorporate in this cylinder a muscle, and it’s where the problem start.
I need to combine the mesh of the soft cylinder and the mesh of the muscle. Thanks to that, I want to combine the mechanics and later thanks to a control method, I will be able to control the muscle and then impose a strenght to it to create a hopping movement for the cylinder.So a movement of the muscle must create a movement of the soft cylinder, and so create a global movement.
However, the mesh of the cylinder and the mesh of the muscles are different, and I have a problem to assemblate correctly the two bodies. The muscle must enter in the cylinder and the extremities of the cylinder and the muscle must concur I guess.
I have read a topic named “Two-way force propagation ” and try to get inspired from that, but the problem are still here even using the method which is called “BilateralInteractionConstraint”. The muscle dynamic doesn’t interfer with the cylinder’s dynamic, and the muscle don’t want to stay stick to the cylinder. The link between theses two bodies is not well created, and that’s creating many problems of deformation and visualisation..Here is a link to my code : https://pad.inria.fr/p/np_Y3oUTxHNM2hF5vFd
Link for files : https://drive.google.com/drive/folders/19NfVqqvVybeF3EtaNF4NhWqO6Klxja2F?usp=sharing
If you can look at the code and help me to fix it and create a good link between my bodies, I will be glad !
Thank you very much !23 November 2018 at 08:59 #12524Hugo
KeymasterHi Nassim
There is several remarks regarding your scene:
– you should share a scene without all the commented codes, it’s not easy to read, could you share a light version of your scene?
– when you use several times the same mesh, use one loader and all components using it can link to the loader (e.g. “src” and “fileTopology” in your Containers are redundant)
– you mix both TetrahedronFEMForceField and MeshSpringForceField which is strange: it corresponds to use both a elastic model based on FEM (TetrahedronFEMForceField) and in the same time use a spring-based model (MeshSpringForceField) which add another stiffness. This does not really make sense.
– the MechanicalObject should always be set after the ODESolver, LinearSolver and the TopologyContainer. Same for the Mass component.
– LMConstraint are deprecated codes, to use the Lagrange Constraint, refer to the doc on Constraints using the FreeMotionALThis last point might explain your issue.
Regarding the physics, what is the role/purpose of the cylinder mesh ? Is it used for collision ?
Best
Hugo
27 November 2018 at 13:58 #12538Nassim
BlockedHi Hugo,
Thanks for your advices ! I have write a new code, and correct the mistakes.
Here it is : https://drive.google.com/drive/folders/19NfVqqvVybeF3EtaNF4NhWqO6Klxja2F?usp=sharingIn this simulation the muscle present in the cylinder can go outside the boundaries of the cylinder, which is not realistic.. I don’t know how I can force the muscle to be confine in the cylinder. If you have any ideas I will be glad !
The cylinder is only for the collision with the ground. It’s the container for the muscle. thanks to this cylinder, the hopping movement ( bouncing) will be created. So the cylinder is in soft material.
The force to create this movement has to be created by the muscle. It’s the muscle who lead the movement. So for hopping, the muscle is retracting, which also make the cylinder retracting, and then a phase of release is present ( model of contraction and detente). Thanks to that, we could normally create a hopping movement for the robot.
I’m thinking how I can create a control of the force threw the muscle. I think a python controller will be necessary.I have also think about an other way to explore the hopping movement. Instead of a muscle, I will just create a wire model, with 4 wires side line which traverse the cylinder.
It will be this line model which will create directly the force on the cylinder to create the hopping movement. ( the line can be only line model, not even hill model)
This model is also acceptable due to the fact that my cylinder is already soft.
Again, if you think of something regardings the control of force and a way to do it, please let me know !Thank you for your precious help and your time !
Regards,
Nassim
12 December 2018 at 20:55 #12581Hugo
KeymasterHey @nassim
Sorry for the delay of my reply, many things are going on.
In order to keep the muscle within the cylinder, one idea could be to set a collision model on both cylinder/muscle so that they collide together.
To have a motion created from the muscle, your muscle mechanical model could couple a passive constitutive law (e.g. linear elasticity) and an active part. I am no expert in active muscle mechanical model, but I am sure some can be found in the literature. Maybe some forum users might know references. Nassim have you seen any similar work / model ?
Another solution, would be to force displacement (eg with Python controller indeed) thus inducing internal stress and a motion from the muscle.
I will try to give a try asap to your scene.
Best,Hugo
13 December 2018 at 14:55 #12586Nassim
BlockedHey @Hugo!
Thank you for your answer !I was thinking about the collision, but is there a way to put collision only on the external part of the cylinder? Cause when I’m putting collision, it also creates collision in the cylinder and then the muscle is stuck in the cylinder and collide everytime.
For the moment no, I’m gonna search about it, but I think that the python controller and a constraint force field is enough for my work at this level. I tried to look at the example of the use of this Plugin, but I can’t found any thing linked to the creation of Force with Python.
I worked on two models of my scene, one with muscle, and the other one with only some “fibers”.
I have a model with one and two fibers.
With these models, maybe it’s easier to put control on it, directly on the fibers.
Here are the files for these versions : https://drive.google.com/drive/folders/19NfVqqvVybeF3EtaNF4NhWqO6Klxja2F?usp=sharingActually I notice something with my scenes : Everytime, my cylinder is rotating a bit, and it doesn’t stop. It’s as if there was no friction between the cylinder and the ground( we can especially see that with the model with 1 fiber : “programmeVersionfil”).
How can I do to create this kind of friction with the ground to stop that rotational movement?Thank you for looking my scene and try on it!
Best regards,
Nassim
18 December 2018 at 11:36 #12616Hugo
KeymasterHi @nassim
Regarding the friction issue, you can relate to the following forum discussion talking about the “mu” parameter for friction.
Note that rotation induced by collision can also be due to inertia (i.e. mass) effects.If you want to set a stiffer fiber within your cylinder, you could either:
– create a heterogeneous stiffness (defining a localStiffnessFactor per tetrahedron)
– or use the Mapping approach: map your fibers within the cylinder. Thus, you don’t need anymore Lagrange constraints and an usual DefaultAnimationLoop can be used. Below is an example:<Node name="root" gravity="0 -1 0" dt="0.1"> <!-- Basic Components to perform the collision detection --> <RequiredPlugin pluginName='SofaMiscCollision'/> <GenericConstraintSolver tolerance="0.001" maxIterations="1000"/> <VisualStyle displayFlags="showBehaviorModels showForceFields showVisual showWireframe" /> <DefaultMotionAnimationLoop /> <DefaultPipeline name="DefaultCollisionPipeline" verbose="0" /> <BruteForceDetection name="Detection" /> <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" /> <DefaultContactManager name="Response" /> <DefaultCollisionGroupManager name="Group" /> <CollisionResponse name="Response" response="FrictionContact" /> <CollisionGroup name="Group" /> <Node name="Floor"> <MeshTopology name="Topology Floor" filename="mesh/floorFlat.obj" /> <MechanicalObject name="Particles Floor" /> <UncoupledConstraintCorrection /> <PointModel name="FrictionCoeff" contactFriction="100" /> <TetrahedronModel name="FrictionCoeff4" contactFriction="1" /> <TriangleModel name="Triangle For Collision Floor" moving="0" simulated="0" /> <LineModel name="Lines For Collision" moving="0" simulated="0" /> <PointModel name="Points For Collision" moving="0" simulated="0"/> </Node> <!--Test de cylindre 2 --> <Node name="Cylinder" activated="1"> <MeshGmshLoader name="loader" filename="mesh/cylinder.msh" /> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="25" tolerance="1e-09" threshold="1e-09" /> <TetrahedronSetTopologyContainer src="@loader" name="Topology Container" fileTopology="mesh/cylinder.msh" /> <TetrahedronSetTopologyModifier name="Topology Modifier" /> <TetrahedronSetTopologyAlgorithms name="Topology Algorithms" template="Vec3d" /> <TetrahedronSetGeometryAlgorithms name="Geometry Algorithms" template="Vec3d" /> <TetrahedronModel name="Models" /> <TetrahedronModel name="FrictionCoeff2" contactFriction="1" /> <MechanicalObject src="@loader" name="Cylinder" template="Vec3d" translation="0 13 0" rotation="90 0 0" scale="12" /> <TetrahedronFEMForceField name="FEM" template="Vec3d" method="polar" poissonRatio="0.3" youngModulus="1500" assembling="0" /> <UniformMass name="Mass" template="Vec3d" totalmass="300" /> <Node name="Visual Model"> <OglModel name="Visual" template="ExtVec3f" color="green" /> <IdentityMapping name="Mapping" template="Vec3d,ExtVec3f" input="@.." output="@Visual" /> </Node> <Node name="Collision Model"> <Mesh name="Cylinder Mesh" filename="mesh/cylinder.obj" /> <MechanicalObject name="Collision" /> <Triangle name="Cube Triangle For Collision" /> <Line name="Cube Edge For Collision" /> <Point name="Cube Point For Collision" /> <IdentityMapping name="RigidMapping Collision-RigidDOF" input="@../Cylinder" output="@Collision" /> </Node> </Node> <Node name="Wire1"> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="25" tolerance="1e-09" threshold="1e-09" /> <CylinderGridTopology name="Regular Mesh1" n="5 5 5" axis="0 1 0" radius="0.5" length="12" /> <MechanicalObject name="DOFs" template="Vec3d" translation="-1.45 1 0" rotation="0 0 0" /> <TetrahedronFEMForceField name="FEM1" template="Vec3d" method="polar" poissonRatio="0.1" youngModulus="13000" assembling="0" /> <UniformMass name="Mass1" template="Vec3d" totalmass="1000" /> <BarycentricMapping name="Mapping-fiber1" output="@." input="@../Cylinder" /> <Node name="Visual Model"> <OglModel name="Visual1" template="ExtVec3f" color="blue" /> <IdentityMapping name="Mapping1" template="Vec3d,ExtVec3f" input="@.." output="@Visual1" /> </Node> </Node> <Node name="Wire2"> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="25" tolerance="1e-09" threshold="1e-09" /> <CylinderGridTopology name="Regular Mesh2" n="5 5 5" axis="0 1 0" radius="0.5" length="12" /> <MechanicalObject name="DOFs" template="Vec3d" translation="1.45 1 0" rotation="0 0 0" /> <TetrahedronFEMForceField name="FEM2" template="Vec3d" method="polar" poissonRatio="0.1" youngModulus="13000" assembling="0" /> <UniformMass name="Mass2" template="Vec3d" totalmass="1000" /> <BarycentricMapping name="Mapping-fiber2" output="@." input="@../Cylinder" /> <Node name="Visual Model"> <OglModel name="Visual2" template="ExtVec3f" color="blue" /> <IdentityMapping name="Mapping2" template="Vec3d,ExtVec3f" input="@.." output="@Visual2" /> </Node> </Node> </Node>
Hope this helps.
Best regards,Hugo
8 January 2019 at 11:15 #12738Nassim
BlockedHi @Hugo,
The method of the mapping works well to combine the fibers and the cylinder, how ever, i have some troubles concerning the control of the fibers.
I have created a Python controller which helps me to create a constantForceField.Then I have put this controller in the Node of the fiber.
However, even if the force is created, it does nothing on the big cylinder. It’s acting as if there was no ForceField.
I tried my Controller on the big cylinder, it works and it creates a movement, how ever, when I’m trying to control the fibers nothing happen and I don’t know why.
I think the problem is caused by the BarycentricMapping. The fiber is considered as the child of the cylinder, and when I’m applying force on the fiber, it doesn’t affect the parent cylinder. However, in the opposite case, if I apply a force on the parent cylinder, it is transmitted to the child fiber.
What can I do in order to apply a force on the child fiber which is transmitted to the parent cylinder?Here is my code and the file for the controller :
<Node name=”root” gravity=”0 -1 0″ dt=”0.1″> <!– Basic Components to perform the collision detection –> <RequiredPlugin name=”SofaPython” pluginName=”SofaPython” /> <RequiredPlugin pluginName=’SofaMiscCollision’/> <GenericConstraintSolver tolerance=”0.001″ maxIterations=”1000″/> <VisualStyle displayFlags=”showBehaviorModels showForceFields showVisual showWireframe” /> <DefaultMotionAnimationLoop /> <DefaultPipeline name=”DefaultCollisionPipeline” verbose=”0″ /> <BruteForceDetection name=”Detection” /> <MinProximityIntersection name=”Proximity” alarmDistance=”0.8″ contactDistance=”0.5″ /> <DefaultContactManager name=”Response” /> <DefaultCollisionGroupManager name=”Group” /> <CollisionResponse name=”Response” response=”FrictionContact” responseParams=”10″/> <CollisionGroup name=”Group” /> <Node name=”Floor”> <MeshTopology name=”Topology Floor” filename=”mesh/floorFlat.obj” /> <MechanicalObject name=”Particles Floor” /> <UncoupledConstraintCorrection /> <PointModel name=”FrictionCoeff” contactFriction=”100″ /> <TetrahedronModel name=”FrictionCoeff4″ contactFriction=”1″ /> <TriangleModel name=”Triangle For Collision Floor” moving=”0″ simulated=”0″ /> <LineModel name=”Lines For Collision” moving=”0″ simulated=”0″ /> <PointModel name=”Points For Collision” moving=”0″ simulated=”0″/> </Node> <!–Test de cylindre 2 –> <Node name=”Cylinder” activated=”1″> <MeshGmshLoader name=”loader” filename=”mesh/cylinder.msh” /> <EulerImplicitSolver name=”cg_odesolver” printLog=”0″ /> <CGLinearSolver name=”linear solver” template=”GraphScattered” iterations=”25″ tolerance=”1e-09″ threshold=”1e-09″ /> <TetrahedronSetTopologyContainer src=”@loader” name=”Topology Container” fileTopology=”mesh/cylinder.msh” /> <TetrahedronSetTopologyModifier name=”Topology Modifier” /> <TetrahedronSetTopologyAlgorithms name=”Topology Algorithms” template=”Vec3d” /> <TetrahedronSetGeometryAlgorithms name=”Geometry Algorithms” template=”Vec3d” /> <TetrahedronModel name=”Models” /> <TetrahedronModel name=”FrictionCoeff2″ contactFriction=”1″ /> <MechanicalObject src=”@loader” name=”Cylinder” template=”Vec3d” translation=”0 16 0″ rotation=”90 0 0″ scale=”12″ /> <TetrahedronFEMForceField name=”FEM” template=”Vec3d” method=”polar” poissonRatio=”0.3″ youngModulus=”1500″ assembling=”0″ /> <UniformMass name=”Mass” template=”Vec3d” totalmass=”300″ /> <Node name=”Visual Model”> <OglModel name=”Visual” template=”ExtVec3f” color=”green” /> <IdentityMapping name=”Mapping” template=”Vec3d,ExtVec3f” input=”@..” output=”@Visual” /> </Node> <Node name=”Collision Model”> <Mesh name=”Cylinder Mesh” filename=”mesh/cylinder.obj” /> <MechanicalObject name=”Collision” /> <Triangle name=”Cube Triangle For Collision” /> <Line name=”Cube Edge For Collision” /> <Point name=”Cube Point For Collision” /> <IdentityMapping name=”RigidMapping Collision-RigidDOF” input=”@../Cylinder” output=”@Collision” /> </Node> </Node> <Node name=”Wire2″> <EulerImplicitSolver name=”cg_odesolver” printLog=”0″ /> <CGLinearSolver name=”linear solver” template=”GraphScattered” iterations=”25″ tolerance=”1e-09″ threshold=”1e-09″ /> <CylinderGridTopology name=”Regular Mesh2″ n=”5 5 5″ axis=”0 1 0″ radius=”0.5″ length=”12″ /> <MechanicalObject name=”DOFs” template=”Vec3d” translation=”0 4 0″ rotation=”0 0 0″ /> <TetrahedronFEMForceField name=”FEM2″ template=”Vec3d” method=”polar” poissonRatio=”0.1″ youngModulus=”1300″ assembling=”0″ /> <UniformMass name=”Mass2″ template=”Vec3d” totalmass=”100″ /> <BarycentricMapping name=”Mapping-fiber2″ output=”@.” input=”@../Cylinder” /> <Node name=”Visual Model”> <OglModel name=”Visual2″ template=”ExtVec3f” color=”blue” /> <IdentityMapping name=”Mapping2″ template=”Vec3d,ExtVec3f” input=”@..” output=”@Visual2″ /> </Node> <PythonScriptController filename=”ForceControl.py” classname=”KeyboardControl” printLog=”true”/> </Node> </Node>
the controller and the files can be find here : https://drive.google.com/drive/folders/19NfVqqvVybeF3EtaNF4NhWqO6Klxja2F?usp=sharing
Thank you for your help to fix that problem !
Best regards,
Nassim
9 January 2019 at 15:21 #12745Hugo
KeymasterHi Nassim,
Please find below a scene solving your issue. Two modifs:
1. put the fiber node as a child node from the cylinder (since they correspond to the same object)
2. decreasing the mass of the fiber, that was relatively to the cylinder very high.
3. Removing the TetraModel which is not needed, the collision node (with Point, Line etc) does the job !<Node name="root" gravity="0 -1 0" dt="0.1"> <!-- Basic Components to perform the collision detection --> <RequiredPlugin name="SofaPython" pluginName="SofaPython" /> <RequiredPlugin pluginName='SofaMiscCollision'/> <GenericConstraintSolver tolerance="0.001" maxIterations="1000"/> <VisualStyle displayFlags="showBehaviorModels showForceFields showVisual showWireframe" /> <DefaultMotionAnimationLoop /> <DefaultPipeline name="DefaultCollisionPipeline" verbose="0" /> <BruteForceDetection name="Detection" /> <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" /> <DefaultContactManager name="Response" /> <DefaultCollisionGroupManager name="Group" /> <CollisionResponse name="Response" response="FrictionContact" responseParams="10"/> <CollisionGroup name="Group" /> <Node name="Floor"> <MeshTopology name="Topology Floor" filename="mesh/floorFlat.obj" /> <MechanicalObject name="Particles Floor" /> <UncoupledConstraintCorrection /> <PointModel name="FrictionCoeff" contactFriction="100" /> <TetrahedronModel name="FrictionCoeff4" contactFriction="1" /> <TriangleModel name="Triangle For Collision Floor" moving="0" simulated="0" /> <LineModel name="Lines For Collision" moving="0" simulated="0" /> <PointModel name="Points For Collision" moving="0" simulated="0"/> </Node> <!--Test de cylindre 2 --> <Node name="Cylinder" activated="1"> <MeshGmshLoader name="loader" filename="mesh/cylinder.msh" /> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="25" tolerance="1e-09" threshold="1e-09" /> <TetrahedronSetTopologyContainer src="@loader" name="Topology Container" fileTopology="mesh/cylinder.msh" /> <TetrahedronSetTopologyModifier name="Topology Modifier" /> <TetrahedronSetTopologyAlgorithms name="Topology Algorithms" template="Vec3d" /> <TetrahedronSetGeometryAlgorithms name="Geometry Algorithms" template="Vec3d" /> <MechanicalObject src="@loader" name="Cylinder" template="Vec3d" translation="0 16 0" rotation="90 0 0" scale="12" /> <TetrahedronFEMForceField name="FEM" template="Vec3d" method="polar" poissonRatio="0.3" youngModulus="1500" assembling="0" /> <UniformMass name="Mass" template="Vec3d" totalMass="300" /> <Node name="Visual Model"> <OglModel name="Visual" template="ExtVec3f" color="green" /> <IdentityMapping name="Mapping" template="Vec3d,ExtVec3f" input="@.." output="@Visual" /> </Node> <Node name="Collision Model"> <Mesh name="Cylinder Mesh" filename="mesh/cylinder.obj" /> <MechanicalObject name="Collision" /> <Triangle name="Cube Triangle For Collision" /> <Line name="Cube Edge For Collision" /> <Point name="Cube Point For Collision" /> <IdentityMapping name="RigidMapping Collision-RigidDOF" input="@../Cylinder" output="@Collision" /> </Node> <Node name="Wire2"> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="25" tolerance="1e-09" threshold="1e-09" /> <CylinderGridTopology name="Regular Mesh2" n="5 5 5" axis="0 1 0" radius="0.5" length="12" /> <MechanicalObject name="DOFs" template="Vec3d" translation="0 4 0" rotation="0 0 0" /> <TetrahedronFEMForceField name="FEM2" template="Vec3d" method="polar" poissonRatio="0.1" youngModulus="130" assembling="0" /> <UniformMass name="Mass2" template="Vec3d" totalMass="30" /> <BarycentricMapping name="Mapping-fiber2" output="@." input="@.." /> <PythonScriptController filename="ForceControl.py" classname="KeyboardControl" listening="true"/> <Node name="Visual Model"> <OglModel name="Visual2" template="ExtVec3f" color="blue" /> <IdentityMapping name="Mapping2" template="Vec3d,ExtVec3f" input="@.." output="@Visual2" /> </Node> </Node> </Node> </Node>
Best
Hugo
29 January 2019 at 10:23 #12926Nassim
BlockedHello,
Thank you really much for your answer, it worked well.
My controller is now efficient.
After that, I wanted to add some parts to my jumping cylinder.First, I have add an other cylinder which represents a body, and two others cylinders which represent the arms.
I have created one big node, called body, which contains all the different part.
To link, the different part, I used the same technique which helps us to create the link between the fiber and the cylinder : the barycentric Mapping.How ever, I have some trouble to fix the arm with the body, because just like the human body, there is an angle between the body and the arms, and the barycentric mapping can’t create the link properly.
Is there an other way to create that link?
(I tried the rigid Mapping, but the arm didn’t stay fixe to the body)Moreover, the calculation time and the scene became really slow when I have created my node “Body” and put the solvers( EulerImplicit,CGLinear), and I don’t know why.
Here is my code with the other parts added :<Node name="root" gravity="0 -9.81 0" dt="0.1"> <!-- Basic Components to perform the collision detection --> <RequiredPlugin name="SofaPython" pluginName="SofaPython" /> <RequiredPlugin pluginName='SofaMiscCollision'/> <GenericConstraintSolver tolerance="0.001" maxIterations="1000"/> <VisualStyle displayFlags="showBehaviorModels showForceFields showVisual showWireframe" /> <DefaultMotionAnimationLoop /> <DefaultPipeline name="DefaultCollisionPipeline" verbose="0" /> <BruteForceDetection name="Detection" /> <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" /> <DefaultContactManager name="Response" /> <DefaultCollisionGroupManager name="Group" /> <CollisionResponse name="Response" response="FrictionContact" responseParams="10"/> <CollisionGroup name="Group" /> <Node name="Floor"> <MeshTopology name="Topology Floor" filename="mesh/floorFlat.obj" /> <MechanicalObject name="Particles Floor" /> <UncoupledConstraintCorrection /> <PointModel name="FrictionCoeff" contactFriction="100" /> <TetrahedronModel name="FrictionCoeff4" contactFriction="1" /> <TriangleModel name="Triangle For Collision Floor" moving="0" simulated="0" /> <LineModel name="Lines For Collision" moving="0" simulated="0" /> <PointModel name="Points For Collision" moving="0" simulated="0"/> </Node> <Node name="Body" activated="1"> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="50" tolerance="1e-10" threshold="1e-10" /> <Node name="Cylinder" activated="1"> <MeshGmshLoader name="loader" filename="mesh/cylinder.msh" /> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="25" tolerance="1e-09" threshold="1e-09" /> <TetrahedronSetTopologyContainer src="@loader" name="Topology Container" fileTopology="mesh/cylinder.msh" /> <TetrahedronSetTopologyModifier name="Topology Modifier" /> <TetrahedronSetTopologyAlgorithms name="Topology Algorithms" template="Vec3d" /> <TetrahedronSetGeometryAlgorithms name="Geometry Algorithms" template="Vec3d" /> <MechanicalObject src="@loader" name="Cylinder" template="Vec3d" translation="0 16 0" rotation="90 0 0" scale="12" /> <TetrahedronFEMForceField name="FEM" template="Vec3d" method="polar" poissonRatio="0.32" youngModulus="1300" assembling="0" /> <UniformMass name="Mass" template="Vec3d" totalMass="2" /> <Node name="Visual Model"> <OglModel name="Visual" template="ExtVec3f" color="green" /> <IdentityMapping name="Mapping" template="Vec3d,ExtVec3f" input="@.." output="@Visual" /> </Node> <Node name="Collision Model"> <Mesh name="Cylinder Mesh" filename="mesh/cylinder.obj" /> <MechanicalObject name="Collision" /> <Triangle name="Cube Triangle For Collision" /> <Line name="Cube Edge For Collision" /> <Point name="Cube Point For Collision" /> <IdentityMapping name="RigidMapping Collision-RigidDOF" input="@../Cylinder" output="@Collision" /> </Node> <Node name="Wire1"> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="25" tolerance="1e-09" threshold="1e-09" /> <CylinderGridTopology name="Regular Mesh1" n="5 5 5" axis="0 1 0" radius="0.5" length="12" /> <MechanicalObject name="DOFs1" template="Vec3d" translation="-1.45 4 0" rotation="0 0 0" /> <TetrahedronFEMForceField name="FEM1" template="Vec3d" method="polar" poissonRatio="0.3" youngModulus="28.2" assembling="0" /> <UniformMass name="Mass1" template="Vec3d" totalmass="0.5" /> <BarycentricMapping name="Mapping-fiber2" output="@." input="@.." /> <PythonScriptController filename="ForceControl.py" classname="KeyboardControl" listening="true"/> <Node name="Visual Model"> <OglModel name="Visual1" template="ExtVec3f" color="blue" /> <IdentityMapping name="Mapping1" template="Vec3d,ExtVec3f" input="@.." output="@Visual1" /> </Node> </Node> <Node name="Wire2"> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="25" tolerance="1e-09" threshold="1e-09" /> <CylinderGridTopology name="Regular Mesh2" n="5 5 5" axis="0 1 0" radius="0.5" length="12" /> <MechanicalObject name="DOFs2" template="Vec3d" translation="1.45 4 0" rotation="0 0 0" /> <TetrahedronFEMForceField name="FEM2" template="Vec3d" method="polar" poissonRatio="0.3" youngModulus="28.2" assembling="0" /> <UniformMass name="Mass2" template="Vec3d" totalMass="0.5" /> <BarycentricMapping name="Mapping-fiber2" output="@." input="@.." /> <PythonScriptController filename="ForceControl.py" classname="KeyboardControl" listening="true"/> <Node name="Visual Model"> <OglModel name="Visual2" template="ExtVec3f" color="blue" /> <IdentityMapping name="Mapping2" template="Vec3d,ExtVec3f" input="@.." output="@Visual2" /> </Node> </Node> </Node> <Node name="corps"> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="50" tolerance="1e-09" threshold="1e-09" /> <CylinderGridTopology name="Regular Mesh3" n="5 5 5" axis="0 1 0" radius="0.5" length="12" /> <MechanicalObject name="DOFs3" template="Vec3d" translation="0 15 0" rotation="0 0 0" /> <TetrahedronFEMForceField name="FEM3" template="Vec3d" method="polar" poissonRatio="0.3" youngModulus="28.2" assembling="0" /> <UniformMass name="Mass3" template="Vec3d" totalmass="0.1" /> <BarycentricMapping name="Mapping-fiber3" output="@." input="@../Cylinder" /> <!-- <ConstantForceField force="5 0 0 0 0 0" /> --> <Node name="Visual Model"> <OglModel name="Visual3" template="ExtVec3f" color="red" /> <IdentityMapping name="Mappng3" template="Vec3d,ExtVec3f" input="@.." output="@Visual3" /> </Node> </Node> <Node name="bras1"> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="50" tolerance="1e-09" threshold="1e-09" /> <CylinderGridTopology name="Regular Mesh3" n="5 5 5" axis="0 1 0" radius="0.3" length="8" /> <MechanicalObject name="DOFs4" template="Vec3d" translation="0 24 0.5" rotation="120 0 0" /> <TetrahedronFEMForceField name="FEM4" template="Vec3d" method="polar" poissonRatio="0.3" youngModulus="28.2" assembling="0" /> <UniformMass name="Mass4" template="Vec3d" totalmass="0.1" /> <RigidMapping name="Mapping-fiber4" output="@." input="@../corps" /> <Node name="Visual Model"> <OglModel name="Visual4" template="ExtVec3f" color="blue" /> <IdentityMapping name="Mapping4" template="Vec3d,ExtVec3f" input="@.." output="@Visual4" /> </Node> </Node> <Node name="bras2"> <EulerImplicitSolver name="cg_odesolver" printLog="0" /> <CGLinearSolver name="linear solver" template="GraphScattered" iterations="25" tolerance="1e-09" threshold="1e-09" /> <CylinderGridTopology name="Regular Mesh3" n="5 5 5" axis="0 1 0" radius="0.3" length="8" /> <MechanicalObject name="DOFs5" template="Vec3d" translation="0 24 -0.5" rotation="120 180 0" /> <TetrahedronFEMForceField name="FEM4" template="Vec3d" method="polar" poissonRatio="0.3" youngModulus="28.2" assembling="0" /> <UniformMass name="Mass5" template="Vec3d" totalmass="0.1" /> <BarycentricMapping name="Mapping-fiber5" output="@." input="@../corps" /> <Node name="Visual Model"> <OglModel name="Visual5" template="ExtVec3f" color="blue" /> <IdentityMapping name="Mapping5" template="Vec3d,ExtVec3f" input="@.." output="@Visual5" /> </Node> </Node> </Node> </Node>
Thank you really much for your help !
Best regards,
Nassim
29 January 2019 at 18:07 #12954Hugo
KeymasterHey @nassim
You’re welcome, the community is happy to help when possible!
In your case – IMO -, you want to attach different parts, the best approach would be to set bilateral constraints on your different objects. You can find an example in examples/Components/constraint/BilateralInteractionConstraint.scnYou can define a master node, containing childNode that would contain the different part of your robot.
Best
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.