diff --git a/Simulation/simulationCanvas.py b/Simulation/simulationCanvas.py index 10fe9d45..aedf1c9a 100644 --- a/Simulation/simulationCanvas.py +++ b/Simulation/simulationCanvas.py @@ -38,6 +38,7 @@ def initialize(self): self.leftChainOffset.bind(value=self.onSliderChange) self.rightChainOffset.bind(value=self.onSliderChange) self.rotationRadiusOffset.bind(value=self.onSliderChange) + self.chainSagCorrectionOffset.bind(value=self.onSliderChange) self.vertCGDist.bind(value=self.onSliderChange) self.gridSize.bind(value=self.onSliderChange) @@ -81,6 +82,7 @@ def resetSliders(self): self.leftChainOffset.value = 0 self.rightChainOffset.value = 0 self.rotationRadiusOffset.value = 0 + self.chainSagCorrectionOffset.value = 0 self.gridSize.value=300 def recompute(self): @@ -391,7 +393,10 @@ def onSliderChange(self, *args): self.distortedKinematics.rotationDiskRadius = self.correctKinematics.rotationDiskRadius + self.rotationRadiusOffset.value self.rotationRadiusLabel.text = "Rotation Radius\nSpacing Error: " + "%.2f" % self.rotationRadiusOffset.value + "mm" - + + self.distortedKinematics.chainSagCorrection = self.correctKinematics.chainSagCorrection + self.chainSagCorrectionOffset.value + self.chainSagCorrectionLabel.text = "Chain Sag\Correction Error: " + "%.2f" % self.chainSagCorrectionOffset.value + #self.machineLabel.text = "distance between sled attachments ideal: "+str(self.correctKinematics.l)+" actual: "+str(self.distortedKinematics.l)+"mm\nvertical distance between sled attachments and bit ideal: "+str(self.correctKinematics.s)+" actual: "+str(self.distortedKinematics.s)+"mm\nvertical distance between sled attachments and CG ideal: "+str(self.correctKinematics.h3+self.correctKinematics.s)+" actual: "+str(self.distortedKinematics.h3+self.distortedKinematics.s)+"mm\ndistance between motors ideal: "+str(self.correctKinematics.D)+" actual: "+str(self.distortedKinematics.D)+"mm" self.gridSizeLabel.text = "Grid Size: "+str(int(self.gridSize.value))+"mm" diff --git a/groundcontrol.kv b/groundcontrol.kv index 376aed01..a0baa90e 100755 --- a/groundcontrol.kv +++ b/groundcontrol.kv @@ -1223,6 +1223,8 @@ gridSizeLabel:gridSizeLabel rotationRadiusOffset:rotationRadiusOffset rotationRadiusLabel:rotationRadiusLabel + chainSagCorrectionOffset:chainSagCorrectionOffset + chainSagCorrectionLabel:chainSagCorrectionLabel kinematicsSelect:kinematicsSelect rows: 3 @@ -1344,6 +1346,18 @@ value: 0 disabled: root.isQuadKinematics id: rotationRadiusOffset + Label: + text: "Chain Sag Correction" + text_size: self.width, self.height + font_size: sp(self.height)/sp(3) + disabled: root.isQuadKinematics + id: chainSagCorrectionLabel + Slider: + min: -50 + max:50 + value: 0 + disabled: root.isQuadKinematics + id: chainSagCorrectionOffset Label: text: "Grid Size: 150mm" text_size: self.width, self.height