-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSError: POLARIS 0x13: Unable to initialize Tool-in-Port #40
Comments
Is this happening only after the recent change? |
Today was my first day trying out this library, so I don't have a previous point to compare to. I have been trying to get this library installed on my Windows machine too and have errors, but that's a separate issue. |
Does tracking work in ndi Track app? |
Yes, I have tracking working on the NDI app on my windows machine. When I run this script on my Mac the status lights change from green to amber, I hear a beep, then I get the error. I have updated the main post to include the verbose logs. |
Ok I will try to reproduce it on Monday. Do you know what hardware version your scu is? |
Thank you. Aurora V3.1 SCU kit - CR18 black |
How many tools do you have attached? The line where it fails (/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sksurgerynditracker/nditracker.py", line 394, in _find_wired_ports) is in a loop, if you have more than one tool can you find out if it's failing on a particular tool? |
I have 4 connected. I will try 1 at a time and get back to you |
I've created a development release of scikit-surgerynditracker that uses an older version of ndicapi as the back end. If you're still trying to debug you can do
Then try running you're script again using that version. |
Ok, I was able to connect 4 tools to an older SCU as well as a 3.1 SCU and everything worked as expected. It must have something to do with the python interface or something in the scikit code (unlikely, but possible). I will explore the scikit code and how it uses the python interface |
Can someone test with |
I've created a prebuilt binary of ndicapi and corresponding version of scikit-surgerynditracker incorporating the suggestion from @adamrankin (no Py_NDIErrcodeMacro(NDI_OKAY);). Feel free to use it if it helps with debugging. Install with:
Please do not confuse with the v1.0.0.dev40 version above. They are quite different despite the very similar names. |
I am getting identical errors with this test script. This is attempting with all 4 ports connected. I'll try one at a time and get back to you guys. import time
import six
from sksurgerynditracker.nditracker import NDITracker
import subprocess
import sys
def check_lib():
subprocess.check_call([sys.executable, "-m", "pip", "show", "scikit-surgerynditracker"])
def run():
settings_aurora = {
"tracker type": "aurora",
# "ports to probe": 3,
"verbose": True,
}
tracker = NDITracker(settings_aurora)
tracker.start_tracking()
six.print_(tracker.get_tool_descriptions())
for _ in range(20):
six.print_(tracker.get_frame())
time.sleep(0.300333)
tracker.stop_tracking()
tracker.close()
print("---------------")
check_lib()
print("---------------")
run() Output with
Output with
|
I have tried one port at a time for The error message is interesting to me since I have an Aurora device connected not Polaris. |
Would it be possible for scikit-surgerynditracker to perform a PSHR:01 and PHF loop before the PSHR:02 code? Plus also has a TSTOP and TSTART before and after the tool code, maybe that would help? |
@ulises-c I've created a new release for debugging. I don't expect it to fix the problem yet but it might at least give some useful information. Please can you try |
I'm not sure where to put these. I've had another look at the Plus code vtkPlusNDITracker.cxx lines 643 to 664 that I based the _find_wired_ports function on and I can't find any PSHR:01 and PHF loop etc. Could you give me a pointer please? |
@thompson318 592 to 621 |
@ulises-c , and another one for you to try. This one implements @adamrankin suggestion to add a loop to free ports before the loop to find and initialise wired ports. Let me know if it works or what output you get. |
I've tried both Output from
Output from
Test script import time
import six
from sksurgerynditracker.nditracker import NDITracker
import subprocess
import sys
def check_lib():
subprocess.check_call([sys.executable, "-m", "pip", "show", "scikit-surgerynditracker"])
def run():
settings_aurora = {
"tracker type": "aurora",
# "ports to probe": 3,
"verbose": True,
}
tracker = NDITracker(settings_aurora)
tracker.start_tracking()
six.print_(tracker.get_tool_descriptions())
for _ in range(20):
six.print_(tracker.get_frame())
time.sleep(0.300333)
tracker.stop_tracking()
tracker.close()
print("---------------")
check_lib()
print("---------------")
run() |
Are you able to try the latest Plus nightly and see if you can connect to your Aurora using that? |
I forgot to check the obvious, but when you try Plus or python, do you have Track (or Configure) running and connected to the tracker? |
Also, can you paste the Plus error log (click the red circle in the bottom right) here? |
Here are the Plus logs with the log level set to debug
|
I did just try connecting through Plus while having Track running and I get a different error log which is probably based on the COM port being used by Track, and Plus can't get access to it when it attempts to do so. Debug logs
|
Yes, not having it running is necessary to free up the COM port. Ok, moving on to other possible causes, but I'm at a bit of a loss. I'll examine the hex replies and see if I can figure something out. |
The fact that this fails with 2.8.0 shows that this is an issue with your particular setup. What that issue is though, I'm not sure. |
I may have found out why this was not working. The tools I'm using are not programmed so in order to initialize the tools I have to send a hex string with the tool definition using either the PVWR or PPWR command found in the API guide. In this library I believe the tool is initialized assuming the tool is already programmed. The hex string comes from an SROM with the tool definition. In the C++/C implementation I saw there was a function that takes in the SROM file path, opens it, and then outputs a hex string. |
That was it exactly. After flashing the tools the program is now working |
Thanks @ulises-c. Maybe this is a bug with SciKit-SurgeryNDITracker and PlusApp then. In SciKit-SurgeryNDITracker we have a function _read_sroms_from_file that flashes the tools but it is only called for Polaris and Vega initialisation. That is because I haven't encountered Aurora tools that need flashing before. |
Hello, I have scikit-surgerynditracker running on MacOS Ventura 13.5.2, and I am getting an error
OSError: POLARIS 0x13: Unable to initialize Tool-in-Port
.This is the script that I'm running to just test out the Aurora system.
Full error
The text was updated successfully, but these errors were encountered: