JJ's neattools modules, some for Viz build 13 modules

Download January 2000 modules and NTLs, unzip to neattools directory

Download Viz VRML files that go with above NTLs, unzip to viz directory

Visualizer documentation is separate, look here for Java 3D visualizer documentation.

01/25/00 additions

Added JJNTLFileObj, which is identical to JNTLLFileObj, which loads an NTL file. The only difference is that the JJNTLFileObj module accepts a JString input which it loads. This allows it to work with the JNTLFetcherObj below, to fetch an NTL file from a remote site, then to load that NTL file.

01/22/00 additions

Added JNTLFetcherObj for that allows NTL files to be downloaded from a web server. The NTL files are converted into HTML format (using ntl2html), the JWebServerObj then downloads these, converts them back into NTL format.

01/13/00 additions

Added JSpeechRecognizerObj for speech recognition, requires Microsoft Speech SDK.

Added JTTSObj for text-to-speech output, requires Microsoft Speech SDK (probably only needs subset, but I have whole thing installed, not sure which part is absolutely necessary)

01/12/00 additions

Added JDialerObj for outdialing from neattools.

01/06/00 additions

Added Winamp control module for controlling Winamp MP3 player.

01/04/00 additions

Updated tMonitor so that it takes command line parameter indicating "hang-up" DTMF sequence (used to always hang up with '*'). Now tMonitor starts with command line "123" causes tMonitor to hang up when DTMF "123" entered. Note: file "connect.txt" must exist, indicates machine to send DTMF to, can be "localhost"

12/10/99 additions

Updated tMonitor so that it no longer requires DLL.

12/01/99 additions

Modified JPolhemusObj module to support intersense tracker. The intersense tracker (see intersense site for more details) is supposedly compatible with the Polhemus FastTrak. The tests I did showed slight differences in the output format, so I modified the existing polhemus module to handle those differences. See Intersense NTL example for a working example.

11/22/99 additions

New DTMF detector program tMonitor that sends DTMF to neattools.

tMonitor Instructions

To run the tMonitor program:
  1. Unzip dtmf.zip into the neat directory.
  2. If you want tMonitor to send DTMF to another computer on the network, edit the file connect.txt to have a single line with the name of the remote computer.

    For example, to send tMonitor digits to neattools on computer JJworkstation, edit connect.txt to have a single line:

    JJworkstation
    
  3. By default, tMonitor hangs up phone when a * DTMF is detected. To override this, start tMonitor with a command line sequence that should cause it to hang up.

    For example, to cause the sequence "##**" cause the hangup, start tMonitor as follows:

    tMonitor "##**"
    
  4. run neattools, load file DTMF.ntl. This file lights up LED display for each DTMF pressed.
Here's some screen shots of DTMF.ntl in action (letters are fuzzy because I typed them in too hard):

When not connected to tMonitor, DTMF module has fuzzy unreadable red letters. The red LED modules to the right are attached in same order as digits on telephone touch tone interface. Pushing a digit on telephone makes LED module go on.

DTMF connection off

And here is how it looks when connected to tMonitor

neattools accepting DTMF input

Module changes associated with Viz Build 13

JTrans2 now saves names of DEFs as received from viz loading world, and uses this name as name of module, rather than using name "JTrans2". Name can be used later to synch up changes with VRML file (currently if vrml file adds DEFs, the NTL gets out of synch).

Module changes associated with Viz Build 11

Starting with build 11 of viz, neattools and viz are more tightly integrated. The following behavior is supported:
  1. neattools JViz2 module can instruct viz to load a specific VRML file when the NTL file is loaded.
  2. viz sends neattools a list of DEF names for the VRML file loaded. This list is used by the JTrans2 module to allow "by-name" changing of properties of visual objects displayed by viz.
  3. neattools automatically sends calibration information to viz when it first connects to viz, or when it loads a new NTL file
  4. viz requests new calibration from viz when it loads a new VRML file
The end result is that viz should be totally controllable from the NTL file of neattools. Loading a NTL file can cause viz to load a VRML file, and once viz automatically receives the calibration information, viz should be modifying the visualization under control of neattools.

Example NTL files

JJ's modules

Module name

DLL & NTL file

neattools appearance

summary

GPS JGPS.dll yellow, GPS accepts JCOMObj serial data, assuming this is connected to NMEA compatible GPS device.
StaticPattern JStaticPattern.dll blue band at top and bottom, SPattern creates and detects up to 10 static gestures based on up to 10 inputs.

Gestures can be created one by one under manual control, or automatically using the StaticCreator module
StaticCreator JStaticCreator.dll cyan color, sCrt Works in cooperation with StaticPattern.

Output from bottom of StaticPattern is input to StaticCreator, output of StaticCreator sends a "create pattern" signal to StaticPattern
DynamicPattern JDynamicPattern.dll black with small purple box in upper left corner Works in cooperation with StaticPattern, accepts patterns detected by StaticPattern, creates patterns that are a time delimited sequence of StaticPattern outputs
DynamicCreator JDynamicCreator.dll cyan color, dCrt Works in cooperation with DynamicPattern.

Output from bottom of DynamicPattern indicates when pattern should be created. DynamicCreator then sends signal to DynamicPattern.
SpaceMarker JSpaceMarkerObj.dll, SPACE.NTL black with cyan border very cool module, assumes input X-Y range from 0-65535 (e.g. neattools mouse X-Y do this, otherwise calibrate module does it), creates visual gestures as rectangles
Viz Client JViz2.dll, JVIZ2.NTL cyan color, Viz Client interface to external 3D data visualization program.
JTrans2 JTrans2.dll, ypw.NTL cyan color, JTrans2 interface to external 3D data visualization program, used for controlling DEFfed VRML object attributes. Controllable attributes are location, orientation,
MR25 JMR25Obj.dll cyan color, MR25 MR-25 input device
RobotControl JRobotControlObj.dll cyan color, JRobot interface to robot from ?? (davew knows)
Flock of Birds JFlockOfBirdsObj.dll cyan color, flockOfBirds interface to flock of birds device
Polhemus JPolhemusObj.dll cyan color, polhemus interface to polhemus device
Humanoid Visualizer JHumanoidObj.dll cyan color, JHumanoid interface to WorldView based VRML humanoid visualizer. Some installation problems still to be resolved, state questionable, WorldView out of business, product no longer supported.

Could resurrect this at some point...
Module generator not a module!   I use this to create neattools modules, not to be confused with Rob's Module creator.

This is an executable program that takes an XML description of a module as input, and generates the C++ source and header file, and a MSVC++ 6.0 make file for the module. In some cases creates totally functioning module (e.g. JRobotControlObj was 100% generated)

Module Conventions I use:

  Controls: controls are things like "calibration", "enable", etc. that affect the behavior of the module. These I always put at the top of the module  
