Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def createScene(rootNode):
rootNode.addObject('VisualStyle', displayFlags='showVisualModels hideBehaviorModels showCollisionModels hideBoundingCollisionModels hideForceFields showInteractionForceFields hideWireframe')

rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('GenericConstraintSolver', printLog='0')
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', printLog='0')

################################################################################################################
################################################### Bunny ######################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/component/constraint/CableConstraint/Finger.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def createScene(rootNode):
#  of the actuator's parameters.
# rootNode.addObject('QPInverseProblemSolver', printLog=False)
# Otherwise use a GenericConstraintSolver
rootNode.addObject('GenericConstraintSolver', tolerance=1e-5, maxIterations=100)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', tolerance=1e-5, maxIterations=100)

rootNode.gravity = [0, -9810, 0]
rootNode.dt = 0.01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def createScene(rootNode):

rootNode.addObject("FreeMotionAnimationLoop")
rootNode.addObject('DefaultVisualManagerLoop')
rootNode.addObject("GenericConstraintSolver", maxIterations=1000, tolerance=0.001)
rootNode.addObject("ProjectedGaussSeidelConstraintSolver", maxIterations=1000, tolerance=0.001)

finger = ElasticMaterialObject(name="finger",
volumeMeshFileName="mesh/finger.vtk",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def createScene(rootNode):
rootNode.gravity = [0., -9810., 0.]
rootNode.addObject('VisualStyle', displayFlags='showBehaviorModels')
rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('GenericConstraintSolver', maxIterations=500, tolerance=1e-4)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=500, tolerance=1e-4)

# Simulation node
simulation = rootNode.addChild('Simulation')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def createScene(rootnode):
rootnode.addObject('RequiredPlugin', name='SoftRobots')

rootnode.addObject('FreeMotionAnimationLoop')
rootnode.addObject('GenericConstraintSolver', maxIterations=1e4, tolerance=1e-5, printLog=True)
rootnode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=1e4, tolerance=1e-5, printLog=True)
rootnode.gravity = [0, -9.81, 0]
rootnode.addObject('VisualStyle', displayFlags='showForceFields')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def createScene(rootNode):

rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('DefaultVisualManagerLoop')
rootNode.addObject('GenericConstraintSolver', maxIterations=500, printLog=False, tolerance=0.0000001)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=500, printLog=False, tolerance=0.0000001)

Bunny(rootNode, name='BunnyPressure', controlType='pressure', initialValue=2)
Bunny(rootNode, translation=[15, 0, 0], controlType='volumeGrowth', name='BunnyVolume', initialValue=40)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def createScene(rootNode):
rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('DefaultVisualManagerLoop')

rootNode.addObject('GenericConstraintSolver', maxIterations=1000, tolerance=1e-3)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=1000, tolerance=1e-3)

rootNode.addObject('BackgroundSetting', color=[0, 0.168627, 0.211765, 1])
rootNode.findData('gravity').value = [0, 0, -981.0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def createScene(rootNode):

rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('DefaultVisualManagerLoop')
rootNode.addObject('GenericConstraintSolver', maxIterations=100, tolerance=0.0000001)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=100, tolerance=0.0000001)

# bunny
bunny = rootNode.addChild('bunny')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def createScene(rootNode):
rootNode.addObject('VisualStyle', displayFlags="showVisualModels hideBehaviorModels showCollisionModels hideBoundingCollisionModels hideForceFields showInteractionForceFields hideWireframe")
rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('DefaultVisualManagerLoop')
rootNode.addObject('GenericConstraintSolver', maxIterations=1000, tolerance=1e-3)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=1000, tolerance=1e-3)

rootNode.addObject('CollisionPipeline')
rootNode.addObject('BruteForceBroadPhase', name="N2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def createScene(rootNode):

rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('DefaultVisualManagerLoop')
rootNode.addObject('GenericConstraintSolver', maxIterations=1000, tolerance=1e-14)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=1000, tolerance=1e-14)

rootNode.gravity.value = [0, 0, -981.0]
rootNode.dt.value = 0.01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def createScene(rootNode):
rootNode.addObject('RequiredPlugin', name='SoftRobots.Inverse')
rootNode.addObject('QPInverseProblemSolver', epsilon=1e-1, maxIterations=1000, tolerance=1e-14)
else:
rootNode.addObject('GenericConstraintSolver', maxIterations=500, tolerance=1e-5)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=500, tolerance=1e-5)

