Skip to content

Commit

Permalink
ensure proper return value for getpos in esp32
Browse files Browse the repository at this point in the history
  • Loading branch information
beniroquai committed Aug 3, 2023
1 parent cac306a commit 0c10464
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion imswitch/imcontrol/controller/controllers/MCTController.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def takeTimelapseThread(self, tperiod = 1):
# set speed
self.stages.setSpeed(speed=10000, axis="X")
self.stages.setSpeed(speed=10000, axis="Y")
self.stages.setSpeed(speed=1000, axis="Z")
self.stages.setSpeed(speed=10000, axis="Z")

# ensure motors are enabled
#self.stages.enalbeMotors(enable=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ def getPosition(self):
# load position from device
# t,x,y,z
try:
allPositions = self._motor.get_position()
allPositions = np.float(self._motor.get_position())
except:
allPositions = [0,0,0,0]
allPositions = [0.,0.,0.,0.]
allPositionsDict={"X": allPositions[1], "Y": allPositions[2], "Z": allPositions[3], "T": allPositions[0]}
for iPosAxis, iPosVal in allPositionsDict.items():
self.setPosition(iPosVal,iPosAxis)
Expand Down

0 comments on commit 0c10464

Please sign in to comment.