Skip to content
Snippets Groups Projects
Commit b02615a9 authored by pjil27's avatar pjil27
Browse files

ESP32STACK for boat

parent b569a669
No related merge requests found
......@@ -3,26 +3,53 @@ from rocolib.api.components.Component import Component
#ESP3 STACK WITH PWM SERVO FEATHERWING
c = Component()
c.addSubcomponent("stack", "SubESP32Stack")
c.addSubcomponent("boat", "BoatBase")
#the length of the both should always be a multiple of the width of the motor
#as of now i will be setting the length to 117 (so that means 9 * width of the motor which is 13)
c.addParameter("length", 130, paramType="length")
c.addParameter("width", 50, paramType="length")
c.addParameter("depth", 40, paramType="length")
c.addParameter("brains", "esp32stack", paramType="dimension")
c.addParameter("boat.depth", 20, paramType="length")
c.addConstraint(("boat", "boat.length"), "length")
c.addConstraint(("boat", "boat.width"), "width")
c.addConstraint(("boat", "boat.depth"), "depth")
for i in range(2):
c.addSubcomponent("splitside%d" %i, "SplitEdge")
c.addConstraint(("splitside%d" %i, "toplength"), "length", "(x,)")
c.addConstraint(("splitside%d" %i, "botlength"), ("length", "brains"),
'(getDim(x[1], "width")/2., getDim(x[1], "width")/2., '
'getDim(x[1], "width")/2., getDim(x[1], "width")/2., getDim(x[1], "width")/2., getDim(x[1], "width")/2. ,getDim(x[1], "width")/2., x[0] - 7 * (getDim(x[1], "width")/2))')
c.addSubcomponent("stack", "SubESP32Stack")
for i in range(4):
c.addSubcomponent("support%d" %i, "Rectangle")
c.addConstraint(("support%d" %i, "w"), "brains", "getDim(x, 'width')/2.")
c.addConstraint(("support%d" %i, "l"), "boat.depth")
c.addConstraint(("support%d" %i, "l"), "depth")
for i in range(2):
c.addSubcomponent("split%d" %i, "SplitEdge")
c.addConstraint(("split%d" %i, "toplength"), "brains", '(getDim(x, "width"),)')
c.addConstraint(("split%d" % i, "botlength"), "brains", '(getDim(x, "width")/2.,getDim(x, "width")/2.)')
c.addConnection(("stack", "topedge2"), ("split0", "topedge0"))
c.addConnection(("stack", "botedge2"), ("split1", "topedge0"))
c.addConnection(("stack", "topedge0"), ("split0", "topedge0"))
c.addConnection(("stack", "botedge0"), ("split1", "topedge0"))
c.addConnection(("split0", "botedge0"), ("support0", "l"), angle=90)
c.addConnection(("split0", "botedge1"), ("support1", "l"), angle=90)
c.addConnection(("split1", "botedge0"), ("support2", "l"), angle=90)
c.addConnection(("split1", "botedge1"), ("support3", "l"), angle=90)
c.addConnection(("splitside0", "topedge0"), ("boat", "staredge"))
c.addConnection(("splitside1", "topedge0"), ("boat", "portedge"))
c.addConnection(("support0", "r"), ("splitside0", "botedge4"), tabWidth=5)
c.addConnection(("support1", "r"), ("splitside0", "botedge5"), tabWidth=5)
c.addConnection(("support2", "r"), ("splitside1", "botedge5"), tabWidth=5)
c.addConnection(("support3", "r"), ("splitside1", "botedge6"), tabWidth=5)
c.toLibrary("ESP32StackBoat")
\ No newline at end of file
connections:
connection0:
- - stack
- topedge2
- topedge0
- - split0
- topedge0
- {}
connection1:
- - stack
- botedge2
- botedge0
- - split1
- topedge0
- {}
connection10:
- - support2
- r
- - splitside1
- botedge5
- tabWidth: 5
connection11:
- - support3
- r
- - splitside1
- botedge6
- tabWidth: 5
connection2:
- - split0
- botedge0
......@@ -35,20 +47,66 @@ connections:
- - support3
- l
- angle: 90
connection6:
- - splitside0
- topedge0
- - boat
- staredge
- {}
connection7:
- - splitside1
- topedge0
- - boat
- portedge
- {}
connection8:
- - support0
- r
- - splitside0
- botedge4
- tabWidth: 5
connection9:
- - support1
- r
- - splitside0
- botedge5
- tabWidth: 5
interfaces: {}
parameters:
boat.depth:
defaultValue: 20
brains:
defaultValue: esp32stack
spec:
valueType: str
depth:
defaultValue: 40
spec:
minValue: 0
units: mm
valueType: (float, int)
brains:
defaultValue: esp32stack
length:
defaultValue: 130
spec:
valueType: str
minValue: 0
units: mm
valueType: (float, int)
width:
defaultValue: 50
spec:
minValue: 0
units: mm
valueType: (float, int)
source: ..\builders\ESP32StackBoatBuilder.py
subcomponents:
boat:
classname: BoatBase
kwargs: {}
parameters:
boat.depth:
parameter: depth
boat.length:
parameter: length
boat.width:
parameter: width
split0:
classname: SplitEdge
kwargs: {}
......@@ -69,6 +127,32 @@ subcomponents:
toplength:
function: (getDim(x, "width"),)
parameter: brains
splitside0:
classname: SplitEdge
kwargs: {}
parameters:
botlength:
function: (getDim(x[1], "width")/2., getDim(x[1], "width")/2., getDim(x[1],
"width")/2., getDim(x[1], "width")/2., getDim(x[1], "width")/2., getDim(x[1],
"width")/2. ,getDim(x[1], "width")/2., x[0] - 7 * (getDim(x[1], "width")/2))
parameter: &id001
- length
- brains
toplength:
function: (x,)
parameter: length
splitside1:
classname: SplitEdge
kwargs: {}
parameters:
botlength:
function: (getDim(x[1], "width")/2., getDim(x[1], "width")/2., getDim(x[1],
"width")/2., getDim(x[1], "width")/2., getDim(x[1], "width")/2., getDim(x[1],
"width")/2. ,getDim(x[1], "width")/2., x[0] - 7 * (getDim(x[1], "width")/2))
parameter: *id001
toplength:
function: (x,)
parameter: length
stack:
classname: SubESP32Stack
kwargs: {}
......@@ -78,7 +162,7 @@ subcomponents:
kwargs: {}
parameters:
l:
parameter: boat.depth
parameter: depth
w:
function: getDim(x, 'width')/2.
parameter: brains
......@@ -87,7 +171,7 @@ subcomponents:
kwargs: {}
parameters:
l:
parameter: boat.depth
parameter: depth
w:
function: getDim(x, 'width')/2.
parameter: brains
......@@ -96,7 +180,7 @@ subcomponents:
kwargs: {}
parameters:
l:
parameter: boat.depth
parameter: depth
w:
function: getDim(x, 'width')/2.
parameter: brains
......@@ -105,7 +189,7 @@ subcomponents:
kwargs: {}
parameters:
l:
parameter: boat.depth
parameter: depth
w:
function: getDim(x, 'width')/2.
parameter: brains
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