rootNode.gravity.value = [0, 0, -981.0]
rootNode.dt.value = 0.01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def createScene(rootNode):
rootNode.addObject('RequiredPlugin', name='SoftRobots.Inverse')
rootNode.addObject('QPInverseProblemSolver', epsilon=1e-1, maxIterations=1000, tolerance=1e-14)
else:
rootNode.addObject('GenericConstraintSolver', maxIterations=500, tolerance=1e-5)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=500, tolerance=1e-5)

rootNode.gravity.value = [0, 0, -981.0]
rootNode.dt.value = 0.01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def createScene(rootNode):

rootNode.addObject('FreeMotionAnimationLoop')

rootNode.addObject('GenericConstraintSolver', tolerance=1e-5, maxIterations=100)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', tolerance=1e-5, maxIterations=100)

rootNode.addObject('BackgroundSetting', color=[0, 0.168627, 0.211765, 1])
rootNode.addObject('OglSceneFrame', style="Arrows", alignment="TopRight")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def createScene(rootNode):

rootNode.addObject('FreeMotionAnimationLoop')

rootNode.addObject('GenericConstraintSolver', tolerance=1e-5, maxIterations=100)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', tolerance=1e-5, maxIterations=100)

rootNode.addObject('BackgroundSetting', color=[0, 0.168627, 0.211765, 1])
rootNode.addObject('OglSceneFrame', style="Arrows", alignment="TopRight")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def createScene(rootNode):
displayFlags='showVisualModels hideBehaviorModels showCollisionModels hideBoundingCollisionModels hideForceFields showInteractionForceFields hideWireframe')

rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('GenericConstraintSolver', maxIterations=100, tolerance=0.0000001)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=100, tolerance=0.0000001)

# bunny mechanical model
bunny = rootNode.addChild('bunny')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def createScene(rootNode):
displayFlags='showVisualModels hideBehaviorModels showCollisionModels hideBoundingCollisionModels hideForceFields showInteractionForceFields hideWireframe')

rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('GenericConstraintSolver', maxIterations=100, tolerance=0.0000001)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=100, tolerance=0.0000001)

# bunny mechanical model
bunny = rootNode.addChild('bunny')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def createScene(rootNode):
rootNode.gravity = [0., 0., -9810]

rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('GenericConstraintSolver', tolerance=1e-6, maxIterations=50000)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', tolerance=1e-6, maxIterations=50000)

rootNode.addObject('BackgroundSetting', color=[0, 0.168627, 0.211765, 1])
rootNode.addObject('OglSceneFrame', style="Arrows", alignment="TopRight")
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/CableGripper/details/step3.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def createScene(rootNode):
MainHeader(rootNode, plugins=["SoftRobots"])
rootNode.VisualStyle.displayFlags = "showBehavior showCollisionModels"
rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('GenericConstraintSolver', tolerance=1e-5, maxIterations=100)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', tolerance=1e-5, maxIterations=100)

Finger(rootNode)

Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/CircularRobot/circularrobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def createScene(rootNode):
rootNode.addObject('QPInverseProblemSolver', epsilon=2e-0, maxIterations=2500, tolerance=1e-7,
responseFriction=0.8)
else:
rootNode.addObject('GenericConstraintSolver', maxIterations=500, tolerance=1e-5)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=500, tolerance=1e-5)

# Contact detection methods
rootNode.addObject('CollisionPipeline')
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/DiamondRobot/DiamondRobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def createScene(rootNode):

# Constraint solver, here we use a Gauss Seidel algorithm
rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('GenericConstraintSolver', maxIterations=500, tolerance=1e-8)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=500, tolerance=1e-8)

# Robot
robot = rootNode.addChild('Robot')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def createScene(rootNode):
rootNode.gravity.value = [-9810, 0, 0]
rootNode.addObject('AttachBodyButtonSetting', stiffness=10)
rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('GenericConstraintSolver', tolerance=1e-7, maxIterations=1000)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', tolerance=1e-7, maxIterations=1000)

