Closed ulises-c closed 8 months ago
Is this happening only after the recent change?
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. I just fixed the issue by using pyenv-win and using python 3.9.13
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
pip install scikit-surgerynditracker==v1.0.0.dev40
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
Py_NDIErrcodeMacro(NDI_OKAY);
removed from the python module code?
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:
pip install scikit-surgerynditracker==v1.0.1.dev40
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 scikit-surgerynditracker==v1.0.0.dev40
---------------
Name: scikit-surgerynditracker
Version: 1.0.0.dev40
Summary: Interface for Northern Digital (NDI) Trackers with data to NumPy arrays
Home-page: https://github.com/SciKit-Surgery/scikit-surgerynditracker
Author: Stephen Thompson
Author-email: s.thompson@ucl.ac.uk
License: BSD-3 license
Location: /Users/ulises/Documents/GitHub/Laza-Mini-Projects/env1/lib/python3.9/site-packages
Requires: ndicapi, numpy, pyserial, scikit-surgerycore, six
Required-by:
---------------
Probing port: 0 got name: /dev/cu.wlan-debug Result: 259
Probing port: 1 got name: /dev/cu.Bluetooth-Incoming-Port Result: 259
Probing port: 2 got name: /dev/cu.usbserial-1320 Result: 0
Traceback (most recent call last):
File "/Users/ulises/Documents/GitHub/Laza-Mini-Projects/env1/ndi_scikit_demo.py", line 31, in <module>
run()
File "/Users/ulises/Documents/GitHub/Laza-Mini-Projects/env1/ndi_scikit_demo.py", line 17, in run
tracker = NDITracker(settings_aurora)
File "/Users/ulises/Documents/GitHub/Laza-Mini-Projects/env1/lib/python3.9/site-packages/sksurgerynditracker/nditracker.py", line 143, in __init__
self._connect_aurora(configuration)
File "/Users/ulises/Documents/GitHub/Laza-Mini-Projects/env1/lib/python3.9/site-packages/sksurgerynditracker/nditracker.py", line 203, in _connect_aurora
self._find_wired_ports()
File "/Users/ulises/Documents/GitHub/Laza-Mini-Projects/env1/lib/python3.9/site-packages/sksurgerynditracker/nditracker.py", line 394, in _find_wired_ports
ndicapy.ndiCommand(self._device,
OSError: POLARIS 0x13: Unable to initialize Tool-in-Port
Output with scikit-surgerynditracker==v1.0.1.dev40
---------------
Name: scikit-surgerynditracker
Version: 1.0.1.dev40
Summary: Interface for Northern Digital (NDI) Trackers with data to NumPy arrays
Home-page: https://github.com/SciKit-Surgery/scikit-surgerynditracker
Author: Stephen Thompson
Author-email: s.thompson@ucl.ac.uk
License: BSD-3 license
Location: /Users/ulises/Documents/GitHub/Laza-Mini-Projects/env1/lib/python3.9/site-packages
Requires: ndicapi, numpy, pyserial, scikit-surgerycore, six
Required-by:
---------------
Probing port: 0 got name: /dev/cu.wlan-debug Result: 259
Probing port: 1 got name: /dev/cu.Bluetooth-Incoming-Port Result: 259
Probing port: 2 got name: /dev/cu.usbserial-1320 Result: 0
Traceback (most recent call last):
File "/Users/ulises/Documents/GitHub/Laza-Mini-Projects/env1/ndi_scikit_demo.py", line 31, in <module>
run()
File "/Users/ulises/Documents/GitHub/Laza-Mini-Projects/env1/ndi_scikit_demo.py", line 17, in run
tracker = NDITracker(settings_aurora)
File "/Users/ulises/Documents/GitHub/Laza-Mini-Projects/env1/lib/python3.9/site-packages/sksurgerynditracker/nditracker.py", line 143, in __init__
self._connect_aurora(configuration)
File "/Users/ulises/Documents/GitHub/Laza-Mini-Projects/env1/lib/python3.9/site-packages/sksurgerynditracker/nditracker.py", line 203, in _connect_aurora
self._find_wired_ports()
File "/Users/ulises/Documents/GitHub/Laza-Mini-Projects/env1/lib/python3.9/site-packages/sksurgerynditracker/nditracker.py", line 394, in _find_wired_ports
ndicapy.ndiCommand(self._device,
OSError: POLARIS 0x13: Unable to initialize Tool-in-Port
I have tried one port at a time for scikit-surgerynditracker==v1.0.0.dev40
, scikit-surgerynditracker==v1.0.1.dev40
, and scikit-surgerynditracker==v1.0.0
and get the same error. OSError: POLARIS0x13: Unable to initialize Tool-in-Port
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
pip install scikit-surgerynditracker==v1.0.1.dev401
then re-run your code with verbose set to True and post the output here?
@adamrankin
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?
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.
pip install scikit-surgerynditracker==v1.0.1.dev402
I've tried both v1.0.1.dev401
and v1.0.1.dev402
. I am still getting the same error. Tested on both macOS 13.5.2 and Windows 11
Output from v1.0.1.dev402
Name: scikit-surgerynditracker
Version: 1.0.1.dev402
Summary: Interface for Northern Digital (NDI) Trackers with data to NumPy arrays
Home-page: https://github.com/SciKit-Surgery/scikit-surgerynditracker
Author: Stephen Thompson
Author-email: s.thompson@ucl.ac.uk
License: BSD-3 license
Location: c:\users\uchavarria\.pyenv\pyenv-win\versions\3.9.13\lib\site-packages
Requires: ndicapi, numpy, pyserial, scikit-surgerycore, six
Required-by:
---------------
Probing port: 0 got name: COM6 Result: 0
Found 4 wired tools.
Attempting to initialise tool 0
With port handle 10
Traceback (most recent call last):
File "c:\Users\uchavarria\OneDrive - Laza\Documents\GitHub\Laza-Mini-Projects\NDI Tracking\ndi_scikit.py", line 31, in <module>
run()
File "c:\Users\uchavarria\OneDrive - Laza\Documents\GitHub\Laza-Mini-Projects\NDI Tracking\ndi_scikit.py", line 17, in run
tracker = NDITracker(settings_aurora)
File "C:\Users\uchavarria\.pyenv\pyenv-win\versions\3.9.13\lib\site-packages\sksurgerynditracker\nditracker.py", line 143, in __init__
self._connect_aurora(configuration)
File "C:\Users\uchavarria\.pyenv\pyenv-win\versions\3.9.13\lib\site-packages\sksurgerynditracker\nditracker.py", line 203, in _connect_aurora
self._find_wired_ports(configuration.get('verbose', False))
File "C:\Users\uchavarria\.pyenv\pyenv-win\versions\3.9.13\lib\site-packages\sksurgerynditracker\nditracker.py", line 408, in _find_wired_ports
ndicapy.ndiCommand(self._device,
OSError: POLARIS 0x13: Unable to initialize Tool-in-Port
Output from v1.0.1.dev401
---------------
Name: scikit-surgerynditracker
Version: 1.0.1.dev401
Summary: Interface for Northern Digital (NDI) Trackers with data to NumPy arrays
Home-page: https://github.com/SciKit-Surgery/scikit-surgerynditracker
Author: Stephen Thompson
Author-email: s.thompson@ucl.ac.uk
License: BSD-3 license
Location: c:\users\uchavarria\.pyenv\pyenv-win\versions\3.9.13\lib\site-packages
Requires: ndicapi, numpy, pyserial, scikit-surgerycore, six
Required-by:
---------------
Probing port: 0 got name: COM6 Result: 0
Found 4 wired tools.
Attempting to initialise tool 0
With port handle 10
Traceback (most recent call last):
File "c:\Users\uchavarria\OneDrive - Laza\Documents\GitHub\Laza-Mini-Projects\NDI Tracking\ndi_scikit.py", line 31, in <module>
run()
File "c:\Users\uchavarria\OneDrive - Laza\Documents\GitHub\Laza-Mini-Projects\NDI Tracking\ndi_scikit.py", line 17, in run
tracker = NDITracker(settings_aurora)
File "C:\Users\uchavarria\.pyenv\pyenv-win\versions\3.9.13\lib\site-packages\sksurgerynditracker\nditracker.py", line 143, in __init__
self._connect_aurora(configuration)
File "C:\Users\uchavarria\.pyenv\pyenv-win\versions\3.9.13\lib\site-packages\sksurgerynditracker\nditracker.py", line 203, in _connect_aurora
self._find_wired_ports(configuration.get('verbose', False))
File "C:\Users\uchavarria\.pyenv\pyenv-win\versions\3.9.13\lib\site-packages\sksurgerynditracker\nditracker.py", line 402, in _find_wired_ports
ndicapy.ndiCommand(self._device,
OSError: POLARIS 0x13: Unable to initialize Tool-in-Port
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?
Sure I can try that. Which repo is that?
I have tried with the PlusApp-2.8.0.20190617-Win64
application and changed SerialPort=4
to SerialPort=COM7
on PlusDeviceSet_Server_NDIAurora.xml
and I get a beep from the Aurora system but the connection fails. The GUI shows me this.
I did follow the instructions and only had one tool connected.
Just to verify the system is working I launched NDI Track and everything works fine.
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
|INFO|000.219000| Software version: Plus-2.8.0.96b89a6c - Win64| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(122)
|INFO|000.219000| Logging at level 3 to file: C:/Users/uchavarria/PlusApp-2.8.0.20190617-Win64/data/111023_111446_PlusLog.txt| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(123)
|INFO|000.356000| Supported devices: - 3dConnexion (ver: Plus-2.8.0) - AuroraTracker (ver: NDICAPI-1.7) - BkProFocusOem (ver: Plus-2.8.0) - ChRobotics (ver: Plus-2.8.0) - Epiphan (ver: Plus-2.8.0) - FakeTracker (ver: Plus-2.8.0) - GenericSerialDevice (ver: Plus-2.8.0) - ICCapturing (ver: The Imaging Source UDSHL-3.4) - ImageProcessor (ver: Plus-2.8.0) - IntelRealSense (ver: Plus-2.8.0) - Microchip (ver: Plus-2.8.0) - MmfVideo (ver: Plus-2.8.0) - NDITracker (ver: NDICAPI-1.7) - NoiseVideo (ver: Plus-2.8.0) - OpenCVVideo (ver: Plus-2.8.0) - OpenIGTLinkTracker (ver: OpenIGTLink v3.1.0) - OpenIGTLinkVideo (ver: OpenIGTLink v3.1.0) - OptiTrack (ver: Plus-2.8.0) - OpticalMarkerTracker (ver: Plus-2.8.0) - PhidgetSpatial (ver: Plus-2.8.0) - PolarisTracker (ver: NDICAPI-1.7) - SavedDataSource (ver: Plus-2.8.0) - UsSimulator (ver: Plus-2.8.0) - VFWVideo (ver: Plus-2.8.0) - VirtualBufferedCapture (ver: Plus-2.8.0) - VirtualCapture (ver: Plus-2.8.0) - VirtualDiscCapture (ver: Plus-2.8.0) - VirtualMixer (ver: Plus-2.8.0) - VirtualSwitcher (ver: Plus-2.8.0) - VirtualVolumeReconstructor (ver: Plus-2.8.0) | in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(127)
|INFO|000.365000| Server host name: LZ-UCHAVA5550| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(158)
|INFO|000.381000| Server host domain: shifamed.com| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(161)
|INFO|000.386000| Server IP addresses: 169.254.191.195, 169.254.181.226, 169.254.8.67, 10.11.20.84, 169.254.213.86, 127.0.0.1| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(178)
|INFO|000.386000| Start remote control server at port: 18904| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(187)
|DEBUG|008.052000| Application configuration file 'C:/Users/uchavarria/PlusApp-2.8.0.20190617-Win64/bin/PlusConfig.xml' saved| in E:\D\PSNP64b\PlusLib\src\PlusCommon\vtkPlusConfig.cxx(532)
|INFO|008.052000| Connect using configuration file: C:\Users\uchavarria\PlusApp-2.8.0.20190617-Win64\config\PlusDeviceSet_Server_NDIAurora.xml| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(639)
|INFO|008.053000| Server process command line: "C:/Users/uchavarria/PlusApp-2.8.0.20190617-Win64/bin/PlusServer.exe" --config-file="PlusDeviceSet_Server_NDIAurora.xml" --verbose=5| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(320)
|INFO|008.728000| Server process started successfully| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(329)
|INFO|010.538000|SERVER> System start timestamp: 3198
|INFO|010.539000|SERVER> Software version: Plus-2.8.0.96b89a6c - Win64| in tkPlusLogger(188)
|INFO|010.539000|SERVER> Logging at level 5 (TRACE) to file: C:/Users/uchavarria/PlusApp-2.8.0.20190617-Win64/data/111023_111454_PlusLog.txt| in :\D\PSNP64b\PlusLib\src\PlusServer\Tools\PlusServer.cxx(81)
|DEBUG|010.540000|SERVER> Device set configuration is read from file: PlusDeviceSet_Server_NDIAurora.xml| in :\D\PSNP64b\PlusLib\src\PlusCommon\vtkPlusConfig.cxx(245)
|DEBUG|010.540000| Device set configuration file contents:
|INFO|010.541000|SERVER>
|INFO|010.541000|SERVER>
|INFO|010.541000|SERVER>
|INFO|010.541000|SERVER>
|INFO|010.542000|SERVER>
|INFO|010.542000|SERVER>
|INFO|010.542000|SERVER>
|INFO|010.543000|SERVER>
|INFO|010.543000|SERVER>
|INFO|010.543000|SERVER>
|INFO|010.543000|SERVER>
|INFO|010.544000|SERVER>
|INFO|010.544000|SERVER>
|INFO|010.544000|SERVER>
|INFO|010.544000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|INFO|010.545000|SERVER>
|DEBUG|010.545000|SERVER> StartupDelaySec: 1.000000| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDataCollector.cxx(89)
|DEBUG|010.545000|SERVER> Buffer size is not defined in source element "NeedleToTracker". Using default buffer size: 150| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDataSource.cxx(392)
|DEBUG|010.546000|SERVER> AveragedItemsForFiltering is not defined in source element "NeedleToTracker". Using default value: 20| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDataSource.cxx(402)
|DEBUG|010.546000|SERVER> TrackerDevice: Unable to find acquisition rate in device element when it is required, using default 50| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDevice.cxx(1000)
|DEBUG|010.546000|SERVER> TrackerDevice: Local time offset was not defined in device configuration| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDevice.cxx(1053)
|DEBUG|010.546000|SERVER> CaptureDevice: Unable to find acquisition rate in device element when it is required, using default 30| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDevice.cxx(1000)
|DEBUG|010.546000|SERVER> CaptureDevice: Local time offset was not defined in device configuration| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDevice.cxx(1053)
|INFO|010.546000|SERVER> Server status: Reading configuration.| in :\D\PSNP64b\PlusLib\src\PlusServer\Tools\PlusServer.cxx(92)
|DEBUG|010.546000|SERVER> vtkPlusTransformRepository::ReadConfiguration: no CoordinateDefinitions element was found| in :\D\PSNP64b\PlusLib\src\PlusCommon\vtkPlusTransformRepository.cxx(625)
|INFO|010.546000|SERVER> Server status: Connecting to devices.| in :\D\PSNP64b\PlusLib\src\PlusServer\Tools\PlusServer.cxx(103)
|DEBUG|010.546000|SERVER> TrackerDevice: vtkPlusDevice::Connect: TrackerDevice| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDevice.cxx(1134)
|DEBUG|010.547000|SERVER> Testing serial port: COM1| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.547000|SERVER> Testing serial port: COM2| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.547000|SERVER> Testing serial port: COM3| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.547000|SERVER> Testing serial port: COM4| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.547000|SERVER> Testing serial port: COM5| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.547000|SERVER> Testing serial port: COM6| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.547000|SERVER> Testing serial port: COM7| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.547000|SERVER> Testing serial port: COM8| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.547000|SERVER> Serial port COM1 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.547000|SERVER> Testing serial port: COM9| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.547000|SERVER> Serial port COM3 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.547000|SERVER> Serial port COM4 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.547000|SERVER> Testing serial port: \\.\COM10| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.548000|SERVER> Serial port COM6 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.548000|SERVER> Serial port COM5 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.548000|SERVER> Testing serial port: \\.\COM11| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.548000|SERVER> Serial port COM2 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.548000|SERVER> Serial port COM9 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.548000|SERVER> Serial port \\.\COM10 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.548000|SERVER> Serial port COM8 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.548000|SERVER> Testing serial port: \\.\COM12| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.548000|SERVER> Testing serial port: \\.\COM13| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.548000|SERVER> Testing serial port: \\.\COM14| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.548000|SERVER> Serial port \\.\COM12 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.548000|SERVER> Testing serial port: \\.\COM15| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.548000|SERVER> Serial port \\.\COM13 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.548000|SERVER> Testing serial port: \\.\COM16| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.549000|SERVER> Serial port \\.\COM11 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.549000|SERVER> Testing serial port: \\.\COM17| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.549000|SERVER> Testing serial port: \\.\COM18| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.549000|SERVER> Serial port \\.\COM17 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.549000|SERVER> Serial port \\.\COM14 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.549000|SERVER> Serial port \\.\COM15 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.549000|SERVER> Testing serial port: \\.\COM19| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.549000|SERVER> Serial port \\.\COM18 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.549000|SERVER> Serial port \\.\COM16 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.549000|SERVER> Testing serial port: \\.\COM20| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1411)
|DEBUG|010.549000|SERVER> Serial port \\.\COM19 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.549000|SERVER> Serial port \\.\COM20 probe error (257): Error opening serial connection| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.549000|SERVER> Serial port COM7 probe error (0): No error| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(1418)
|DEBUG|010.550000|SERVER> NDI Command:COMM:70000| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|010.575000|SERVER> NDI Reply:| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|DEBUG|010.575000|SERVER> NDI Command:COMM:60000| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|010.702000|SERVER> NDI Reply: OKAY| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|DEBUG|010.702000|SERVER> NDI Command:PHSR:01| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|010.706000|SERVER> NDI Reply: 00| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|DEBUG|010.707000|SERVER> NDI Command:PHSR:02| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|010.708000|SERVER> NDI Reply: 040A0010B0010C0010D001| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|DEBUG|010.709000|SERVER> NDI Command:PINIT:0A| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|010.817000|SERVER> NDI Reply:| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|ERROR|010.817000|SERVER> Unable to initialize Tool-in-Port. errnum: 19| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(684)
|DEBUG|010.829000|SERVER> NDI Command:PINIT:0B| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|010.930000|SERVER> NDI Reply:| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|ERROR|010.930000|SERVER> Unable to initialize Tool-in-Port. errnum: 19| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(684)
|DEBUG|010.930000|SERVER> NDI Command:PINIT:0C| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|011.043000|SERVER> NDI Reply:| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|ERROR|011.044000|SERVER> Unable to initialize Tool-in-Port. errnum: 19| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(684)
|DEBUG|011.044000|SERVER> NDI Command:PINIT:0D| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|011.156000|SERVER> NDI Reply:| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|ERROR|011.156000|SERVER> Unable to initialize Tool-in-Port. errnum: 19| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(684)
|DEBUG|011.156000|SERVER> NDI Command:PHSR:03| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|011.160000|SERVER> NDI Reply: 00| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|DEBUG|011.160000|SERVER> NDI Command:PHSR:00| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|011.162000|SERVER> NDI Reply: 040A0010B0010C0010D001| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|DEBUG|011.162000|SERVER> NDI Command:PHINF:0A0021| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|011.164000|SERVER> NDI Reply: 00000000 0000000000001F1-38928100100| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|DEBUG|011.164000|SERVER> NDI Command:PHSR:00| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|011.166000|SERVER> NDI Reply: 040A0010B0010C0010D001| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|DEBUG|011.166000|SERVER> NDI Command:PHINF:0A0025| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(246)
|DEBUG|011.169000|SERVER> NDI Reply: 00000000 0000000000001 F1-38928100100| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(276)
|ERROR|011.169000|SERVER> Failed to enable NDI tool NeedleToTracker| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(791)
|ERROR|011.169000|SERVER> Failed to enable tool ports| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\NDICAPITracking\vtkPlusNDITracker.cxx(319)
|ERROR|011.170000|SERVER> TrackerDevice: Cannot connect to data source, ConnectInternal failed| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDevice.cxx(1147)
|ERROR|011.170000|SERVER> Unable to connect device: TrackerDevice.| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDataCollector.cxx(353)
|DEBUG|011.170000|SERVER> CaptureDevice: vtkPlusDevice::Connect: CaptureDevice| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDevice.cxx(1134)
|DEBUG|011.170000|SERVER> TrackerDevice: vtkPlusDevice::Disconnect| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDevice.cxx(1159)
|DEBUG|011.170000|SERVER> TrackerDevice: Data source is already disconnected| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDevice.cxx(1163)
|DEBUG|011.171000|SERVER> CaptureDevice: vtkPlusDevice::Disconnect| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDevice.cxx(1159)
|DEBUG|011.171000|SERVER> vtkPlusDataCollector::Disconnect: All devices have been disconnected| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDataCollector.cxx(393)
|DEBUG|011.171000|SERVER> No saved data source devices were found that use original timestamps, so synchronization of loop times is not performed| in :\D\PSNP64b\PlusLib\src\PlusDataCollection\vtkPlusDataCollector.cxx(674)
|ERROR|011.171000|SERVER> Datacollector failed to connect to devices| in :\D\PSNP64b\PlusLib\src\PlusServer\Tools\PlusServer.cxx(106)
|ERROR|011.366000| Server stopped unexpectedly. Return code: 1| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(864)
|INFO|011.366000| Disconnect request successful| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(632)
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?
I do not have Track or Configure running. I wasn't aware of this module
Actually I don't have NDI Track running since I have tried before while attempting to connect it to the same COM port, but that prevents connection via pyserial. I attempted it while creating my own Aurora drivers .
I have not tried to have NDI Track running while using Plus or Scikit python for NDI
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
|INFO|000.045000| Software version: Plus-2.8.0.96b89a6c - Win64| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(122)
|INFO|000.045000| Logging at level 3 to file: C:/Users/uchavarria/PlusApp-2.8.0.20190617-Win64/data/111023_113233_PlusLog.txt| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(123)
|INFO|000.082000| Supported devices: - 3dConnexion (ver: Plus-2.8.0) - AuroraTracker (ver: NDICAPI-1.7) - BkProFocusOem (ver: Plus-2.8.0) - ChRobotics (ver: Plus-2.8.0) - Epiphan (ver: Plus-2.8.0) - FakeTracker (ver: Plus-2.8.0) - GenericSerialDevice (ver: Plus-2.8.0) - ICCapturing (ver: The Imaging Source UDSHL-3.4) - ImageProcessor (ver: Plus-2.8.0) - IntelRealSense (ver: Plus-2.8.0) - Microchip (ver: Plus-2.8.0) - MmfVideo (ver: Plus-2.8.0) - NDITracker (ver: NDICAPI-1.7) - NoiseVideo (ver: Plus-2.8.0) - OpenCVVideo (ver: Plus-2.8.0) - OpenIGTLinkTracker (ver: OpenIGTLink v3.1.0) - OpenIGTLinkVideo (ver: OpenIGTLink v3.1.0) - OptiTrack (ver: Plus-2.8.0) - OpticalMarkerTracker (ver: Plus-2.8.0) - PhidgetSpatial (ver: Plus-2.8.0) - PolarisTracker (ver: NDICAPI-1.7) - SavedDataSource (ver: Plus-2.8.0) - UsSimulator (ver: Plus-2.8.0) - VFWVideo (ver: Plus-2.8.0) - VirtualBufferedCapture (ver: Plus-2.8.0) - VirtualCapture (ver: Plus-2.8.0) - VirtualDiscCapture (ver: Plus-2.8.0) - VirtualMixer (ver: Plus-2.8.0) - VirtualSwitcher (ver: Plus-2.8.0) - VirtualVolumeReconstructor (ver: Plus-2.8.0) | in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(127)
|INFO|000.090000| Server host name: LZ-UCHAVA5550| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(158)
|INFO|000.106000| Server host domain: shifamed.com| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(161)
|INFO|000.111000| Server IP addresses: 169.254.191.195, 169.254.181.226, 169.254.8.67, 10.11.20.84, 169.254.213.86, 127.0.0.1| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(178)
|INFO|000.112000| Start remote control server at port: 18904| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(187)
|DEBUG|009.193000| Application configuration file 'C:/Users/uchavarria/PlusApp-2.8.0.20190617-Win64/bin/PlusConfig.xml' saved| in E:\D\PSNP64b\PlusLib\src\PlusCommon\vtkPlusConfig.cxx(532)
|INFO|009.194000| Connect using configuration file: C:\Users\uchavarria\PlusApp-2.8.0.20190617-Win64\config\PlusDeviceSet_Server_NDIAurora.xml| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(639)
|INFO|009.195000| Server process command line: "C:/Users/uchavarria/PlusApp-2.8.0.20190617-Win64/bin/PlusServer.exe" --config-file="PlusDeviceSet_Server_NDIAurora.xml" --verbose=4| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(320)
|ERROR|009.393000| Server stopped unexpectedly. Return code: 1| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(864)
|INFO|009.407000| Disconnect request successful| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(632)
|ERROR|009.408000| Failed to start server process| in E:\D\PSNP64b\PlusApp\PlusServerLauncher\PlusServerLauncherMainWindow.cxx(338)
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. I think this issue can be closed but if you're interested you could post more details of your hardware setup and solution here https://github.com/SciKit-Surgery/scikit-surgerynditracker/issues/79.
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