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

From NAMIC Wiki
Jump to: navigation, search
Line 3: Line 3:
 
If you have not added MyTutorialModule into your NaviTrack, please follow the instructions described in [[NaviTrack_Tutorial:Creating_Module|the last tutorial's page]].
 
If you have not added MyTutorialModule into your NaviTrack, please follow the instructions described in [[NaviTrack_Tutorial:Creating_Module|the last tutorial's page]].
  
===Getting archive===
+
==Getting archive==
 
Get zip archive [[Image:NTTutorial_May2007_2.zip]].
 
Get zip archive [[Image:NTTutorial_May2007_2.zip]].
  
===Deploy the files===
+
==Deploy the files==
 
Extract files from the archive. In UNIX:
 
Extract files from the archive. In UNIX:
 
  $ unzip NTTutorial_May2007_2.zip
 
  $ unzip NTTutorial_May2007_2.zip
Line 14: Line 14:
 
   inflating: NTTutorial_May2007_2/MyTutorialModule.cxx
 
   inflating: NTTutorial_May2007_2/MyTutorialModule.cxx
 
   inflating: NTTutorial_May2007_2/MyTutorialSink.cxx
 
   inflating: NTTutorial_May2007_2/MyTutorialSink.cxx
   inflating: NTTutorial_May2007_2/MyTutorialModule.h
+
    
  inflating: NTTutorial_May2007_2/MyTutorialSink.h
+
   ...
  inflating: NTTutorial_May2007_2/MyTutorialSource.h
+
    
  inflating: NTTutorial_May2007_2/human-00.pgm
 
  inflating: NTTutorial_May2007_2/human-01.pgm
 
  inflating: NTTutorial_May2007_2/human-02.pgm
 
  inflating: NTTutorial_May2007_2/human-03.pgm
 
  inflating: NTTutorial_May2007_2/human-04.pgm
 
  inflating: NTTutorial_May2007_2/Makefile.nosc.in
 
  inflating: NTTutorial_May2007_2/Makefile.sc.in
 
  inflating: NTTutorial_May2007_2/pgmimage.cxx
 
  inflating: NTTutorial_May2007_2/pgmimage.h
 
  inflating: NTTutorial_May2007_2/pullpos.cxx
 
   inflating: NTTutorial_May2007_2/pushimage.cxx
 
  inflating: NTTutorial_May2007_2/pushpos.cxx
 
  inflating: NTTutorial_May2007_2/simplecanvas.cxx
 
   inflating: NTTutorial_May2007_2/Makefile
 
  inflating: NTTutorial_May2007_2/simplecanvas.h
 
  inflating: NTTutorial_May2007_2/tutorial_consolesink.xml
 
  inflating: NTTutorial_May2007_2/tutorial_sink.xml
 
 
   inflating: NTTutorial_May2007_2/tutorial_source.xml
 
   inflating: NTTutorial_May2007_2/tutorial_source.xml
 
   inflating: NTTutorial_May2007_2/pullimage.cxx
 
   inflating: NTTutorial_May2007_2/pullimage.cxx
  
 +
Copy files to following directories
 
{| border="1"
 
{| border="1"
 
|- bgcolor="#abcdef"
 
|- bgcolor="#abcdef"
Line 70: Line 54:
 
|}
 
|}
  
 +
==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 [[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:27, 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

Back to Integrating into your application.