Skip to content
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

Init problems see https://github.com/PlusToolkit/ndicapi/issues/40 #79

Open
thompson318 opened this issue Nov 7, 2023 · 6 comments
Open

Comments

@thompson318
Copy link
Collaborator

No description provided.

@thompson318
Copy link
Collaborator Author

PlusToolkit/ndicapi#40

@ulises-c
Copy link

This error appears when using the Aurora system without having a programmed tool. There are three approaches to solve this:

  1. Write to the read-only memory using the PPWR function in the API guide (not recommended by NDI)
  2. Write to the read-only memory using Cygna-6D (recommended by NDI, if the tool won't require customization/calibration)
  3. Temporarily flash the tool using the PVWR function in the API guide (recommended by NDI)

I believe approach 3 is doable as long as the user has an SROM file to flash. The C++ combined API sample (provided by NDI support) has a function dedicated to doing this where it takes in the SROM file and converts it to a series of hex strings that are then sent with the PVWR command.

@thompson318
Copy link
Collaborator Author

As a quick experiment, could you let me know what happens if you try and initialise the tracker as a Polaris? Like
SETTINGS = { "tracker type": "polaris", "romfiles" : ["../data/8700339.rom"] }
with romfiles edited to the location of your srom files? Looking at my code it is nearly identical for Aurora and Polaris, the only difference is the romfiles, so it might just work.

@ulises-c
Copy link

ulises-c commented Jan 2, 2024

I get some errors with reading the SROM file.

PS C:\Users\uchavarria\OneDrive - Laza\Documents\GitHub\Laza-Mini-Projects\NDI Tracking> & C:/Users/uchavarria/.pyenv/pyenv-win/versions/3.9.13/python.exe "c:/Users/uchavarria/OneDrive - Laza/Documents/GitHub/Laza-Mini-Projects/NDI Tracking/ndi_scikit_demo.py"
Traceback (most recent call last):
  File "c:\Users\uchavarria\OneDrive - Laza\Documents\GitHub\Laza-Mini-Projects\NDI Tracking\ndi_scikit_demo.py", line 89, in <module>
    run()
  File "c:\Users\uchavarria\OneDrive - Laza\Documents\GitHub\Laza-Mini-Projects\NDI Tracking\ndi_scikit_demo.py", line 57, in run
    tracker = NDITracker(SETTINGS)
  File "C:\Users\uchavarria\.pyenv\pyenv-win\versions\3.9.13\lib\site-packages\sksurgerynditracker\nditracker.py", line 146, in __init__
    self._connect_polaris(configuration)
  File "C:\Users\uchavarria\.pyenv\pyenv-win\versions\3.9.13\lib\site-packages\sksurgerynditracker\nditracker.py", line 198, in _connect_polaris
    self._read_sroms_from_file()
  File "C:\Users\uchavarria\.pyenv\pyenv-win\versions\3.9.13\lib\site-packages\sksurgerynditracker\nditracker.py", line 346, in _read_sroms_from_file    
    ndicapy.ndiCommand(self._device, 'PHRQ:*********1****')
OSError: POLARIS 0x01: Invalid command

Code used

import time
import six
from sksurgerynditracker.nditracker import NDITracker

def run():
    SETTINGS = { "tracker type": "polaris", "romfiles" : ["DDRO-080-061-01_GENERIC.rom"] }
    tracker = NDITracker(SETTINGS)
    tracker.start_tracking()

    six.print_(tracker.get_tool_descriptions())
    for _ in range(20):
        print(f"--- --- --- Timestamp - {time.localtime()}")
        six.print_(tracker.get_frame())
        time.sleep(1/60) # 60 Hz
    tracker.stop_tracking()
    tracker.close()
run()

@thompson318
Copy link
Collaborator Author

Thanks for posting the output, it looks like it isn't going to be straight forward.

I'm struggling to spend any time to this issue and also don't think we have the right hardware to test at the moment. I'm going to leave this issue open in the hope that we can add this feature at some point, but it probably won't be any time soon. If you are able to do any development or testing we would happily accept any code contributions.

@ulises-c
Copy link

I'll be working with this system for the next few weeks so I'll see what I can do in that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants