Skip to content

Commit 6fceaa2

Browse files
committed
Fix mpm depth convertion
1 parent c48fc1c commit 6fceaa2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)