-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathlab_empty.py
More file actions
30 lines (24 loc) · 1.03 KB
/
lab_empty.py
File metadata and controls
30 lines (24 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
def createScene(rootnode):
from emio.utils.header import addHeader, addSolvers
from emio.parts.controllers.assemblycontroller import AssemblyController
from emio import Emio
settings, modelling, simulation = addHeader(rootnode, inverse=True)
rootnode.VisualStyle.displayFlags = ["showVisual", "showInteractionForceFields"]
# Units are: s, mm, kg
rootnode.dt = 0.01
rootnode.gravity = [0., -9810., 0.]
# Add Emio to the scene
emio = Emio(name="Emio",
legsName=["blueleg"],
legsModel=["beam"],
legsPositionOnMotor=["counterclockwiseup", "clockwiseup", "counterclockwiseup", "clockwiseup"],
centerPartName="yellowpart",
centerPartType="rigid",
extended=False)
if not emio.isValid():
return
simulation.addChild(emio)
addSolvers(emio, rayleighMass=0, rayleighStiffness=0)
emio.attachCenterPartToLegs()
assemblycontroller = AssemblyController(emio)
emio.addObject(assemblycontroller)