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

Cannot tracking more than 2 tools. #67

Closed
jsbyysheng opened this issue Apr 19, 2023 · 5 comments
Closed

Cannot tracking more than 2 tools. #67

jsbyysheng opened this issue Apr 19, 2023 · 5 comments

Comments

@jsbyysheng
Copy link

Thank you very much for scikit-surgerynditracker, it's a great library! However, I encountered a problem when using it on Ubuntu 20.04. If I provide more than 2 rom files, I get the following error. All rom files have been tested by NDI Track software.

[[nan nan nan nan]
 [nan nan nan nan]
 [nan nan nan nan]
 [nan nan nan nan]]
[[ 7.29017033e-01 -3.61322553e-01 -5.81360626e-01 -5.23241959e+01]
 [ 4.44580051e-01 -3.95852235e-01  8.03523233e-01  4.12811699e+01]
 [-5.20463969e-01 -8.44243460e-01 -1.27946223e-01 -1.64897363e+03]
 [ 0.00000000e+00  0.00000000e+00  0.00000000e+00  1.00000000e+00]]
[[nan nan nan nan]
 [nan nan nan nan]
 [nan nan nan nan]
 [nan nan nan nan]]
[[nan nan nan nan]
 [nan nan nan nan]
 [nan nan nan nan]
 [nan nan nan nan]]
[[ 7.29017033e-01 -3.61322553e-01 -5.81360626e-01 -5.23241959e+01]
 [ 4.44580051e-01 -3.95852235e-01  8.03523233e-01  4.12811699e+01]
 [-5.20463969e-01 -8.44243460e-01 -1.27946223e-01 -1.64897363e+03]
 [ 0.00000000e+00  0.00000000e+00  0.00000000e+00  1.00000000e+00]]
[[nan nan nan nan]
 [nan nan nan nan]
 [nan nan nan nan]
 [nan nan nan nan]]
[[nan nan nan nan]
 [nan nan nan nan]
 [nan nan nan nan]
 [nan nan nan nan]]
[[ 7.29017033e-01 -3.61322553e-01 -5.81360626e-01 -5.23241959e+01]
 [ 4.44580051e-01 -3.95852235e-01  8.03523233e-01  4.12811699e+01]
 [-5.20463969e-01 -8.44243460e-01 -1.27946223e-01 -1.64897363e+03]
 [ 0.00000000e+00  0.00000000e+00  0.00000000e+00  1.00000000e+00]]
[[nan nan nan nan]
 [nan nan nan nan]
 [nan nan nan nan]
 [nan nan nan nan]]
Traceback (most recent call last):
  File "/home/avadakedavra/Workspace/catkin_ws/src/drivers/ros_ndi_sensors/ros_ndi_tracker/scripts/test.py", line 17, in <module>
    port_handles, timestamps, framenumbers, tracking, quality = TRACKER.get_frame()
  File "/home/avadakedavra/.local/lib/python3.8/site-packages/sksurgerynditracker/nditracker.py", line 453, in get_frame
    ndicapy.ndiCommand(self._device, self._capture_string)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x81 in position 2: invalid start byte

System: Ubuntu 20.04
Python: 3.8
Hardware: Polaris Spectra
Software:0.2.3

@thompson318
Copy link
Collaborator

Hello, thanks for raising this. We've had this issue before, see #17 (comment). By default we use binary data transfer "BX" but this seems to cause trouble on some devices so we can also use text transfer "TX", which should be slower but is fine in most instances. This is done by the function "_set_use_bx_transforms".
If you can work out what firmware your Spectra is using then add it to the list at line 164 that should fix your problem.
Please let me know if that works for you and if so what firmware you're using. Then if you want you can edit it and raise a pull request.

@jsbyysheng
Copy link
Author

It works. My hardware is Polaris Spectra Rev 007. Thank you very much!.

thompson318 added a commit that referenced this issue Apr 19, 2023
Issue #67 added Spectra rev 007 to list of firmware to use TX transforms
@thompson318
Copy link
Collaborator

Fixed at release 0.2.4

@robot300795
Copy link

Also works with the Polaris Vicra Rev 007

@thompson318
Copy link
Collaborator

Also works with the Polaris Vicra Rev 007

Thanks @robot300795 for letting us know. We'd welcome a pull request to fix if you're able, otherwise we'll update it at some point.

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

3 participants