Difference between revisions of "NaviTrack Tutorial:Integrating:How to use sample codes"

From NAMIC Wiki
Jump to: navigation, search
Line 91: Line 91:
 
  $ make clean
 
  $ make clean
 
  $ make
 
  $ make
 +
 +
=Running the applications=
 +
==Coordinate data==
 +
Open two terminals and go to the directory where the programs exists.
 +
 +
Terminal 1 (pushpos: sending side)
 +
$ ./pushpos tutorial_source.xml
 +
 +
Terminal 2 (pullpos: receiving side)
 +
$ ./pullpos tutorial_sink.xml
 +
 +
 +
 +
 +
  
 
Back to [[NaviTrack_Tutorial:Integrating_into_your_application|Integrating into your application]].
 
Back to [[NaviTrack_Tutorial:Integrating_into_your_application|Integrating into your application]].

Revision as of 14:32, 25 May 2007

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

Running the applications

Coordinate data

Open two terminals and go to the directory where the programs exists.

Terminal 1 (pushpos: sending side)

$ ./pushpos tutorial_source.xml

Terminal 2 (pullpos: receiving side)

$ ./pullpos tutorial_sink.xml




Back to Integrating into your application.