File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ def __init__(self, parent=None):
2323 self .minStep = np .ones ((self .nMotors ))* (- np .inf )
2424 self .currentDirection = np .zeros ((self .nMotors ))
2525 self .currentPosition = np .zeros ((self .nMotors ))
26- self ._position = np .zeros ((self .nMotors )) # position from the last motor status update
2726
2827 self .minPosX = - np .inf
2928 self .minPosY = - np .inf
@@ -84,9 +83,9 @@ def _callback_motor_status(self, data):
8483 for iMotor in range (nSteppers ):
8584 stepperID = data ["steppers" ][iMotor ]["stepperid" ]
8685 # FIXME: smart to re-update this variable? Will be updated by motor-sender too
87- self ._position [stepperID ] = data ["steppers" ][iMotor ]["position" ] * stepSizes [stepperID ] - offSets [stepperID ]
86+ self .currentPosition [stepperID ] = data ["steppers" ][iMotor ]["position" ] * stepSizes [stepperID ] - offSets [stepperID ]
8887 if callable (self ._callbackPerKey [0 ]):
89- self ._callbackPerKey [0 ](self ._position ) # we call the function with the value
88+ self ._callbackPerKey [0 ](self .currentPosition ) # we call the function with the value
9089 except Exception as e :
9190 print ("Error in _callback_motor_status: " , e )
9291
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ def pairBT(self, timeout=1):
5555
5656 def espRestart (self ,timeout = 1 ):
5757 # if isController =True=> only PS jjoystick will be accepted
58+ # {"task":"/state_act", "restart":1}
5859 path = "/state_act"
5960 payload = {
6061 "restart" :1
You can’t perform that action at this time.
0 commit comments