Manual Gocator GDK PDF
Manual Gocator GDK PDF
The Gocator Development Kit (GDK) is a framework for developing and testing custom Gocator tools
containing your own algorithms, and then deploying them to Gocator sensors.
Custom tools created with the GDK act much like native Gocator data output tools (providing
measurements, geometric features, data and generic outputs) with support for multiple input
parameters), running at native speeds and taking advantage of features such as anchoring. The
GDK supports all data types, and tools created with the GDK use the same data visualization as native
tools.
Benefits
When you use the GDK to create custom measurement tools, you have complete control over how and
where your custom measurement tools can be used, which protects your intellectual property.
You can also easily troubleshoot and modify your tools on-site, letting you respond quickly to your
customers' urgent issues.
Supported Sensors
The GDK is available for free for the following Gocator sensors:
Typical Workflow
The following is the typical workflow for creating and deploying custom measurement tools:
l Develop and build tools using the GDK project files and libraries in Microsoft Visual Studio, targeting
Win32.
You can access full installation and setup instructions, as well as the complete class reference
documentation, by double-clicking the Guide shortcut under the root directory.
Required Tools
The GDK requires Microsoft Visual Studio 2017, as well as various other tools provided in the
GDK Prerequisites package (14525_x.x.x.x_SOFTWARE_GDK_Prerequisites.zip). This package is
available in LMI's Downloads Center (see above for download location).
l Win32/x64 for debugging code and emulating a sensor to test tools (on a PC)
l Arm7 for building for Gocator 2300C and 2400 series sensors
l C64x for Gocator 1300, 2300A, 2300B, 3210, and 3506 series sensors
The Win32 target supports Debug and Release builds. The Arm7 and C64x targets (sensors) only the
support Release builds.
Tool Registration
For a tool to be available to a user in the sensor web interface, you must add it to the project assembly in
Asm.c.
#include <GdkSampleApp/Asm.h>
#include <GdkSampleApp/TestProfileSelect.h>
#include <GdkSampleApp/TestSurfaceSelect.h>
#include <GdkSampleApp/TestSurfaceConfiguration.h>
#include <GdkSampleApp/TestSurfaceGraphics.h>
#include <Gdk/GdkLib.h>
#include <GoSensor/Version.h>
#include <GoSensorAppLib/GsaDef.h>
#include <GoSensorAppLib/GsaAsm.h>
You can add multiple tools in a GDK project. As seen above, TestProfileSelect,
TestSurfaceSelect, TestSurfaceConfiguration, etc. will be available for users from the drop-
down menu in the Tools panel in sensor's web interface.
kCheck(GdkToolInfo_SetTypeName(toolInfo, TEST_PROFILE_SELECT_TOOL_NAME));
kCheck(GdkToolInfo_SetLabel(toolInfo, TEST_PROFILE_SELECT_TOOL_LABEL));
kCheck(GdkToolInfo_SetSourceType(toolInfo, GDK_DATA_TYPE_UNIFORM_PROFILE));
...
The function <Tool Name>_VDescribe describes the tool and its basic configuration. This function is
called during sensor start-up. For more information on entry functions, see Entry Functions below.
Make sure the VDescribe function for each tool is properly formed. Significant issues with this
function (for example, overwriting memory) could prevent the sensor from starting.
You should use the emulator to debug tools before deploying tools to sensors.
Entry Functions
The following table describes the main entry functions.
Function Description
VDescribe Defines the tool's name, data types, acceptable source options, configuration
parameters, and at least one measurement.
VStart Called when the sensor starts running (that is, the user clicks the Run button). The
function gets parameters from GtTool. You typically allocate memory in this function.
VProcess Called every time data is received while the sensor is running.
The TestSurfaceConfiguration example shows how to create and modify parameters based on
other user settings.
For full descriptions of these functions, see the GDK class reference documentation (see Installation and
Class Reference on page 824 for information on installing the documentation).
Parameter Configurations
Each tool has two levels of parameters: tool parameters and measurement parameters.
A tool can contain multiple measurements. In the image above, the Groove tool contains four
measurements: X, Z, Width, and Depth. Each tool has one set of tool parameters and each measurement
in a tool has one set of measurement parameters.
The following table lists the functions that provide advanced or interactive control for setting up tool
and measurement parameters:
Function Description
VNewToolConfig Advanced method for setting default values of tool parameters based on the current
sensor configuration (for example, active area). Called when a new tool is added in the
interface.
VNewMeasurementConfig Advanced method for setting default values of measurement parameters based on the
current sensor configurations (for example, active area). Called when measurements in
a tool is are added in the interface.
VUpdateConfig Advanced method for updating the configuration based on parameters set by users.
For full descriptions of these functions, see the GDK class reference documentation (see Installation and
Class Reference on page 824 for information on installing the documentation).
Graphics Visualization
The GdkGraphic function supports points and lines.
Point graphics
To create graphics:
1. Use GdkGraphic_Construct to create a graphic object.
3. Add the points and lines to the graphic object using GdkGraphic_AddPointSet and GdkGraphic_
AddLineSet.
kTest(GdkGraphic_Construct(&graphic, kObject_Alloc(tool)));
kTest(GdkGraphic_AddPointSet(graphic, pointSet));
The GDK example TestSurfaceGraphics shows how to use the graphics functions.
2. In the output directory, rename the DLL with the same name as your project to GdkApp.dll.
For example, if your project is called MyGDKTools, the resulting DLL should be called MyGDKTools.dll. You
rename this DLL to GdkApp.dll.
The output directories are as follows:
Release: win32
Debug: win32d
VDescribe however is called when the DLL loads, before the debugger can attach to the
kFramework.exe process. To debug VDescribe, we recommend testing the function calls by putting
them in VInit.
For information on building targets for testing in the emulator, see the GDK class reference
documentation.
Tips
The following sections provide useful information for creating custom measurement tools.
By default, if declared parameters are missing from the configuration, a job file or a recording will fail to
load.
There are two ways to provide backward compatibility with older parameter sets.
Configuration Versioning
Over the lifetime of a tool, you may need to make changes to its interface (for example, changing or
removing parameters). The user-defined aspects of a tool interface—its parameters and
By default, a tool has just one version (GdkToolInfo_FirstVersion), but more versions may be
added using GdkToolInfo_AddVersion. Whenever the interface of a tool has changed, a new version
can be registered so that the new interface can be correctly parsed by the framework.
When the configuration of a tool instance is saved, the version used at the time is also saved. This saved
version is used by the framework to parse the configuration. If a version is not defined by the firmware
implementation, then that tool instance will not be active.
During run-time, you can query the version of the configuration of a tool instance by using
GdkToolCfg_Version. You can then interpret the parameters depending on the version the
configuration is saved in.
kCheck(GdkToolInfo_SetSourceType(info, GDK_DATA_TYPE_UNIFORM_PROFILE));
kCheck(GdkToolInfo_AddSourceOption(info, GDK_DATA_SOURCE_TOP));
kCheck(GdkExampleTool_DescribeV0(info));
kCheck(GdkExampleTool_DescribeV1(info));
return kOK;
}
return kOK;
}
// Auto-version
return kOK;
}
Version
You can define the version number of your tools in Asm.x.h.
The GdkToolInput_Find and GdkInputItem_Info functions are used to extract the item and info
objects. These objects can then be used to retrieve the input data and information (for example, offset
and resolution) associated to the input. The following are some examples:
offsetRegion = obj->region;
offsetRegion.x += anchor->x;
offsetRegion.z += anchor->z;
In the code above, we first retrieve the tool’s region settings (before anchoring is applied), and then
adjust the region based on the results from the anchored source in VProcess. If the anchored source
fails, the tools will not be invoked.
For more information on anchoring, see Measurement Anchoring in the Gocator user manual.
Part Matching
When part matching is enabled, the tool receives translated and corrected surface data. If part matching
fails for the current scan (for example, the quality score is too low), the tools will not be invoked.
For more information on part matching, see Part Matching in the user manual.
For example, to read and write a file to a sensor's storage, you could use the following:
Print Output
In the emulator, you can send output to Visual Studio or to programs such as DebugView by using the
OutputDebugString function.
kVarArgList argList;
kVarArgList_Start_(argList, format);
{
status = kStrPrintvf(debugLine, 256, format, argList);
}
kVarArgList_End_(argList);
OutputDebugStringA(debugLine);
return status;
}
OutputDebugString is NOT supported on sensor targets. Use #ifdef to comment out the code
when compiling against sensor targets.
The following sections describe some of the tools provided with a Gocator sensor, as well as the
CSV format that a sensor can export. For information on the integrations available with a sensor, see
Integrations on page 647.
l Sensor Discovery Tool: Used to find sensors on a network. See Sensor Discovery Tool below.
l CSV Converter Tool: Used to convert CSV data exported from a sensor to several formats. See CSV
Converter Tool on the next page.
After downloading the utility package [14405-x.x.x.x_SOFTWARE_GO_Utilities.zip], unzip the file and run
the Sensor Discovery Tool [Tools > Discovery > kDiscovery.exe].
Any sensors that are discovered on the network will be displayed in the Devices list.
The Sensor Discovery tool uses UDP broadcast messages to reach sensors on different subnets.
This enables the Sensor Discovery tool to locate and re-configure sensors even when the sensor IP
address or subnet configuration is unknown.
For information on the CSV file format that the sensor exports, see the next section.
To get the utility package (), go to http://lmi3d.com/support, choose your product from the Product
Downloads section, and download it from the Download Center.
After downloading the tool package, unzip the file and run the Gocator CSV Converter tool [Tools
> CSV Converter > kCsvConverter.exe].
Output formats
Format Description
16-bit BMP Heightmap with 16bit height values in a 5-5-5 RGB image.
Not intended for visualization.
STL ASCII Mesh in standard STL text format (can become very large).
With some formats, one or more of the following options are available:
Output options
Option Description
Keep Aspect Ratio Resamples the X and Y axes to obtain the proper aspect
ratio.
The GenTL format is a 48-bit RGB or grey scale PNG. Height map, intensity and stamp
information are stored as defined in the GenTL Driver section (GenICam GenTL Driver on
page 793). You can load the exported data into image processing software to provide simulation
data for developing applications using the GenTL driver.
2. (Optional) If intensity information is required, check the Intensity box and select the intensity bitmap.
Intensity information is only used when converting to ASCII or GenTL format. If intensity is not selected,
the ASCII format will only contain the point coordinates (XYZ).
3. If a dual-sensor system was used, choose the source sensor next to Image.
6. Click Convert.
The converter converts the input files.
The converted file will be in the same directory as the input file. It will also have the same name as the
input file but with a different file extension. The converted file name is displayed in the Output File
field.
An exported CSV file contains a series of "sections." Each section begins with a row containing the name
of the section, and ends with a row containing the string "End." An empty line separates each section.
Each section usually contains one or more subsections. Each subsection has a header row containing a
list of field names, followed by one or more rows of data. There is usually no empty line between the
subsections.
Example:
Info
CSV Version,Sensor Count,Trigger Mode,...
2,1,0,32000.00000,...
End
DeviceInfo
ID,Model,Version,...
13434,311320-2M-01,4.8.2.29,...
End
Ranges
...
End
Usually all available data in the recording buffer is exported. The exceptions are Surface and
SurfacePointCloud. For these sections, only the currently selected frame is exported.
Info
This section contains basic system information. It has one header row and one value row. The fields are
described below:
Trigger Delay Output delay (µs or mm, depending on delay domain defined above).
Operation Mode The scan mode.
XResolution System X resolution (mm).
YResolution System Y resolution (mm).
ZResolution System Z resolution (mm).
Yspeed Y Speed (mm/s).
Layout Sensor orientation:
0 – Normal (single-sensor system) / Wide (dual-sensor system)
1 – Opposite
2 – Reverse
3 – Grid
DeviceInfo
This section contains information about each device in the system. There is one header row, and one
value row per device.
DeviceInfo Fields
Field Description
RecordingFilter
This section lists the filters used during recording. Unlike the other sections, it contains multiple sub-
sections within, separated by spaces (but not the “End” keyword).
Example:
RecordingFilter
Section1 Param 1, Section1 Param2
value, value
Section2 Param 1
value
Section3 Param1, Section3 Param2
value
End
Each section will be described by a separate table below. They appear in the same order as documented.
RecordingFilter Fields
Field Description
Type Measurement
Enabled Whether or not is enabled: Yes/No
Result Accepted result type: Pass/Fail/Invalid/Valid
Selection ID First measurement ID
Ranges
This section describes single-point range data. It has two sub-sections: attributes and data.
The data section has one or more rows of data per frame (for example, range and intensity).
Profile
This section describes uniform (or resampled) profile data, which is produced when the sensor is in
The data section has one or more rows of data per frame (for example, range and intensity).
RawProfile
This section describes point cloud profile data (or unresampled / raw data), which is produced when the
sensor is in Profile mode and uniform spacing is disabled. It has two sub-sections: attributes and data.
The data section has one or more rows of data per frame (for example, range and intensity).
Part
This section describes uniform (or resampled) surface data, which is produced when the sensor is in
Surface mode and uniform spacing is enabled.
Only the data for the frame currently selected in the UI is exported when you export part data to
a CSV file.
The data section contains the data of a single surface scan. Each data row corresponds to one Y position.
The first row contains the X values, and the first column contains the Y values. The region inside contains
the range values (mm) for the corresponding row and column.