NaviTrack Tutorial:Integrating:How to use sample codes

From NAMIC Wiki
Jump to: navigation, search
Home < NaviTrack Tutorial:Integrating:How to use sample codes

Installing sample codes

The sample codes provided here are based on the codes used in the last tutorial. If you have not added MyTutorialModule into your NaviTrack, please follow the instructions described in the last tutorial's page.

Getting archive

Get zip archive File:NTTutorial May2007 2.zip.

Deploy the files

Extract files from the archive. In UNIX:

$ unzip NTTutorial_May2007_2.zip
Archive:  ./NTTutorial_May2007_2.zip

Archive: ../NTTutorial_May2007_2.zip

  creating: NTTutorial_May2007_2/
 inflating: NTTutorial_May2007_2/MyTutorialModule.cxx
 inflating: NTTutorial_May2007_2/MyTutorialSink.cxx
 
 ...
 
 inflating: NTTutorial_May2007_2/tutorial_source.xml
 inflating: NTTutorial_May2007_2/pullimage.cxx

Copy files to following directories

File name Description Copy to
MyTutorial*.cxx NaviTrack Module NaviTrack/src/input
MyTutorial*.h NaviTrack Module headers NaviTrack/include/OpenTracker/input
Makefile Makefile for sample application Working directory
Makefile.nosc.in Makefile parameters (for systems w/o GTK+) Working directory
Makefile.sc.in Makefile parameters (for systems w/ GTK+ Working directory
pushpos.cxx Sample application to send coordinate data Working directory
pullpos.cxx Sample application to receive coordinate data Working directory
pushimage.cxx Sample application to send image data Working directory
pullimage.cxx Sample application to receive image data Working directory
pgmimage.* Library to read/write PGM image format Working directory
simplecanvas.* Library to display image (requires GTK+) Working directory
tutorial_source.xml NaviTrack configuration for pushpos and pushimage Working directory
tutorial_sink.xml NaviTrack configuration for pullpos and pullimage Working directory
human-0?.pgm Images for demo Working directory

Rebuild NaviTrack

Go to NaviTrack directory and just run make.

$ cd NaviTrack
$ make

Build applications

Build with GTK+ (enabling image display function)

Edit Makefile line 1 and 2 as follows:

#include ./Makefile.nosc.in     # no viewer
include ./Makefile.sc.in       # use simple image viewer (requires GTK+)

Edit Makefile.sc.in for your environment:

NTDIR   = /projects/igtdev/tokuda/NaviTrack/branches/nt-brp
CXX     = g++
LIBS    = -lNaviTrack
INCDIR  = -I${NTDIR}/include
LIBDIR  = -L. -L${NTDIR}

Run make:

$ make clean
$ make

=Build without GTK+ (disabling image display function)

Edit Makefile line 1 and 2 as follows:

include ./Makefile.nosc.in     # no viewer
#include ./Makefile.sc.in       # use simple image viewer (requires GTK+)

Edit Makefile.nosc.in for your environment:

NTDIR   = /projects/igtdev/tokuda/NaviTrack/branches/nt-brp
CXX     = g++
LIBS    = -lNaviTrack
INCDIR  = -I${NTDIR}/include
LIBDIR  = -L. -L${NTDIR}

Run make:

$ make clean
$ make

Back to Integrating into your application.