ephys_link.platforms.sensapex_manipulator
Sensapex manipulator API calls
Handles logic for calling Sensapex API functions. Also includes extra logic for safe
function calls, error handling, managing per-manipulator attributes, and returning the
appropriate callback parameters like in ephys_link.sensapex_handler
.
Classes
Representation of a single Sensapex manipulator |
- class SensapexManipulator(device: SensapexDevice)[source]
Bases:
object
Representation of a single Sensapex manipulator
- Parameters:
device – A Sensapex device
- class Movement(event: Event, position: list[float])[source]
Bases:
object
Movement data struct
- Parameters:
event – An asyncio event which fires upon completion of movement
position (list[float]) – A tuple of floats (x, y, z, w) representing the position to move to in µm
- get_pos() PositionalOutputData [source]
Get the current position of the manipulator and convert it into mm
- Returns:
Callback parameters (position in (x, y, z, w) (or an empty array on error), error message)
- Return type:
- async goto_pos(position: list[float], speed: float) PositionalOutputData [source]
Move manipulator to position
- Parameters:
position (list[float]) – The position to move to
speed (float) – The speed to move at (in µm/s)
- Returns:
Callback parameters (position in (x, y, z, w) (or an empty array on error), error message)
- Return type:
- async drive_to_depth(depth: float, speed: int) DriveToDepthOutputData [source]
Drive the manipulator to a certain depth
- Parameters:
depth (float) – The depth to drive to
speed (int) – The speed to drive at
- Returns:
Callback parameters (depth (or 0 on error), error message)
- Return type:
- set_inside_brain(inside: bool) None [source]
Set if the manipulator is inside the brain
Used to signal that the brain should move at
INSIDE_BRAIN_SPEED_LIMIT
- Parameters:
inside (bool) – True if the manipulator is inside the brain, False otherwise
- Returns:
None
- get_can_write() bool [source]
Return if the manipulator can move
- Returns:
True if the manipulator can move, False otherwise
- Return type:
bool
- set_can_write(can_write: bool, hours: float, sio: AsyncServer) None [source]
Set if the manipulator can move
- Parameters:
can_write (bool) – True if the manipulator can move, False otherwise
hours (float) – The number of hours to allow the manipulator to move (0 = forever)
sio (
socketio.AsyncServer
) – SocketIO object from server to emit reset event
- Returns:
None
- reset_can_write(sio: AsyncServer) None [source]
Reset the
can_write
flag- Parameters:
sio (
socketio.AsyncServer
) – SocketIO object from server to emit reset event- Returns:
None