Skip to content

Commit

Permalink
[tutorials] Tripod: cleaning (mostly warnings)
Browse files Browse the repository at this point in the history
  • Loading branch information
EulalieCoevoet committed Oct 23, 2023
1 parent 7ffd1eb commit d572479
Show file tree
Hide file tree
Showing 25 changed files with 746 additions and 441 deletions.
14 changes: 14 additions & 0 deletions examples/tutorials/Tripod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,17 @@
width="49%"/>

Open the file `tripod-tuto.py` with your runSofa application and follow the steps.

# Requirements

Install the module [serial](https://pyserial.readthedocs.io/en/latest/pyserial.html) for python:

```commandline
python -m pip install pyserial
```

or from Conda

```commandline
conda install pyserial
```
4 changes: 3 additions & 1 deletion examples/tutorials/Tripod/details/actuatedarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ def createScene(rootNode):
"Sofa.Component.Constraint.Projective", "Sofa.Component.IO.Mesh",
"Sofa.Component.LinearSolver.Direct", "Sofa.Component.Mass", "Sofa.Component.SolidMechanics.Spring",
"Sofa.Component.Topology.Container.Constant", "Sofa.Component.Visual",
"Sofa.GL.Component.Rendering3D", "Sofa.GUI.Component", ], iterative=False)
"Sofa.GL.Component.Rendering3D", "Sofa.GUI.Component",
"Sofa.Component.Mapping.NonLinear",
"Sofa.Component.StateContainer"], iterative=False)
scene.addMainHeader()
scene.addObject('DefaultVisualManagerLoop')
scene.addObject('FreeMotionAnimationLoop')
Expand Down
4 changes: 2 additions & 2 deletions examples/tutorials/Tripod/details/blueprint.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
'''
"""
Step 3:
Make re-usable element out of a blueprint
'''
"""
import Sofa


Expand Down
4 changes: 2 additions & 2 deletions examples/tutorials/Tripod/details/closedLoopController.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class EffectorController(Sofa.Core.Controller):

def __init__(self, *args, serialport=None, servomotors=None, **kwargs):
Sofa.Core.Controller.__init__(self, *args, **kwargs)
self.name = "InverseController"
self.name = "EffectorController"
self.referenceNode = args[1]

def onKeypressedEvent(self, event):
Expand Down Expand Up @@ -56,7 +56,7 @@ class CloseLoopController(Sofa.Core.Controller):

def __init__(self, *args, serialport=None, servomotors=None, **kwargs):
Sofa.Core.Controller.__init__(self, *args, **kwargs)
self.name = "InverseController"
self.name = "CloseLoopController"
self.nodeGoal = args[1]
self.referenceNode = args[2]
self.arduino = args[3]
Expand Down
Loading

0 comments on commit d572479

Please sign in to comment.