finger = rootNode.addChild('Finger')
finger.addObject('EulerImplicitSolver', rayleighStiffness=0.1, rayleighMass=0.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def createScene(rootNode):
'showInteractionForceFields hideWireframe')
rootNode.gravity.value = [-9810, 0, 0]
rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('GenericConstraintSolver', tolerance=1e-7, maxIterations=1000)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', tolerance=1e-7, maxIterations=1000)
rootNode.addObject('CollisionPipeline')
rootNode.addObject('BruteForceBroadPhase')
rootNode.addObject('BVHNarrowPhase')
Expand Down
6 changes: 3 additions & 3 deletions examples/tutorials/PneunetGripper/pneunetgripper-tuto.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ <h2 id="pneumatic-actuator-and-python-script-controller">Pneumatic Actuator and
<div class="sourceCode" id="cb10"><pre class="sourceCode python"><code class="sourceCode python"><a class="sourceLine" id="cb10-1" title="1">rootNode.addObject(<span class="st">&#39;PythonScriptController&#39;</span>, filename<span class="op">=</span><span class="st">&quot;controllerGripper.py&quot;</span>, classname<span class="op">=</span><span class="st">&quot;controller&quot;</span>)</a></code></pre></div>
<p>In this case, the controller allows to interactively inflate the cavity by pressing ctrl + ‘+’ and deflate it by pressing ctrl + ‘-’.</p>
<h2 id="solving-the-constraints">Solving the constraints</h2>
<p>To solve the constraints, such as the one define by the pressure actuator, we have to add to the rootNode the component FreeMotionAnimationLoop that will build up the system including constraints. The component GenericConstraintSolver will also be added to solve the constraints problem. Finally, we add the component LinearConstraintCorrection to the finger Node to take into account the correction due to the cavity constraint to the velocity and position:</p>
<p>To solve the constraints, such as the one define by the pressure actuator, we have to add to the rootNode the component FreeMotionAnimationLoop that will build up the system including constraints. The component ProjectedGaussSeidelConstraintSolver will also be added to solve the constraints problem. Finally, we add the component LinearConstraintCorrection to the finger Node to take into account the correction due to the cavity constraint to the velocity and position:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode python"><code class="sourceCode python"><a class="sourceLine" id="cb11-1" title="1">rootNode.addObject(<span class="st">&#39;FreeMotionAnimationLoop&#39;</span>)</a>
<a class="sourceLine" id="cb11-2" title="2">rootNode.addObject(<span class="st">&#39;GenericConstraintSolver&#39;</span>, maxIterations<span class="op">=</span><span class="dv">10000</span>, tolerance<span class="op">=</span><span class="fl">1e-3</span>)</a></code></pre></div>
<a class="sourceLine" id="cb11-2" title="2">rootNode.addObject(<span class="st">&#39;ProjectedGaussSeidelConstraintSolver&#39;</span>, maxIterations<span class="op">=</span><span class="dv">10000</span>, tolerance<span class="op">=</span><span class="fl">1e-3</span>)</a></code></pre></div>
<div class="sourceCode" id="cb12"><pre class="sourceCode python"><code class="sourceCode python"><a class="sourceLine" id="cb12-1" title="1">finger.addObject(<span class="st">&#39;LinearSolverConstraintCorrection&#39;</span>, solverName<span class="op">=</span><span class="st">&#39;directSolver&#39;</span>)</a></code></pre></div>
<p>With all these components, the scene is now runable and can be used to inflate and deflate the finger.</p>
<p><a href="images/PneuNets-gripper_OneFingerBendingAll.png">Real images</a></p>
Expand Down Expand Up @@ -211,7 +211,7 @@ <h2 id="appendix">Appendix</h2>
<a class="sourceLine" id="cb18-24" title="24"> rootNode.addObject(<span class="st">&#39;VisualStyle&#39;</span>, displayFlags<span class="op">=</span><span class="st">&#39;showVisualModels hideBehaviorModels hideCollisionModels hideBoundingCollisionModels hideForceFields showInteractionForceFields hideWireframe&#39;</span>)</a>
<a class="sourceLine" id="cb18-25" title="25"> rootNode.findData(<span class="st">&#39;gravity&#39;</span>).value<span class="op">=</span>[<span class="op">-</span><span class="dv">9810</span>, <span class="dv">0</span>, <span class="dv">0</span>]<span class="op">;</span></a>
<a class="sourceLine" id="cb18-26" title="26"> rootNode.addObject(<span class="st">&#39;FreeMotionAnimationLoop&#39;</span>)</a>
<a class="sourceLine" id="cb18-27" title="27"> rootNode.addObject(<span class="st">&#39;GenericConstraintSolver&#39;</span>, tolerance<span class="op">=</span><span class="fl">1e-12</span>, maxIterations<span class="op">=</span><span class="dv">10000</span>)</a>
<a class="sourceLine" id="cb18-27" title="27"> rootNode.addObject(<span class="st">&#39;ProjectedGaussSeidelConstraintSolver&#39;</span>, tolerance<span class="op">=</span><span class="fl">1e-12</span>, maxIterations<span class="op">=</span><span class="dv">10000</span>)</a>
<a class="sourceLine" id="cb18-28" title="28"> rootNode.addObject(<span class="st">&#39;CollisionPipeline&#39;</span>)</a>
<a class="sourceLine" id="cb18-29" title="29"> rootNode.addObject(<span class="st">&#39;BruteForceDetection&#39;</span>)</a>
<a class="sourceLine" id="cb18-30" title="30"> rootNode.addObject(<span class="st">&#39;CollisionResponse&#39;</span>, response<span class="op">=</span><span class="st">&#39;FrictionContact&#39;</span>, responseParams<span class="op">=</span><span class="st">&#39;mu=0.6&#39;</span>)</a>
Expand Down
6 changes: 3 additions & 3 deletions examples/tutorials/PneunetGripper/pneunetgripper-tuto.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ In this case, the controller allows to interactively inflate the cavity by press

## Solving the constraints

To solve the constraints, such as the one define by the pressure actuator, we have to add to the rootNode the component FreeMotionAnimationLoop that will build up the system including constraints. The component GenericConstraintSolver will also be added to solve the constraints problem. Finally, we add the component LinearConstraintCorrection to the finger Node to take into account the correction due to the cavity constraint to the velocity and position:
To solve the constraints, such as the one define by the pressure actuator, we have to add to the rootNode the component FreeMotionAnimationLoop that will build up the system including constraints. The component ProjectedGaussSeidelConstraintSolver will also be added to solve the constraints problem. Finally, we add the component LinearConstraintCorrection to the finger Node to take into account the correction due to the cavity constraint to the velocity and position:
```python
rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('GenericConstraintSolver', maxIterations=10000, tolerance=1e-3)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=10000, tolerance=1e-3)
```

```python
Expand Down Expand Up @@ -226,7 +226,7 @@ def createScene(rootNode):
rootNode.addObject('VisualStyle', displayFlags='showVisualModels hideBehaviorModels hideCollisionModels hideBoundingCollisionModels hideForceFields showInteractionForceFields hideWireframe')
rootNode.findData('gravity').value=[-9810, 0, 0];
rootNode.addObject('FreeMotionAnimationLoop')
rootNode.addObject('GenericConstraintSolver', tolerance=1e-12, maxIterations=10000)
rootNode.addObject('ProjectedGaussSeidelConstraintSolver', tolerance=1e-12, maxIterations=10000)
rootNode.addObject('CollisionPipeline')
rootNode.addObject('BruteForceDetection')
rootNode.addObject('CollisionResponse', response='FrictionContactConstraint', responseParams='mu=0.6')
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/SoftArmGripper/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def addHeader(node):
node.addObject('RequiredPlugin', name='SoftRobots.Inverse')
node.addObject('QPInverseProblemSolver')
else:
node.addObject('GenericConstraintSolver', maxIterations=100, tolerance=0.001)
node.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=100, tolerance=0.001)
node.addObject('CollisionPipeline')
node.addObject('BruteForceBroadPhase')
node.addObject('BVHNarrowPhase')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def createScene(rootNode):
scene.addMainHeader()
scene.addObject('DefaultVisualManagerLoop')
scene.addObject('FreeMotionAnimationLoop')
scene.addObject('GenericConstraintSolver', maxIterations=50, tolerance=1e-5)
scene.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=50, tolerance=1e-5)
scene.Simulation.addObject('GenericConstraintCorrection')
scene.dt = 0.01
scene.gravity = [0., -9810., 0.]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __init__(self, *args, **kwargs):
self.numContact = 0

# Computation of the contact force applied on the object to grasp
self.node.getRoot().GenericConstraintSolver.computeConstraintForces.value = True
self.node.getRoot().ProjectedGaussSeidelConstraintSolver.computeConstraintForces.value = True

def onKeypressedEvent(self, event):
key = event['key']
Expand All @@ -150,7 +150,7 @@ def onAnimateBeginEvent(self, eventType):
self.actuator.ServoMotor.angleIn = angleInit + angularStep

# Computation of the contact force applied on the object to grasp
contactForces = self.node.getRoot().GenericConstraintSolver.constraintForces.value
contactForces = self.node.getRoot().ProjectedGaussSeidelConstraintSolver.constraintForces.value

# print the number of nodes in contact and the norm of the largest contact force
self.numContact = 0
Expand Down Expand Up @@ -183,7 +183,7 @@ def createScene(rootNode):

# Set up the pipeline for the collision computation
scene.addObject('FreeMotionAnimationLoop')
scene.addObject('GenericConstraintSolver', maxIterations=50, tolerance=1e-5)
scene.addObject('ProjectedGaussSeidelConstraintSolver', maxIterations=50, tolerance=1e-5)
scene.Simulation.addObject('GenericConstraintCorrection')
scene.Settings.mouseButton.stiffness = 10

Expand Down
Loading
Loading