JJ modules + Viz build 11 modules

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

Send feedback to jojo@trapezium.com

New as of 11/99

GPS module

Build 11 module changes

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.




Interface to 3D Data Visualizer

Two neattools modules send data (via the JSocketClient) to the 3D Data Visualizer.

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

JTrans2 handles property controls of a single object in the visualization.

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

gps.ntl

Demonstrates
Neattools connecting to a GPS device that sends NMEA output out serial port.
Uses modules
GPS screen shot