diff --git a/rocolib/builders/ESPSegBuilder.py b/rocolib/builders/ESPSegBuilder.py index ee7f796d442c2b12fe8a04a3b4654952179268cf..1b002b4434a194170341ccd9dfeca4abab80344a 100644 --- a/rocolib/builders/ESPSegBuilder.py +++ b/rocolib/builders/ESPSegBuilder.py @@ -29,6 +29,7 @@ def depthfn(params = None, fnmod = None): # Set microcontroller c.addConstraint(("brain", "depth"), *depthfn()) c.addConstraint(("brain", "length"), "width") +c.addConstraint(("brain", "width"), "brain", "x.get('width')") for servo in ("right", "left"): c.addConstraint((servo, "length"), @@ -41,10 +42,10 @@ for servo in ("right", "left"): c.addConstConstraint(("right","flip"), True) # connections -c.addConnection(("brain", "topedge0"), +c.addConnection(("brain", "botedge0"), ("right", "topedge0"), angle=-90) -c.addConnection(("brain", "botedge0"), +c.addConnection(("brain", "topedge0"), ("left", "botedge0"), angle=-90) diff --git a/rocolib/library/ESPSeg.yaml b/rocolib/library/ESPSeg.yaml index 28215c3a9ff7f4d99b4fa496b30d506572f7d62f..3743f2b77ff87fe054f7561ae3dcb429b8786f26 100644 --- a/rocolib/library/ESPSeg.yaml +++ b/rocolib/library/ESPSeg.yaml @@ -1,13 +1,13 @@ connections: connection0: - - brain - - topedge0 + - botedge0 - - right - topedge0 - angle: -90 connection1: - - brain - - botedge0 + - topedge0 - - left - botedge0 - angle: -90 @@ -145,7 +145,7 @@ parameters: shoulderlength: 3.5 fs90r: horndepth: 2 - hornheight: 16 + hornheight: 11 hornlength: 10 hornoffset: 8 motorheight: 19 @@ -235,6 +235,9 @@ subcomponents: - driveservo length: parameter: width + width: + function: x.get('width') + parameter: brain left: classname: Wheel kwargs: diff --git a/rocolib/library/MountedServo.yaml b/rocolib/library/MountedServo.yaml index 59533eae6be6fd4f0ed49668b961fc6a7479407d..8754865a8ec54baa3e1e44b4b5ded91dfdd17cde 100644 --- a/rocolib/library/MountedServo.yaml +++ b/rocolib/library/MountedServo.yaml @@ -150,7 +150,7 @@ parameters: shoulderlength: 3.5 fs90r: horndepth: 2 - hornheight: 16 + hornheight: 11 hornlength: 10 hornoffset: 8 motorheight: 19 diff --git a/rocolib/library/ServoMotor.py b/rocolib/library/ServoMotor.py index 969c4a2b0c0cb6f525d841962ae43eba19d96c43..47fbbbbf9f177e2dbd4f36de96b70a4ae5e63b07 100644 --- a/rocolib/library/ServoMotor.py +++ b/rocolib/library/ServoMotor.py @@ -88,7 +88,7 @@ class ServoMotor(FoldedComponent): motorheight = 19, shoulderlength= 5, hornlength = 10, - hornheight = 16, + hornheight = 11, hornoffset = 8, horndepth = 2, ), diff --git a/rocolib/library/ServoMount.yaml b/rocolib/library/ServoMount.yaml index 45d9c9e63ebbef06b611ffa8755129071419b4df..c60f15883cd8960c3eb62fd3eb64c409ef962655 100644 --- a/rocolib/library/ServoMount.yaml +++ b/rocolib/library/ServoMount.yaml @@ -90,7 +90,7 @@ parameters: shoulderlength: 3.5 fs90r: horndepth: 2 - hornheight: 16 + hornheight: 11 hornlength: 10 hornoffset: 8 motorheight: 19 diff --git a/rocolib/library/TwoDOF.py b/rocolib/library/TwoDOF.py index 82bbe7277cf7789779028c4926c31edcf1eaaf80..b7edc10f6331e71c5a3b7c8c8048d3c3b9f2383a 100644 --- a/rocolib/library/TwoDOF.py +++ b/rocolib/library/TwoDOF.py @@ -1,33 +1,36 @@ -from rocolib.api.components import FoldedComponent -from rocolib.api.composables.graph.Face import Rectangle, Face - -class TwoDOF(FoldedComponent): - def define(self): - self.addParameter("mountlength", 40, paramType="length") - self.addParameter("handlelength", 15, paramType="length") - self.addParameter("thickness", 10, paramType="length") - self.addParameter("pitch", 135, paramType="angle") - self.addParameter("yaw", 60, paramType="angle") - - self.addEdgeInterface("mountedge", "mount.e0", "width") - self.addEdgeInterface("oaredge", "r2.e2", "h") - - def assemble(self): - t = self.p.thickness - w = self.p.mountlength - h = self.p.handlelength - p = self.p.pitch - y = self.p.yaw - - b = Face("", ((w, 0), (w, t), (w/2,t), (0,t), (0,0))) - b0 = Rectangle("", w, 0) - r1 = Rectangle("", w/2, t) - r2 = Rectangle("", h, t) - - self.addFace(b, "base") - self.attachEdge("base.e2", r1, "e0", prefix="r1", angle=-180) - self.attachEdge("r1.e3", r2, "e1", prefix="r2", angle=y) - self.attachEdge("base.e0", b0, "e2", prefix="mount", angle=p) - -if __name__ == "__main__": - TwoDOF.test() +from rocolib.api.components import FoldedComponent +from rocolib.api.composables.graph.Face import Rectangle, Face + +class TwoDOF(FoldedComponent): + def define(self): + self.addParameter("mountlength", 40, paramType="length") + self.addParameter("handlelength", 15, paramType="length") + self.addParameter("hingelength", 10, paramType="length") + self.addParameter("thickness", 10, paramType="length") + self.addParameter("pitch", 135, paramType="angle") + self.addParameter("yaw", 60, paramType="angle") + + self.addEdgeInterface("mountedge", "mount.e0", "mountlength") + self.addEdgeInterface("outedge", "r2.e2", "handlelength") + self.addEdgeInterface("handleedge", "r2.e3", "thickness") + + def assemble(self): + t = self.p.thickness + w = self.p.mountlength + x = self.p.hingelength + h = self.p.handlelength + p = self.p.pitch + y = self.p.yaw + + b = Face("", ((w, 0), (w, t), (w-x,t), (0,t), (0,0))) + b0 = Rectangle("", w, 0) + r1 = Rectangle("", x, t) + r2 = Rectangle("", h, t) + + self.addFace(b, "base") + self.attachEdge("base.e2", r1, "e0", prefix="r1", angle=-180) + self.attachEdge("r1.e3", r2, "e1", prefix="r2", angle=y) + self.attachEdge("base.e0", b0, "e2", prefix="mount", angle=p) + +if __name__ == "__main__": + TwoDOF.test() diff --git a/rocolib/library/Wheel.yaml b/rocolib/library/Wheel.yaml index 6de1d93af4b845fe912b2cf84b60e44275325bc3..00d9c75833ca03fc4009d8018b5da9b2355d0161 100644 --- a/rocolib/library/Wheel.yaml +++ b/rocolib/library/Wheel.yaml @@ -156,7 +156,7 @@ parameters: shoulderlength: 3.5 fs90r: horndepth: 2 - hornheight: 16 + hornheight: 11 hornlength: 10 hornoffset: 8 motorheight: 19