Inputs: inputs go into the left side of the module, these are the raw data processed by the module. neattools modules are always rectangles. The LEFT and TOP sides feed data into the module. The RIGHT and BOTTOM take data out of the module. Outputs: the outputs appear on the right of the module, and result from how the module processes the inputs.
  Commands: these are any outputs that are used to control other modules (i.e. they connect to another module's "controls")  

Static Pattern Module

Static Creator Module

Dynamic Pattern Module

Dynamic Creator Module

Space Marker Module

JSpaceMarkerObj
 
  1. reset - deletes all patterns
  2. next - selects next pattern to create
 
  1. x - assumed to range from 0-65535, used to define horizontal section
  2. y - assumed to range from 0-65535, used to define vertical section
  3. define - on-off value, when on, the incoming x-y define an area within the module.
defines color coded gesture areas in 2 dimensions 1-10. on-off activation values for each created pattern

11. lastPattern -- either the last pattern recognized, or the next one to be created
     

SPACE.NTL - this file uses the mouse X & Y as the two gesture dimensions, and uses LEFT BUTTON as the gesture defining signal.

Which means CLICK-DRAG defines a gesture.

The space module visualization is proportional to the screen dimensions, so while you might drag a big area of the screen, the gesture appears color coded within the module.




JViz2 -- Interface to 3D Data Visualizer

JViz2 handles the main x/y/z/signals1-5 visualization.

JTrans2 handles property controls of a single object in the visualization. Any control data generated by JTrans is routed through JViz2 to reach the visualizer.

JViz2 - x/y/z/signal visualization

JViz2
 
  1. timer - must connect to neattools Timer module, controls sampling rate
  2. calibrating - calibrate range of inputs to be used to control visualization
 
  1. x - X location of signal value
  2. y - Y location of signal value
  3. z - Z location of signal value (currently unused by visualizer)
  4. signal1 - the signal value being visualized
  5. signal2 - second signal to visualize (not working 100% in build 11)
  6. signal3 - third signal to visualize (not working 100% in build 11)
  7. signal4 - fourth signal to visualize (not working 100% in build 11)
  8. signal5 - fifth signal to visualize (not working 100% in build 11)
  9. transformer bytes - visual object specific location, orientation, color, scale information, received from JTrans2, JViz2 just forwards this information to viz.
connects to visualizer, sends location/signal information to viz, forwards any object attribute information as received from JTrans2 --> DEF list -- a list of DEF names from the VRML file loaded into Viz, passed to JTrans2 module so it can refer to DEFs by name.
     
Properties

JVIZ2.NTL - to use this:

  1. calibrate inputs
  2. enable socket, if this connects successfully to visualizer, you should see a tiny bright red square in upper left of "Viz Client".
  3. from this point on, all location information is transferred over to visualizer, and you should see a "spray paint" effect on the surface.

JTrans2 - single object visual property controls

JTrans2
 
  1. timer - must connect to neattools Timer module, controls sampling rate
  2. calibrating - calibrate range of inputs to be used to control object visualization attributes
 
  1. i1 - input used to control one of the following: X location, X orientation, red color of surface, red color of line, X axis scaling
  2. i2 - input used to control one of the following: Y location, Y orientation, green color of surface, green color of line, Y axis scaling
  3. i3 - input used to control one of the following: Z location, Z orientation, blue color of surface, blue color of line, Z axis scaling
  4. DEF list - DEF names of loaded VRML file, connects to output of JViz2 module. This allows objects being controlled to be referenced by DEF name in VRML file.
controls location, color, scaling of a single DEFfed Transform object in VRML world loaded into visualizer --> dataOut -- must be sent to JSocketClient
     

JTRANS.NTL - to use this:

  1. set up JViz (see above), but first disable socket client, and increase the number of channels it can accept. JViz and JTrans both connect to same socket client, but it only accepts these connections of its property N is increased from 1.
  2. connect all three inputs to JTrans module, you can decide later what these inputs actually control
  3. calibrate inputs
  4. enable socket, if this connects successfully to visualizer, you should see a tiny bright red square in upper left of "Socket Client". NOTE: this requires the JJ version of Socket Client!
  5. send calibration info to visualizer
  6. from this point on, the JTrans continually sends information to the visualizer. To select what it controls, edit properties.
JTransformer properties:
  1. transformObject -- refers to which DEF in the loaded VRML file. Transform DEFs are used to control location, orientation, and scale. Material DEFs are used to control color.
  2. transformType -- list of types supported:
    • main data -- unsupported at this time, there in case JViz merges into this module (not clear if this is desirable at this point)
    • location -- for controlling a particular transformObject location. In the corresponding VRML file, there is a "DEF xxx Transform".
    • orientation -- for controlling a particular transformObject orientation. In the corresponding VRML file, there is a "DEF xxx Transform".
    • emissive color -- for controlling a particular transformObject emissiveColor. In the corresponding VRML file, there is a "material DEF xxxx Material", and that material is associated with a Shape with PointSet or IndexedLineSet geometry.
    • diffuse color -- for controlling a particular transformObject diffuseColor. In the corresponding VRML file, there is a "material DEF xxx Material", and that material is associated with a solid shape (i.e. a Shape with any geometry except PointSet and IndexedLineSet)
    • scale -- for controlling the size of a particular transformObject. In the corresponding VRML file, there is a "DEF xxx Transform".
  3. mapToMinI1, mapToMaxI1
    • objectType location --> min/max X location
    • objectType orientation --> min/max rotation about Y axis
    • objectType emissiveColor --> min/max red color
    • objectType diffuseColor --> min/max red color
    • objectType scale --> min/max X axis scaling
  4. mapToMinI2, mapToMaxI2
    • objectType location --> min/max Y location
    • objectType orientation --> min/max rotation about X axis
    • objectType emissiveColor --> min/max green color
    • objectType diffuseColor --> min/max green color
    • objectType scale --> min/max Y axis scaling
  5. mapToMinI3, mapToMaxI3
    • objectType location --> min/max Z location
    • objectType orientation --> min/max rotation about Z axis
    • objectType emissiveColor --> min/max blue color
    • objectType diffuseColor --> min/max blue color
    • objectType scale --> min/max Z axis scaling
mapToMinI1, mapToMaxI1, mapToMinI2, mapToMaxI2, mapToMinI3, mapToMaxI3 -- JTransformer always sends three values to associate with a particular object in the visualization. The objectType property determines what visual property these three values are controlling.

Since neattools is sending integer values, there are some conventions (described above with objectType) for mapping integer values into values the visualizer uses.

To change only one attribute, for example, to change only the red color of an object, just set the mapToMinNN and mapToMaxNN values to the same value that you want to be kept constant.

Detailed Examples

JViz2.ntl

Demonstrates
Visualization of a signal value related to an X-Y value. The grid visualizing the signal is an ElevationGrid.
Uses modules

1ball.ntl

Demonstrates
Recording a ball position with the ability to insert "pause" markers in the recording. The ball is positioned in viz using the mouse, and the space bar is pressed to insert the "pause" markers in the recording.

After the recording is made, load 2ball.ntl, and play back the recording.

Uses modules

2ball.ntl

Demonstrates
Playback of a recording with "pause" markers. When playback starts, the ball moves to the first "pause" marker, and the "pause" checkbox is checked.

At this point, there are two ways to get the recording to continue:

  1. click pause checkbox to clear it, at which point, the playback continues to the next pause marker
  2. check off network data source to allow live input to control the cube. Then move the cube to the ball, to create a collision. The collision then causes the ball to move to the next "pause" marker.
Uses modules

ypw.ntl

Demonstrates
Orientation control provided by JTrans2 module. There is a single JTrans2 module for each viz object being controlled. Look in the properties of each JTrans2 module to see what object is being controlled and the type of control.

Each object should have a name, "Yaw", "Pitch", or "Roll". These names correspond to names loaded from the corresponding VRML file "ypw.wrl". If viz is not running, you will see "??" for names, since it is viz that provides these names based on the file it loads.

For type of control you will see orientation, the three min/max values correspond to yaw/pitch/roll. To handle Yaw, but leave pitch and roll unchanged, the min/max for pitch/roll are all set to 0.

Uses modules
neattools controlling object orientation

The initial orientation of text in Viz looks like this:

neattools reading GPS data

As the mouse moves, it changes to something like this:

neattools reading GPS data

gps.ntl

Demonstrates
Neattools connecting to a GPS device that sends NMEA output out serial port.
Uses modules
neattools reading GPS data

jviz_2plane.ntl

Demonstrates
Neattools sending 2 signals to viz, viz displaying these signals on two different planes.
Uses modules

Here is how it looks from neattools:

neattools sending 2 signals

Here is the corresponding VIZ, showing two different planes:

2 data planes

scale.ntl

Demonstrates
Neattools changing the location and scale of objects in viz.
Uses modules

Here is how it looks from neattools:

neattools controlling scale

Here is the corresponding VIZ, the first picture shows the objects at the start:

scale at first location

The next picture shows the objects as they change scale depending on their location

scale at second location

Intersense.ntl

Demonstrates
Neattools reading data from intersense tracker.

NOTE: this is a little tricky to start up. Here's how I get it going:

  1. hook up hardware
  2. turn on Intersense, wait until red light stops blinking
  3. start neattools, if no data coming through, click on continuous mode button and try again (if it doesn't work at first, it will after a few times
The tricky startup only occurs when Intersense first turned on. Once its on and running, everything works smoothly.
Uses modules

Here is how it looks from neattools:

neattools controlling scale

winamptest.ntl

Demonstrates
Neattools controlling winamp MP3 player.
Uses modules

Here is how it looks from neattools:

neattools controlling winamp

dialertest.ntl

Demonstrates
Neattools outdialing telephone.
Uses modules

Here is how it looks from neattools:

neattools dialing telephone

ttstest.ntl

Demonstrates
Neattools speaking arbitrary text using Microsoft Speech text-to-speech.
Uses modules

Here is how it looks from neattools:

neattools tts with properties

The JTTSObj module has 10 properties, each is a text phrase, which can be spoken when the corresponding integer input is received. Here is a view of the properties:

neattools tts with properties

speech.ntl

Demonstrates
Neattools recognizing arbitrary words using Microsoft Speech SDK.
Uses modules

Here is how it looks from neattools:

neattools sr with properties

The JSpeechRecognizerObj module has 12 properties, 10 of these are text phrases to recognizer, one is a boolean which turns on and off single digit 0-9 recognition, and one is a debugging boolean. Here is a view of the properties:

neattools sr with properties

ntlfetcher.ntl

Demonstrates
Neattools loading NTLs from a remote web server.
Uses modules

Here is how it looks from neattools:

neattools ntl fetcher

When the fetch url button is pressed, it activates the JNTLFetcherObj, which has an input NTL path on the left side, and properties indicating the site to fetch from. The www.trapezium.com:80 means it will fetch from the web server at www.trapezium.com using port 80 (which is the standard web server port).

NOTE: the files fetched from the web server are HTML files. These HTML files are converted from NTL files using a program ntl2html.exe

neattools ntl fetcher properties