Skip to content

Commit 5c9483d

Browse files
authored
Fix mpm depth handling (#507)
* Fix mpm depth convertion * Version bump
1 parent 93e6354 commit 5c9483d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/ephys_link/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.2.1"
1+
__version__ = "2.2.2"

src/ephys_link/bindings/mpm_binding.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ async def set_depth(self, manipulator_id: str, depth: float, speed: float) -> fl
206206
# Keep track of the previous depth to check if the manipulator stopped advancing unexpectedly.
207207
current_depth = (await self.get_position(manipulator_id)).w
208208
previous_depth = current_depth
209+
depth = self.get_dimensions().w - depth
209210
unchanged_counter = 0
210211

211212
# Send move request.
@@ -244,7 +245,7 @@ async def set_depth(self, manipulator_id: str, depth: float, speed: float) -> fl
244245
self._movement_stopped = False
245246

246247
# Return the final depth.
247-
return float((await self.get_position(manipulator_id)).w)
248+
return float(self.get_dimensions().w - (await self.get_position(manipulator_id)).w)
248249

249250
@override
250251
async def stop(self, manipulator_id: str) -> None:

0 commit comments

Comments
 (0)