Skip to content
Snippets Groups Projects
Commit 756386ce authored by mehtank's avatar mehtank
Browse files

Bobble cleanup

parent eaa2d9bf
No related merge requests found
from rocolib.api.components.Component import newComponent from rocolib.api.components.Component import newComponent
from rocolib.api.Function import Function
from rocolib.library import save from rocolib.library import save
c = newComponent("Bobble") c = newComponent("Bobble")
c.addParameter("headheight", 50, paramType="length")
c.addParameter("bodyheight", 75, paramType="length")
c.addParameter("bodywidth", 40, paramType="length")
c.addSubcomponent("drive", "DualMountedServo", inherit=True, prefix=None) c.addSubcomponent("drive", "DualMountedServo", inherit=True, prefix=None)
c.addSubcomponent("head", "Box", inherit="length") c.addSubcomponent("head", "Box")
c.addSubcomponent("body", "Box", inherit="length") c.addSubcomponent("body", "Box")
c.addSubcomponent("loop", "bobble:SimpleUChannel") c.addSubcomponent("loop", "SimpleUChannel")
c.delParameter("length") c.delParameter("length")
...@@ -26,19 +31,22 @@ c.addConstraint(("drive", "length"), "servo", l) ...@@ -26,19 +31,22 @@ c.addConstraint(("drive", "length"), "servo", l)
c.addConstraint(("head", "w"), "servo", d1) c.addConstraint(("head", "w"), "servo", d1)
c.addConstraint(("head", "l"), "servo", d1) c.addConstraint(("head", "l"), "servo", d1)
c.addConstraint(("head", "h"), "headheight")
c.addConstraint(("body", "w"), "servo", d2) c.addConstraint(("body", "w"), "bodywidth")
c.addConstraint(("body", "l"), "servo", d2) c.addConstraint(("body", "l"), "servo", d2)
c.addConstraint(("body", "h"), "bodyheight")
c.join(("body", "l.b"), ("loop", "ledge")) c.addConstraint(("loop", "length"), "bodywidth")
c.join(("body", "r.b"), ("loop", "redge"), tabWidth=8)
c.addConstraint(("loop", "width"), "servo", d2) c.addConstraint(("loop", "width"), "servo", d2)
c.addConstraint(("loop", "depth"), "servo", l) c.addConstraint(("loop", "depth"), "servo", l)
c.inheritAllInterfaces("drive", prefix=None) c.addConnection(("body", "l.b"), ("loop", "ledge"))
c.addConnection(("body", "r.b"), ("loop", "redge"), tabWidth=15)
c.addParameter("offset", (0,15), valueType="list")
c.addConnection(("drive", "motor1.horn"), c.addConnection(("drive", "motor1.horn"),
("head", "f.face"), copyDecorations=True) ("head", "f.face"), offset=Function("offset"), copyDecorations=True)
c.addConnection(("drive", "motor2.horn"), c.addConnection(("drive", "motor2.horn"),
("loop", "lface"), rotate=90, copyDecorations=True) ("loop", "lface"), rotate=90, copyDecorations=True)
......
connections:
connection0:
- - body
- l.b
- - loop
- ledge
- {}
connection1:
- - body
- r.b
- - loop
- redge
- tabWidth: 15
connection2:
- - drive
- motor1.horn
- - head
- f.face
- copyDecorations: true
offset:
parameter: offset
connection3:
- - drive
- motor2.horn
- - loop
- lface
- copyDecorations: true
rotate: 90
interfaces: {}
parameters:
_dx:
defaultValue: 0
spec:
hidden: true
minValue: null
units: mm
valueType: float
_dy:
defaultValue: 0
spec:
hidden: true
minValue: null
units: mm
valueType: float
_dz:
defaultValue: 0
spec:
hidden: true
minValue: null
units: mm
valueType: float
_q_a:
defaultValue: 1
spec:
hidden: true
maxValue: 1
minValue: -1
valueType: float
_q_i:
defaultValue: 0
spec:
hidden: true
maxValue: 1
minValue: -1
valueType: float
_q_j:
defaultValue: 0
spec:
hidden: true
maxValue: 1
minValue: -1
valueType: float
_q_k:
defaultValue: 0
spec:
hidden: true
maxValue: 1
minValue: -1
valueType: float
addTabs:
defaultValue: true
spec:
hidden: true
valueType: bool
bodyheight:
defaultValue: 75
spec:
minValue: 0
units: mm
valueType: float
bodywidth:
defaultValue: 40
spec:
minValue: 0
units: mm
valueType: float
centermount:
defaultValue: true
spec:
valueType: bool
flip:
defaultValue: false
spec:
valueType: bool
headheight:
defaultValue: 50
spec:
minValue: 0
units: mm
valueType: float
hornmount:
defaultValue: true
spec:
valueType: bool
hornslots:
defaultValue: true
spec:
valueType: bool
offset:
defaultValue:
- 0
- 15
spec:
valueType: list
pitch:
defaultValue: 15
spec:
maxValue: 360
minValue: 0
units: degrees
valueType: float
roll:
defaultValue: 10
spec:
maxValue: 360
minValue: 0
units: degrees
valueType: float
servo:
defaultValue: fs90r
spec:
values:
ds2g:
horndepth: 2
hornheight: 9
hornlength: 10
hornoffset: 4
hornwidth: 3
motorheight: 11
motorlength: 17
motorwidth: 8.5
shoulderlength: 3.5
fs90r:
horndepth: 2
hornheight: 11
hornlength: 10
hornoffset: 8
hornwidth: 5
motorheight: 19
motorlength: 23
motorwidth: 13
shoulderlength: 5
s4303r:
horndepth: 2
hornheight: 14
hornlength: 38
hornoffset: 7
hornwidth: 3
motorheight: 29
motorlength: 31
motorwidth: 17
shoulderlength: 10
tgy1370a:
horndepth: 2
hornheight: 10
hornlength: 7
hornoffset: 4
hornwidth: 3
motorheight: 14
motorlength: 20
motorwidth: 9
shoulderlength: 4
source: ../../../plugins/bobble/bobble/builders/BobbleBuilder.py
subcomponents:
body:
classname: Box
kwargs: {}
parameters:
h:
parameter: bodyheight
l:
function: 2 * (x.get("horndepth") + x.get("hornheight")) + x.get("motorwidth")
parameter: servo
w:
parameter: bodywidth
drive:
classname: DualMountedServo
kwargs: {}
parameters:
_dx:
parameter: _dx
_dy:
parameter: _dy
_dz:
parameter: _dz
_q_a:
parameter: _q_a
_q_i:
parameter: _q_i
_q_j:
parameter: _q_j
_q_k:
parameter: _q_k
addTabs:
parameter: addTabs
centermount:
parameter: centermount
flip:
parameter: flip
hornmount:
parameter: hornmount
hornslots:
parameter: hornslots
length:
function: 4 * x.get("shoulderlength") + x.get("motorlength")
parameter: servo
pitch:
parameter: pitch
roll:
parameter: roll
servo:
parameter: servo
head:
classname: Box
kwargs: {}
parameters:
h:
parameter: headheight
l:
function: 2 * (x.get("horndepth") + x.get("hornheight") + x.get("motorheight"))
+ x.get("motorwidth")
parameter: servo
w:
function: 2 * (x.get("horndepth") + x.get("hornheight") + x.get("motorheight"))
+ x.get("motorwidth")
parameter: servo
loop:
classname: SimpleUChannel
kwargs: {}
parameters:
depth:
function: 4 * x.get("shoulderlength") + x.get("motorlength")
parameter: servo
length:
parameter: bodywidth
width:
function: 2 * (x.get("horndepth") + x.get("hornheight")) + x.get("motorwidth")
parameter: servo
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment