Commit 321d4324 authored by Stephen Thompson's avatar Stephen Thompson

Issue #3 tidied docs, renamed example to demo

parent 907a5f68
......@@ -2,5 +2,5 @@
omit =
./sksurgerynditracker/_version.py
./sksurgerynditracker/__init__.py
./sksurgerynditracker/example.py
./sksurgerynditracker/demo.py
.. include:: ../README.rst
Contents
~~~~~~~~
========
.. toctree::
:maxdepth: 1
......
#! /user/bin/python
"""
Example showing how to initialise, configure, and communicate
with NDI Polaris, Vega, and Aurora trackers.
"""
import time
import six
from sksurgerynditracker.nditracker import NDITracker
def run():
"""Demonstration program
Example showing how to initialise, configure, and communicate
with NDI Polaris, Vega, and Aurora trackers.
Configuration is by python dictionaries, edit as necessary.
Dictionaries for other systems:
settings_polaris = {"tracker type": "polaris",
"romfiles" : ["../data/8700339.rom"]}
settings_aurora = { "tracker type": "aurora",}
settings_dummy = {"tracker type": "dummy",}
"""
settings_vega = {
"tracker type": "vega",
"ip address" : "192.168.2.17",
"port" : 8765,
"romfiles" : [
"../data/8700339.rom",
"../data/something_else.rom"]
}
tracker = NDITracker()
tracker.connect(settings_vega)
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()
#! /user/bin/python
"""Brief example showing how to initialise, configure, and communicate
with NDI Polaris, Vega, and Aurora trackers."""
import time
import six
from sksurgerynditracker.nditracker import NDITracker
#configuration.
SETTINGS_VEGA = {
"tracker type": "vega",
"ip address" : "192.168.2.17",
"port" : 8765,
"romfiles" : [
"../data/8700339.rom",
"../data/something_else.rom"]
}
SETTINGS_POLARIS = {
"tracker type": "polaris",
"romfiles" : [
"../data/8700339.rom"]
}
SETTINGS_AURORA = {
"tracker type": "aurora",
}
SETTINGS_DUMMY = {
"tracker type": "dummy",
}
TRACKER = NDITracker()
TRACKER.connect(SETTINGS_VEGA)
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()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment