Difference between revisions of "2013 Summer Project Week:ProstateBRP"
From NAMIC Wiki
Line 45: | Line 45: | ||
==Protocol Definition== | ==Protocol Definition== | ||
− | [[ | + | [[ProstateBRP_OpenIGTLink_Communication_June_2013]] |
NOTE: THIS IS NOT THE FINAL VERSION. THE DEFINITION IS SUBJECT TO CHANGE. | NOTE: THIS IS NOT THE FINAL VERSION. THE DEFINITION IS SUBJECT TO CHANGE. |
Revision as of 20:29, 19 June 2013
Home < 2013 Summer Project Week:ProstateBRPKey Investigators
- WPI: Gregory Fischer, Nirav Patel
- BWH: Junichi Tokuda, Nobuhiko Hata, Clare Tempany
Objective
- Define and review the clinical workflow
- Define QA protocol
- Test a new OpenIGTLink-based communication protocol for Slicer-Robot integration.
Approach, Plan
Progress
- Discussion on June 18
- Greg, Andras, Junichi, Nirav, Csaba, Sebastian
- Integrate the protocol for BRP and Kuka's lightweight robot?
- It's not easy but could do per workphase
- The idea is to define message exchange protocol per workphase. Developer can decide which workhpases is going to be used.
- Navigation software can assume that the robot can handle the message exchange protocol only after getting acknowledgement message.
- Need a message format specialized for for sending command?
- �**Only missing feature we need is unique ID for query.
- Changing device name is a good solution.
- Changing device name is actually ideal solution for Slicer, because when it receives messages with different name, it will create new MRML nodes and can make sure that it will not be overwritten.
- Device name with unique query ID should be like: "CMD_12345" where "12345" is the unique query ID. The query ID does not have to be a numerical characters.
- When reply to "CMD_" message, the device name for the reply message should be "ACK_12345"
- The query ID is used only for queries that requires strict 1-to-1 correspondence between query and reply. For queries that does not require it, we use a device name without ID. For example, querying current position or status does not, because we are always interested in the latest position/device status.
Protocol Definition
ProstateBRP_OpenIGTLink_Communication_June_2013
NOTE: THIS IS NOT THE FINAL VERSION. THE DEFINITION IS SUBJECT TO CHANGE.
3D Slicer (operator) | Message | Robot Controller | Radiologist |
Start-up | |||
The operator presses "Start-up" button | |||
Send command to robot | >> STRING(COMMAND, START_UP) >> DEVICE_NAME=COMMAND, STRING=START_UP |
||
<< STRING(ACK, START_UP) << DEVICE_NAME=ACK, STRING=START_UP |
Echo back an acknowledgement command was received, but not yet completed | ||
Start up and initialize the hardware. Run the robot homing procedure if necessary (skip if already successfully completed). Move robot to home (loading) configuration. | |||
<< STATUS(START_UP, OK:??:??) << DEVICE_NAME=START_UP C=1(OK), SubCode=??, ErrorName=?? |
Confirm when robot is initialized TODO: Refine error/status codes |
||
Display the result of start up process. | |||
Planning | |||
The operator opens the planning panel | |||
>> STRING(COMMAND, PLANNING) >> | |||
<< STRING(ACK, PLANNING) << | Echo back an acknowledgement command was received | ||
Do nothing except keep track of current state, robot is awaiting next workphase. | |||
Show that the robot is in PLANNING phase. | |||
Calibration | |||
The operator opens the calibration panel | |||
>> STRING(COMMAND, CALIBRATION) >> | |||
<< STRING(ACK, CALIBRATION) << | Echo back an acknowledgement command was received | ||
Do nothing except keep track of current state, robot is awaiting calibration transform | |||
Show that the robot is in CALIBRATION phase. | |||
Nav Software (3D Slicer or RadVision) calculates calibration matrix | |||
>> TRANSFORM(CALIBRATION, 4x4 calibration matrix in RAS coordinates) >> | |||
<< TRANSFORM(ACK, 4x4 calibration matrix in RAS coordinates) << | Echo back an acknowledgement transform was received | ||
Update calibration transform, set flag that registration has been set externally, reply with confirmation | |||
<< STATUS(CALIBRATION, OK:??:??) << DEVICE_NAME=CALIBRATION C=1(OK), SubCode=??, ErrorName=?? |
Confirm that calibration was received and robot is ready for next workphase (targeting) | ||
Show that calibration successfully sent to robot. | |||
Targeting | |||
The operator enters "Targeting" mode | |||
>> STRING(COMMAND, TARGETING) >> | |||
<< STRING(ACK, TARGETING) << | Acknowledge receiving targeting command | ||
Confirm if robot is ready for targeting, check if calibration was received | |||
<< STATUS(TARGETING, OK:??:??) << DEVICE_NAME=TARGETING C=1(OK), SubCode=??, ErrorName=?? |
Confirm robot has entered targeting mode | ||
<< STATUS(TARGET, DNR:??:??) << DEVICE_NAME=TARGETING C=13(DeviceNotReady), SubCode=??, ErrorName=?? |
ERROR CASE: If not able to enter targeting mode (i.e. calibration not received, reply with Code:13 (Device Not Ready) | ||
The operator select a target, Nav software creates a 4x4 matrix for desired 6-DOF robot pose to reach the target | |||
>> TRANSFORM(TARGET, 4x4 target matrix in RAS coordinates) >> | |||
<< TRANSFORM(ACK, 4x4 target matrix) << | Acknowledge receipt of target transformation by echoing back | ||
Calculate if target pose is reachable based on the kinematics, reply with status and set target | |||
<< STATUS(TARGET, OK:??:??) << DEVICE_NAME=TARGETING C=1(OK), SubCode=??, ErrorName=?? |
Reply with OK if target was accepted | ||
<< TRANSFORM(TARGET_POSITION, 4x4 target matrix) << | Send actual target pose in robot controller if one was set (corresponds to when status comes back OK) | ||
<< STATUS(TARGET, DNR:??:??) << DEVICE_NAME=TARGET C=13(DeviceNotReady), SubCode=??, ErrorName=?? |
ERROR CASE: If not in targeting mode, reply with Code:13 (Device Not Ready) | ||
<< STATUS(TARGET, CE:??:??) << DEVICE_NAME=TARGET C=10(ConfigurationError), SubCode=??, ErrorName=?? |
ERROR CASE: If not a valid target (i.e. out of workspace), reply with Code:10 (ConfigurationError) | ||
Display the reachable target position set in robot controller. | |||
The operator confirms the target position set in the controller, and press "MOVE" | |||
>> STRING(COMMAND, MOVE_TO_TARGET) >> | |||
<< STRING(ACK, MOVE_TO_TARGET) << | Echo back an acknowledgement command was received (not yet completed) | ||
Alert the clinician to hold footpedal to align the robot | Clinician engages interlock (footpedal in scanner room) to enable robot motion. Robot will only move when interlock is engaged following a move command. | ||
The robot moves to the target and streams its pose during motion | |||
<< TRANSFORM(CURRENT_POSITION, 4x4 current robot pose matrix in RAS coordinates) << | Stream current robot pose in RAS coords as moving. Can also be requested (see below). | ||
Display the current robot position as it moves toward the target. | |||
Display that the robot is at the target. Send confirmation. | |||
<< STATUS(DONE_MOVING, OK:??:??) << DEVICE_NAME=DONE_MOVING C=1(OK), SubCode=??, ErrorName=?? |
Reply with OK when robot reaches target | ||
<< TRANSFORM(CURRENT_POSITION, 4x4 current robot pose matrix in RAS coordinates) << | Push out final robot pose in RAS coords as moving. (same format as previous stream - ensures last one is at final position) | ||
Display the current final robot position at the target. | |||
Needle Insertion (Manual) | |||
Ask to lock the robot | |||
The operator presses "Lock" button | |||
>> STRING (COMMAND, MANUAL) >> | |||
<< STRING(ACK, MANUAL) << | Echo back an acknowledgement command was received (not yet completed) | ||
Cut motor power to prevent motion of the robot base. This also eliminates causes of MR interference for insertion under live imaging. | |||
<< STATUS(MANUAL, OK:??:??) << DEVICE_NAME=MANUAL C=1(OK), SubCode=??, ErrorName=?? |
Reply with OK when robot is in a safe, locked state | ||
Insert a needle, optionally under live MR imaging. Perform intervention with the needle (biopsy or seed placement). | |||
Retract the needle | |||
Ask to unlock the robot and confirm needle is retracted | |||
The operator presses "Unlock" | |||
>> STRING(COMMAND, TARGETING) >> | |||
<< STRING(ACK, TARGETING) << | Acknowledge receiving targeting command | ||
Return robot to home (loading) position. ?? THIS MAKE SENSE HERE, SHOULD IT BE A SEPARATE 'HOME' COMMAND | |||
Return to targeting mode, check if ready for targeting. | |||
Additional Commands | |||
The operator presses "Stop" button | |||
>> STRING(COMMAND, STOP) >> | |||
The robot stops all motion. Stays in current state/workphase. | |||
<< STATUS(COMMAND, STOP) << | |||
The operator presses "Emergency" button | |||
>> STRING(COMMAND, EMERGENCY) >> | |||
The robot stops all motion and disables/locks motors. Switches to Emergency state/workphase. ?? IS THIS THE DESIRED ACTION | |||
<< STATUS(COMMAND, EMERGENCY) << | |||
Request current robot pose (or target or calibration transforms) | |||
>> GET_TRANSFORM(CURRENT_POSITION) >> | |||
The robot transmits current pose ("CURRENT_POSITION") through IGTLink upon request. This also works for requesting "TARGET_POSITION" and "CALIBRATION" transforms stored in robot controller. | |||
<< TRANSFORM(CURRENT_POSITION, 4x4 current robot pose matrix in RAS coordinates) << | |||
Request the robot status/workphase | |||
>> STRING(COMMAND, GET_STATUS) >> ?? CONFIRM COMMAND STRUCTURE FOR STATUS REQUEST | |||
Sends current state/workphase. ?? SHOULD IT SEND OTHER INFO TOO | |||
<< STATUS(COMMAND, Current Status) << | |||
Robot controller sends errors or notifications through IGTLink. Transmitted asynchronously with error text in message body. To be used with limit events, hardware failures, invalid commands, etc. | |||
<< STATUS(ERROR, Error Text) << |
Delivery Mechanism
The work will be delivered as a 3D Slicer extension. The code is hosted at https://github.com/ProstateBRP/BRPProstateNav