Graphics.POIVisualization - lordmundi/wikidoctest GitHub Wiki

POI Visualization

Description

This tool enables you to visualize graphical representations of POI's (points of interest) from MBDyn simulations. It can either load a list of static POI's from a Trick checkpoint file or connect to a simulation and display live POI data as the sim runs. In either case, it gives you control over which POI's to display as well as their appearance on the screen.

Whichever method you are using, you first need to create a map file that will give the tool some required information: (1) a mapping between POI display nodes and graphics nodes (e.g. SSACS > SSREF), (2) if desired, a display frame to transform all POI's to (so they can all be specified with respect to the same graphics node), and (3) a list of sim variables that give the coordinate transformations between frames, if you are doing frame transformations. See the more detailed description below for the syntax of the file (there is also an example in the download tarball).

For checkpoint files, you first have to pass the file through a Python script that will parse it and extract all of the relevant POI data. This produces an intermediate file which can then be loaded with the Tcl GUI.

See this video for a demo of the tool's capabilities.

Installation

Extract the latest tarball (see below) in your USERDATA directory (or, for DOUG, in your DOUG_HOME directory). This will place the Tcl script and compiled plugin in the correct directories, as well as make a "poi" directory that has the Python parser, an example map file, and a README file in it.

For EDGE, edit your user.cfg file and place the following line in the DSP_CONFIG/DOUG/GUI block:

poi "${USERDATA}/gui/poi.tcl"

If you are using DOUG, you will have to edit the proper .cfg files and add the Tcl script as above.

How to use

Creating the map file

There are 3 fields, which are marked by asterisks:

  1. CONVERT TO FRAME: This is optional, and specifies the frame to which it should convert all POI's. This is useful when not all display nodes have graphics node counterparts. In the example all POI's will be converted to the SSACS frame.

  2. FRAME TRANSFORMS: This field is required if you are doing a frame conversion as above. It lists sim variables that give the conversions between frames. Each line consists of 4 arguments separated by the > symbol. The first 2 specify the frames between which we are converting. The third is the sim variable specifying the position vector of Frame 2's origin, with respect to Frame 1. The fourth is the rotation matrix of Frame 2 with respect to Frame 1. There must be a valid path between each frame and the one you are converting to (SSACS in this case). The transformations can go both ways, so, for example, POI's in the ECEF frame have the path ECEF > ECI > SSACS.

  3. NODE MAPPINGS: A list of graphics nodes that correspond to each display node. In this case we only need one since all POI's are transformed to the SSACS frame. Otherwise we would need one for each display node. The syntax is "display_node > graphics_node".

    #example map file

    *CONVERT TO FRAME SSACS

    comment with # symbols

    *FRAME TRANSFORMS ECI > SSACS > dynGncAdditions.poiIF.poi[0].r_display_to_poi > dynGncAdditions.poiIF.poi[0].R_display_to_poi ECI > ECEF > env_earth.planet.pfix.state.trans.position > env_earth.planet.pfix.state.rot.T_parent_this ECI > Ssrms Base Lee > SSRMS_ARM_link1.structure.state.trans.position > SSRMS_ARM_link1.structure.state.rot.T_parent_this ECI > MobileServicingCenter Structure > MobileServicingCenterDyn.body.structure.state.trans.position > MobileServicingCenterDyn.body.structure.state.rot.T_parent_this

    *NODE MAPPINGS SSACS > SSREF

Parsing a checkpoint file

If you are loading POI's from a Trick checkpoint file, you will have to first parse the file with the provided Python script. Use as follows:

python parse_chkpnt.py

As it runs, it will first search for the frame transformation variables (letting you know if it can't find one), and then find the POI array and extract all of the POI information. It should print to the screen a list of each POI's name and display node, and create a new file which you can then use in the Tcl GUI to display the POI's to the screen. If you see display nodes that start with "rel:", it means that that POI is given with respect to another POI, instead of a normal display node.

Running the GUI

If you installed everything correctly, there should be a "POI Visualization" item in the Options menu in EDGE/DOUG. Open this then simply choose your map file, enter either the POI file location or the host/port of your simulation, and click Load/Connect. You should see a list of all display nodes (or just 1 if you did frame conversions). Under each of these should be a list of POI's that you can show/hide as you wish. The controls at the bottom let you scale the axes of selected POIs, change the color scheme, toggle whether the POI names are displayed by the axes, toggle 3D axes, make selected POI's flash, and attach a node. In file mode, attaching a node just places that node on top of the POI and aligns their axes. In sim mode, the nodes DOF's are updated each time the POI's are so that it is always aligned with the specified POI. There is also a control to set the POI refresh rate in sim mode, and the "Sync" button will re-align the POI's if they have somehow gotten misaligned (sometimes the variable server returns certain POI's a timestep ahead of the others).

dsp_poi plugin calls

If you need to retrieve POI information for use within a Tcl script (for example, if you are driving the position of something else using POI coordinates), you can use the dsp_poi.get command as follows:

doug.plugin dsp_poi.get "POI Name" -ref_node -x -y -z -P -Y -R -visible -scale -isRelPOI -flash

"POI Name" is obviously the full name of the POI (use quotes if there are spaces in the name). The other arguments are optional and should be self-explanatory.

There are other plugin calls (dsp_poi.set, dsp_poi.add, dsp_poi.remove, dsp_poi.configure) that are used for setting parameters, adding/deleting POI's from the linked list, and changing the appearance settings. These are used mainly by the GUI and you probably don't need to use them, but they are documented in the dsp_poi.c source file below.

Download

  • poi_tool_1.0.tgz v1.0 (07/25/2013)
  • poi_tool_1.1.tgz v1.1 (07/29/2013)
    • Speed improvements in the Python checkpoint parser
    • More robust map file processing
    • Minor bug fixes
  • poi_tool_1.2.tgz v1.2 (08/15/2013)
    • Added a menu to the GUI that automatically detects all available simulations
    • Fixed a bug that on certain occasions caused it to freeze when trying to connect to a simulation
    • Other minor interface improvements/bug fixes
  • poi_tool_1.3.tgz v1.3 (07/07/2013)
    • Fixed missing symbolic link
  • dsp_poi.c - C source for the plugin used to draw the axes
  • poi_structs.c - code for creating/manipulating the POI structs and linked list
⚠️ **GitHub.com Fallback** ⚠️