Walabot API
All you need to know to create a Walabot Application
Code Examples

All sample applications share the coding format:

  • Variable definitions - local variable used during the function
  • Initialize configuration - set of variables with predefine value,
    which are used by the Walabot API during Configuration phase.
  • Code Sample is divided into 7 steps:
    1) Connect
    2) Configure
    3) Start
    4) Calibrate
    5) Trigger
    6) Get action
    7) Stop/Disconnect
  • Important implementation note: Walabot uses internal Database (DB), these files are located by default
    in Windows at : "%ProgramData%/Walabot/WalabotSDK" folder. When you write your own application, there is need to modify Walabot lib
    its database location. Walabot_SetSettingsFolder
  1. Sensor Sample Code: this example shows how to build up a simple sensor application using Walabot API. There are two modes MTI mode enable/disable, can be set by modifying the mtiMode variable.
    C# Sample Code
    using System;
    using WalabotAPI_NET;
    namespace SensorApp_SampleCode
    {
    class SensorCodeSample
    {
    WalabotAPI walabot;
    static void Main()
    {
    SensorCodeSample sensor = new SensorCodeSample();
    sensor.SensorCode_SampleCode();
    }
    void PrintSensorTargets(SensorTarget[] targets, int numTargets)
    {
    Console.Clear();
    if (numTargets > 0)
    {
    for (int targetIdx = 0; targetIdx < numTargets; targetIdx++)
    {
    Console.WriteLine("Target " + targetIdx.ToString() + ": \nX = " + targets[targetIdx].xPosCm + " \nY = " + targets[targetIdx].yPosCm + " \nZ = " + targets[targetIdx].zPosCm + "\namplitude = " + targets[targetIdx].amplitude + "\n\n\n ");
    }
    }
    else
    {
    Console.WriteLine("No target detected");
    }
    }
    public void SensorCode_SampleCode()
    {
    walabot = new WalabotAPI();
    // --------------------
    // Variable definitions
    // --------------------
    // Walabot_GetSensorTargets - output parameters
    SensorTarget[] targets;
    int numTargets;
    // Walabot_GetStatus - output parameters
    APP_STATUS appStatus;
    double calibrationProcess; // Percentage of calibration completed, if status is STATUS_CALIBRATING
    // Walabot_GetRawImageSlice - output parameters
    int sizeX;
    int sizeY;
    double sliceDepth;
    double power;
    // ------------------------
    // Initialize configuration
    // ------------------------
    // Walabot_SetArenaR - input parameters
    double minInCm = 30;
    double maxInCm = 200;
    double resICm = 3;
    // Walabot_SetArenaTheta - input parameters
    double minIndegrees = -15;
    double maxIndegrees = 15;
    double resIndegrees = 5;
    // Walabot_SetArenaPhi - input parameters
    double minPhiInDegrees = -60;
    double maxPhiInDegrees = 60;
    double resPhiInDegrees = 5;
    // ----------------------
    // Sample Code Starts Here
    // ----------------------
    /*
    For an image to be received by the application, the following need to happen :
    1) Connect
    2) Configure
    3) Calibrate
    4) Start
    5) Trigger
    6) Get action
    7) Stop/Disconnect
    */
    bool mtiMode = true;
    // Configure Walabot database install location (for windows)
    walabot.SetSettingsFolder("C:/ProgramData/Walabot/WalabotSDK");
    // 1) Connect : Establish communication with Walabot.
    // ==================================================
    walabot.ConnectAny();
    // 2) Configure : Set scan profile and arena
    // =========================================
    // Set Profile - to Sensor.
    // Walabot recording mode is configure with the following attributes:
    // -> Distance scanning through air;
    // -> high-resolution images
    // -> slower capture rate
    walabot.SetProfile(APP_PROFILE.PROF_SENSOR);
    // Setup arena - specify it by Cartesian coordinates(ranges and resolution on the x, y, z axes);
    // In Sensor mode there is need to specify Spherical coordinates(ranges and resolution along radial distance and Theta and Phi angles).
    walabot.SetArenaR(minInCm, maxInCm, resICm);
    // Sets polar range and resolution of arena (parameters in degrees).
    walabot.SetArenaTheta(minIndegrees, maxIndegrees, resIndegrees);
    // Sets azimuth range and resolution of arena.(parameters in degrees).
    walabot.SetArenaPhi(minPhiInDegrees, maxPhiInDegrees, resPhiInDegrees);
    FILTER_TYPE filterType = mtiMode ?
    FILTER_TYPE.FILTER_TYPE_MTI : //Moving Target Identification: standard dynamic-imaging filter
    FILTER_TYPE.FILTER_TYPE_NONE;
    walabot.SetDynamicImageFilter(filterType);
    // 3) Start: Start the system in preparation for scanning.
    // =======================================================
    walabot.Start();
    // 4) Start Calibration - only if MTI mode is not set - (there is no sense
    // executing calibration when MTI is active)
    // ========================================================================
    if (!mtiMode) // if MTI mode is not set - start calibrartion
    {
    // calibrates scanning to ignore or reduce the signals
    walabot.StartCalibration();
    }
    bool recording = true;
    while (recording)
    {
    // calibrates scanning to ignore or reduce the signals
    walabot.GetStatus(out appStatus, out calibrationProcess);
    // 5) Trigger: Scan(sense) according to profile and record signals to be
    // available for processing and retrieval.
    // ====================================================================
    walabot.Trigger();
    // 6) Get action : retrieve the last completed triggered recording
    // ================================================================
    targets = walabot.GetSensorTargets();
    numTargets = targets.Length;
    walabot.GetRawImageSlice(out sizeX, out sizeY, out sliceDepth, out power);
    // ******************************
    // TODO: add processing code here
    // ******************************
    PrintSensorTargets(targets, numTargets);
    }
    // 7) Stop and Disconnect.
    // ======================
    walabot.Stop();
    walabot.Disconnect();
    }
    }
    }
    C++ Sample Code
    #include "WalabotAPI.h"
    #include <iostream>
    #include <stdio.h>
    #include <string>
    #define CHECK_WALABOT_RESULT(result, func_name) \
    { \
    if (result != WALABOT_SUCCESS) \
    { \
    unsigned int extended = Walabot_GetExtendedError(); \
    const char* errorStr = Walabot_GetErrorString(); \
    std::cout << std::endl << "Error at " __FILE__ << ":" \
    << std::dec << __LINE__ << " - " \
    << func_name << " result is 0x" << std::hex \
    << result << std::endl; \
    \
    std::cout << "Error string: " << errorStr << std::endl; \
    \
    std::cout << "Extended error: 0x" << std::hex \
    << extended << std::endl << std::endl; \
    \
    std::cout << "Press enter to continue ..."; \
    std::string dummy; \
    std::getline(std::cin, dummy); \
    return; \
    } \
    }
    void PrintSensorTargets(SensorTarget* targets, int numTargets)
    {
    int targetIdx;
    #ifdef __LINUX__
    printf("\033[2J\033[1;1H");
    #else
    system("cls");
    #endif
    if (numTargets > 0)
    {
    for (targetIdx = 0; targetIdx < numTargets; targetIdx++)
    {
    printf("Target #%d: \nX = %lf \nY = %lf \nZ = %lf \namplitude = %lf\n\n\n ",
    targetIdx,
    targets[targetIdx].xPosCm,
    targets[targetIdx].yPosCm,
    targets[targetIdx].zPosCm,
    targets[targetIdx].amplitude);
    }
    }
    else
    {
    printf("No target detected\n");
    }
    }
    void SensorCode_SampleCode()
    {
    // --------------------
    // Variable definitions
    // --------------------
    // Walabot_GetSensorTargets - output parameters
    SensorTarget* targets;
    int numTargets;
    // Walabot_GetStatus - output parameters
    APP_STATUS appStatus;
    double calibrationProcess; // Percentage of calibration completed, if status is STATUS_CALIBRATING
    // Walabot_GetRawImageSlice - output parameters
    int* rasterImage;
    int sizeX;
    int sizeY;
    double sliceDepth;
    double power;
    // ------------------------
    // Initialize configuration
    // ------------------------
    // Walabot_SetArenaR - input parameters
    double minInCm = 30;
    double maxInCm = 200;
    double resICm = 3;
    // Walabot_SetArenaTheta - input parameters
    double minIndegrees = -15;
    double maxIndegrees = 15;
    double resIndegrees = 5;
    // Walabot_SetArenaPhi - input parameters
    double minPhiInDegrees = -60;
    double maxPhiInDegrees = 60;
    double resPhiInDegrees = 5;
    // ----------------------
    // Sample Code Start Here
    // ----------------------
    /*
    For an image to be received by the application, the following need to happen :
    1) Connect
    2) Configure
    3) Calibrate
    4) Start
    5) Trigger
    6) Get action
    7) Stop/Disconnect
    */
    bool mtiMode = true;
    // Configure Walabot database install location
    #ifdef __LINUX__
    res = Walabot_SetSettingsFolder((char*)"/var/lib/walabot");
    #else
    res = Walabot_SetSettingsFolder("C:/ProgramData/Walabot/WalabotMaker");
    #endif
    CHECK_WALABOT_RESULT(res, "Walabot_SetSettingsFolder");
    // 1) Connect : Establish communication with Walabot.
    // ==================================================
    CHECK_WALABOT_RESULT(res, "Walabot_ConnectAny");
    // 2) Configure : Set scan profile and arena
    // =========================================
    // Set Profile - to Sensor.
    // Walabot recording mode is configure with the following attributes:
    // -> Distance scanning through air;
    // -> high-resolution images
    // -> slower capture rate
    CHECK_WALABOT_RESULT(res, "Walabot_SetProfile");
    // Setup arena - specify it by Cartesian coordinates(ranges and resolution on the x, y, z axes);
    // In Sensor mode there is need to specify Spherical coordinates(ranges and resolution along radial distance and Theta and Phi angles).
    res = Walabot_SetArenaR(minInCm, maxInCm, resICm);
    CHECK_WALABOT_RESULT(res, "Walabot_SetArenaR");
    // Sets polar range and resolution of arena (parameters in degrees).
    res = Walabot_SetArenaTheta(minIndegrees, maxIndegrees, resIndegrees);
    CHECK_WALABOT_RESULT(res, "Walabot_SetArenaTheta");
    // Sets azimuth range and resolution of arena.(parameters in degrees).
    res = Walabot_SetArenaPhi(minPhiInDegrees, maxPhiInDegrees, resPhiInDegrees);
    CHECK_WALABOT_RESULT(res, "Walabot_SetArenaPhi");
    FILTER_TYPE filterType = mtiMode ?
    FILTER_TYPE_MTI : //Moving Target Identification: standard dynamic-imaging filter
    res = Walabot_SetDynamicImageFilter(filterType);
    CHECK_WALABOT_RESULT(res, "Walabot_SetDynamicImageFilter");
    // 3) Start: Start the system in preparation for scanning.
    // =======================================================
    res = Walabot_Start();
    CHECK_WALABOT_RESULT(res, "Walabot_Start");
    // 4) Start Calibration - only if MTI mode is not set - (there is no sense
    // executing calibration when MTI is active)
    // ========================================================================
    if (!mtiMode)
    {
    // calibrates scanning to ignore or reduce the signals
    CHECK_WALABOT_RESULT(res, "Walabot_StartCalibration");
    }
    bool recording = true;
    while (recording)
    {
    // calibrates scanning to ignore or reduce the signals
    res = Walabot_GetStatus(&appStatus, &calibrationProcess);
    CHECK_WALABOT_RESULT(res, "Walabot_GetStatus");
    // 5) Trigger: Scan(sense) according to profile and record signals to be
    // available for processing and retrieval.
    // ====================================================================
    res = Walabot_Trigger();
    CHECK_WALABOT_RESULT(res, "Walabot_Trigger");
    // 6) Get action : retrieve the last completed triggered recording
    // ================================================================
    res = Walabot_GetSensorTargets(&targets, &numTargets);
    CHECK_WALABOT_RESULT(res, "Walabot_GetSensorTargets");
    res = Walabot_GetRawImageSlice(&rasterImage, &sizeX, &sizeY, &sliceDepth, &power);
    CHECK_WALABOT_RESULT(res, "Walabot_GetRawImageSlice");
    // ******************************
    // TODO: add processing code here
    // ******************************
    PrintSensorTargets(targets, numTargets);
    }
    // 7) Stop and Disconnect.
    // ======================
    res = Walabot_Stop();
    CHECK_WALABOT_RESULT(res, "Walabot_Stop");
    CHECK_WALABOT_RESULT(res, "Walabot_Disconnect");
    }
    #ifndef _SAMPLE_CODE_
    int main()
    {
    SensorCode_SampleCode();
    }
    #endif

  2. Breathing example, setting up a Narrow Sensor profile
    C# Sample Code
    using System;
    using WalabotAPI_NET;
    namespace BreathingApp_SampleCode
    {
    class SensorBreathingSampleCode
    {
    WalabotAPI walabot;
    static void Main()
    {
    SensorBreathingSampleCode breathing = new SensorBreathingSampleCode();
    breathing.SensorBreathing_SampleCode();
    }
    void PrintBreathingEnergy(double energy)
    {
    Console.Clear();
    energy *= 1e7;
    Console.WriteLine("Energy = " + energy + "\n ");
    }
    public void SensorBreathing_SampleCode()
    {
    walabot = new WalabotAPI();
    // --------------------
    // Variable definitions
    // --------------------
    // Walabot_GetStatus - output parameters
    APP_STATUS appStatus;
    double calibrationProcess; // Percentage of calibration completed, if status is STATUS_CALIBRATING
    // Walabot_GetImageEnergy
    double energy;
    // ------------------------
    // Initialize configuration
    // ------------------------
    // Walabot_SetArenaR - input parameters
    double minInCm = 30;
    double maxInCm = 150;
    double resICm = 1;
    // Walabot_SetArenaTheta - input parameters
    double minIndegrees = -4;
    double maxIndegrees = 4;
    double resIndegrees = 2;
    // Walabot_SetArenaPhi - input parameters
    double minPhiInDegrees = -4;
    double maxPhiInDegrees = 4;
    double resPhiInDegrees = 2;
    // ----------------------
    // Sample Code Starts Here
    // ----------------------
    /*
    For an image to be received by the application, the following need to happen :
    1) Connect
    2) Configure
    3) Start
    4) Trigger
    5) Get action
    6) Stop/Disconnect
    */
    // Configure Walabot database install location (for windows)
    walabot.SetSettingsFolder("C:/ProgramData/Walabot/WalabotSDK");
    // 1) Connect : Establish communication with Walabot.
    // ==================================================
    walabot.ConnectAny();
    // 2) Configure : Set scan profile and arena
    // =========================================
    // Set Profile - to Sensor -Narrow.
    // Walabot recording mode is configure with the following attributes:
    // -> Distance scanning through air;
    // -> lower - resolution images for a fast capture rate (useful for tracking quick movement)
    walabot.SetProfile(APP_PROFILE.PROF_SENSOR_NARROW);
    // Setup arena - specify it by Cartesian coordinates(ranges and resolution on the x, y, z axes);
    // In Sensor mode there is need to specify Spherical coordinates(ranges and resolution along radial distance and Theta and Phi angles).
    walabot.SetArenaR(minInCm, maxInCm, resICm);
    // Sets polar range and resolution of arena (parameters in degrees).
    walabot.SetArenaTheta(minIndegrees, maxIndegrees, resIndegrees);
    // Sets azimuth range and resolution of arena.(parameters in degrees).
    walabot.SetArenaPhi(minPhiInDegrees, maxPhiInDegrees, resPhiInDegrees);
    // Dynamic-imaging filter for the specific frequencies typical of breathing
    walabot.SetDynamicImageFilter(FILTER_TYPE.FILTER_TYPE_DERIVATIVE);
    // 3) Start: Start the system in preparation for scanning.
    // =======================================================
    walabot.Start();
    bool recording = true;
    while (recording)
    {
    // calibrates scanning to ignore or reduce the signals
    walabot.GetStatus(out appStatus, out calibrationProcess);
    // 4) Trigger: Scan(sense) according to profile and record signals to be
    // available for processing and retrieval.
    // ====================================================================
    walabot.Trigger();
    // 5) Get action : retrieve the last completed triggered recording
    // ================================================================
    energy = walabot.GetImageEnergy();
    // ******************************
    // TODO: add processing code here
    // ******************************
    PrintBreathingEnergy(energy);
    }
    // 6) Stop and Disconnect.
    // ======================
    walabot.Stop();
    walabot.Disconnect();
    }
    }
    }
    C++ Sample Code
    #include "WalabotAPI.h"
    #include <iostream>
    #include <stdio.h>
    #include <string>
    #define CHECK_WALABOT_RESULT(result, func_name) \
    { \
    if (result != WALABOT_SUCCESS) \
    { \
    unsigned int extended = Walabot_GetExtendedError(); \
    const char* errorStr = Walabot_GetErrorString(); \
    std::cout << std::endl << "Error at " __FILE__ << ":" \
    << std::dec << __LINE__ << " - " \
    << func_name << " result is 0x" << std::hex \
    << result << std::endl; \
    \
    std::cout << "Error string: " << errorStr << std::endl; \
    \
    std::cout << "Extended error: 0x" << std::hex \
    << extended << std::endl << std::endl; \
    \
    std::cout << "Press enter to continue ..."; \
    std::string dummy; \
    std::getline(std::cin, dummy); \
    return; \
    } \
    }
    void PrintBreathingEnergy(double energy)
    {
    system("cls");
    printf("Energy = %lf\n ", energy * 1e7);
    }
    void SensorBreathing_SampleCode()
    {
    // --------------------
    // Variable definitions
    // --------------------
    // Walabot_GetStatus - output parameters
    APP_STATUS appStatus;
    double calibrationProcess; // Percentage of calibration completed, if status is STATUS_CALIBRATING
    // Walabot_GetImageEnergy
    double energy;
    // ------------------------
    // Initialize configuration
    // ------------------------
    // Walabot_SetArenaR - input parameters
    double minInCm = 30;
    double maxInCm = 150;
    double resICm = 1;
    // Walabot_SetArenaTheta - input parameters
    double minIndegrees = -4;
    double maxIndegrees = 4;
    double resIndegrees = 2;
    // Walabot_SetArenaPhi - input parameters
    double minPhiInDegrees = -4;
    double maxPhiInDegrees = 4;
    double resPhiInDegrees = 2;
    // ----------------------
    // Sample Code Start Here
    // ----------------------
    /*
    For an image to be received by the application, the following need to happen :
    1) Connect
    2) Configure
    3) Start
    4) Trigger
    5) Get action
    6) Stop/Disconnect
    */
    // Configure Walabot database install location (for windows)
    res = Walabot_SetSettingsFolder("C:/ProgramData/Walabot/WalabotSDK");
    CHECK_WALABOT_RESULT(res, "Walabot_SetSettingsFolder");
    // 1) Connect : Establish communication with Walabot.
    // ==================================================
    CHECK_WALABOT_RESULT(res, "Walabot_ConnectAny");
    // 2) Configure : Set scan profile and arena
    // =========================================
    // Set Profile - to Sensor -Narrow.
    // Walabot recording mode is configure with the following attributes:
    // -> Distance scanning through air;
    // -> lower - resolution images for a fast capture rate (useful for tracking quick movement)
    CHECK_WALABOT_RESULT(res, "Walabot_SetProfile");
    // Setup arena - specify it by Cartesian coordinates(ranges and resolution on the x, y, z axes);
    // In Sensor mode there is need to specify Spherical coordinates(ranges and resolution along radial distance and Theta and Phi angles).
    res = Walabot_SetArenaR(minInCm, maxInCm, resICm);
    CHECK_WALABOT_RESULT(res, "Walabot_SetArenaR");
    // Sets polar range and resolution of arena (parameters in degrees).
    res = Walabot_SetArenaTheta(minIndegrees, maxIndegrees, resIndegrees);
    CHECK_WALABOT_RESULT(res, "Walabot_SetArenaTheta");
    // Sets azimuth range and resolution of arena.(parameters in degrees).
    res = Walabot_SetArenaPhi(minPhiInDegrees, maxPhiInDegrees, resPhiInDegrees);
    CHECK_WALABOT_RESULT(res, "Walabot_SetArenaPhi");
    // Dynamic-imaging filter for the specific frequencies typical of breathing
    CHECK_WALABOT_RESULT(res, "Walabot_SetDynamicImageFilter");
    // 3) Start: Start the system in preparation for scanning.
    // =======================================================
    res = Walabot_Start();
    CHECK_WALABOT_RESULT(res, "Walabot_Start");
    bool recording = true;
    while (recording)
    {
    // calibrates scanning to ignore or reduce the signals
    res = Walabot_GetStatus(&appStatus, &calibrationProcess);
    CHECK_WALABOT_RESULT(res, "Walabot_GetStatus");
    // 4) Trigger: Scan(sense) according to profile and record signals to be
    // available for processing and retrieval.
    // ====================================================================
    res = Walabot_Trigger();
    CHECK_WALABOT_RESULT(res, "Walabot_Trigger");
    // 5) Get action : retrieve the last completed triggered recording
    // ================================================================
    res = Walabot_GetImageEnergy(&energy);
    CHECK_WALABOT_RESULT(res, "Walabot_GetImageEnergy");
    // ******************************
    // TODO: add processing code here
    // ******************************
    PrintBreathingEnergy(energy);
    }
    // 6) Stop and Disconnect.
    // ======================
    res = Walabot_Stop();
    CHECK_WALABOT_RESULT(res, "Walabot_Stop");
    CHECK_WALABOT_RESULT(res, "Walabot_Disconnect");
    }
    #ifndef _SAMPLE_CODE_
    int main()
    {
    SensorBreathing_SampleCode();
    }
    #endif

  3. InWall application sensor
    C# Sample Code
    using System;
    using WalabotAPI_NET;
    namespace InWallApp_SampleCode
    {
    class InWallSampleCode
    {
    WalabotAPI walabot;
    static void Main()
    {
    InWallSampleCode inWall = new InWallSampleCode();
    inWall.InWall_SampleCode();
    }
    void PrintImagingTargets(ImagingTarget[] targets, int numTargets)
    {
    //Clean screen
    Console.Clear();
    //print targets values
    if (numTargets > 0)
    {
    for (int targetIdx = 0; targetIdx < numTargets; targetIdx++)
    {
    Console.WriteLine("Target #" + targetIdx + ":\n\t\t type " + (targets[targetIdx].type == TARGET_TYPE.TARGET_TYPE_PIPE ? "Pipe" : "Unknown") + ",\n\t\t angleDeg = " + targets[targetIdx].angleDeg + ",\n\t\t xPosCm = " + targets[targetIdx].xPosCm + ",\n\t\t yPosCm = " + targets[targetIdx].yPosCm + ",\n\t\t zPosCm = " + targets[targetIdx].zPosCm + ",\n\t\t wPosCm = " + targets[targetIdx].widthCm + ",\n\t\t amplitude = " + targets[targetIdx].amplitude + "\n ");
    }
    }
    else
    {
    Console.WriteLine("No tragets detected");
    }
    }
    public void InWall_SampleCode()
    {
    walabot = new WalabotAPI();
    // --------------------
    // Variable definitions
    // --------------------
    // Walabot_GetStatus - output parameters
    APP_STATUS appStatus;
    double calibrationProcess; // Percentage of calibration completed, if status is STATUS_CALIBRATING
    // Walabot_GetImagingTargets - output parameters
    ImagingTarget[] targets;
    int numTargets;
    // Walabot_GetRawImageSlice - output parameters
    int sizeX;
    int sizeY;
    double sliceDepth;
    double power;
    // ------------------------
    // Initialize configuration
    // ------------------------
    double zArenaMin = 3;
    double zArenaMax = 8;
    double zArenaRes = 0.5;
    double xArenaMin = -3;
    double xArenaMax = 4;
    double xArenaRes = 0.5;
    double yArenaMin = -6;
    double yArenaMax = 4;
    double yArenaRes = 0.5;
    // ----------------------
    // Sample Code Starts Here
    // ----------------------
    /*
    For an image to be received by the application, the following need to happen :
    1) Connect
    2) Configure
    3) Calibrate
    4) Start
    5) Trigger
    6) Get action
    7) Stop/Disconnect
    */
    // Configure Walabot database install location (for windows)
    walabot.SetSettingsFolder(@"C:\ProgramData\Walabot\WalabotSDK");
    // 1) Connect : Establish communication with Walabot.
    // ==================================================
    walabot.ConnectAny();
    // 2) Configure : Set scan profile and arena
    // =========================================
    // Set Profile - short range .
    // Walabot recording mode is configure with the following attributes:
    // -> Distance scanning through air;
    // -> lower - resolution images for a fast capture rate (useful for tracking
    walabot.SetProfile(APP_PROFILE.PROF_SHORT_RANGE_IMAGING);
    // Set arena by Cartesian coordinates, with arena resolution :
    walabot.SetArenaX(xArenaMin, xArenaMax, xArenaRes);
    walabot.SetArenaY(yArenaMin, yArenaMax, yArenaRes);
    walabot.SetArenaZ(zArenaMin, zArenaMax, zArenaRes);
    // Walabot filtering disable
    walabot.SetDynamicImageFilter(FILTER_TYPE.FILTER_TYPE_NONE);
    // 3) Start: Start the system in preparation for scanning.
    // =======================================================
    walabot.Start();
    // 4) Start Calibration
    // ====================
    walabot.StartCalibration();
    bool recording = true;
    while (recording)
    {
    // calibrates scanning to ignore or reduce the signals
    walabot.GetStatus(out appStatus, out calibrationProcess);
    // 5) Trigger: Scan(sense) according to profile and record signals to be
    // available for processing and retrieval.
    // ====================================================================
    walabot.Trigger();
    // 6) Get action : retrieve the last completed triggered recording
    // ================================================================
    targets = walabot.GetImagingTargets();
    walabot.GetRawImageSlice(out sizeX, out sizeY, out sliceDepth, out power);
    // ******************************
    // TODO: add processing code here
    // ******************************
    numTargets = targets.Length;
    PrintImagingTargets(targets, numTargets);
    }
    // 7) Stop and Disconnect.
    // ======================
    walabot.Stop();
    walabot.Disconnect();
    }
    }
    }
    C++ Sample Code
    #include "WalabotAPI.h"
    #include <iostream>
    #include <stdio.h>
    #include <string>
    #define CHECK_WALABOT_RESULT(result, func_name) \
    { \
    if (result != WALABOT_SUCCESS) \
    { \
    unsigned int extended = Walabot_GetExtendedError(); \
    const char* errorStr = Walabot_GetErrorString(); \
    std::cout << std::endl << "Error at " __FILE__ << ":" \
    << std::dec << __LINE__ << " - " \
    << func_name << " result is 0x" << std::hex \
    << result << std::endl; \
    \
    std::cout << "Error string: " << errorStr << std::endl; \
    \
    std::cout << "Extended error: 0x" << std::hex \
    << extended << std::endl << std::endl; \
    \
    std::cout << "Press enter to continue ..."; \
    std::string dummy; \
    std::getline(std::cin, dummy); \
    return; \
    } \
    }
    void PrintImagingTargets(ImagingTarget* targets, int numTargets)
    {
    int targetIdx;
    system("cls");
    if (numTargets > 0)
    {
    for (targetIdx = 0; targetIdx < numTargets; targetIdx++)
    {
    printf("Target #%d:\n\t\t type %s,\n\t\t angleDeg = %lf,\n\t\t xPosCm = %lf,\n\t\t yPosCm = %lf,\n\t\t zPosCm = %lf,\n\t\t wPosCm = %lf,\n\t\t amplitude = %lf\n ",
    targetIdx,
    targets[targetIdx].type == TARGET_TYPE_PIPE ? "Pipe" : "Unknown",
    targets[targetIdx].angleDeg,
    targets[targetIdx].xPosCm,
    targets[targetIdx].yPosCm,
    targets[targetIdx].zPosCm,
    targets[targetIdx].widthCm,
    targets[targetIdx].amplitude);
    }
    }
    else
    {
    printf("No tragets detected\n");
    }
    }
    void Inwall_SampleCode()
    {
    // --------------------
    // Variable definitions
    // --------------------
    // Walabot_GetStatus - output parameters
    APP_STATUS appStatus;
    double calibrationProcess; // Percentage of calibration completed, if status is STATUS_CALIBRATING
    // Walabot_GetImagingTargets - output parameters
    ImagingTarget* targets;
    int numTargets;
    // Walabot_GetRawImageSlice - output parameters
    int* rasterImage;
    int sizeX;
    int sizeY;
    double sliceDepth;
    double power;
    // ------------------------
    // Initialize configuration
    // ------------------------
    double zArenaMin = 3;
    double zArenaMax = 8;
    double zArenaRes = 0.5;
    double xArenaMin = -3;
    double xArenaMax = 4;
    double xArenaRes = 0.5;
    double yArenaMin = -6;
    double yArenaMax = 4;
    double yArenaRes = 0.5;
    // ----------------------
    // Sample Code Start Here
    // ----------------------
    /*
    For an image to be received by the application, the following need to happen :
    1) Connect
    2) Configure
    3) Calibrate
    4) Start
    5) Trigger
    6) Get action
    7) Stop/Disconnect
    */
    // Configure Walabot database install location (for windows)
    res = Walabot_SetSettingsFolder("C:/ProgramData/Walabot/WalabotSDK");
    CHECK_WALABOT_RESULT(res, "Walabot_SetSettingsFolder");
    // 1) Connect : Establish communication with Walabot.
    // ==================================================
    CHECK_WALABOT_RESULT(res, "Walabot_ConnectAny");
    // 2) Configure : Set scan profile and arena
    // =========================================
    // Set Profile - short range .
    // Walabot recording mode is configure with the following attributes:
    // -> Distance scanning through air;
    // -> lower - resolution images for a fast capture rate (useful for tracking quick movement)
    CHECK_WALABOT_RESULT(res, "Walabot_SetProfile");
    // Set arena by Cartesian coordinates, with arena resolution :
    res = Walabot_SetArenaX(xArenaMin, xArenaMax, xArenaRes);
    CHECK_WALABOT_RESULT(res, "Walabot_SetArenaX");
    res = Walabot_SetArenaY(yArenaMin, yArenaMax, yArenaRes);
    CHECK_WALABOT_RESULT(res, "Walabot_SetArenaY");
    res = Walabot_SetArenaZ(zArenaMin, zArenaMax, zArenaRes);
    CHECK_WALABOT_RESULT(res, "Walabot_SetArenaZ");
    // Walabot filtering disable
    CHECK_WALABOT_RESULT(res, "Walabot_SetDynamicImageFilter");
    // 3) Start: Start the system in preparation for scanning.
    // =======================================================
    res = Walabot_Start();
    CHECK_WALABOT_RESULT(res, "Walabot_Start");
    // 4) Start Calibration
    // ====================
    CHECK_WALABOT_RESULT(res, "Walabot_StartCalibration");
    bool recording = true;
    while (recording)
    {
    // calibrates scanning to ignore or reduce the signals
    res = Walabot_GetStatus(&appStatus, &calibrationProcess);
    CHECK_WALABOT_RESULT(res, "Walabot_GetStatus");
    // 5) Trigger: Scan(sense) according to profile and record signals to be
    // available for processing and retrieval.
    // ====================================================================
    res = Walabot_Trigger();
    CHECK_WALABOT_RESULT(res, "Walabot_Trigger");
    // 6) Get action : retrieve the last completed triggered recording
    // ================================================================
    res = Walabot_GetImagingTargets(&targets, &numTargets);
    CHECK_WALABOT_RESULT(res, "Walabot_GetImagingTargets");
    res = Walabot_GetRawImageSlice(&rasterImage, &sizeX, &sizeY, &sliceDepth, &power);
    CHECK_WALABOT_RESULT(res, "Walabot_GetRawImageSlice");
    // ******************************
    // TODO: add processing code here
    // ******************************
    PrintImagingTargets(targets, numTargets);
    }
    // 7) Stop and Disconnect.
    // ======================
    res = Walabot_Stop();
    CHECK_WALABOT_RESULT(res, "Walabot_Stop");
    CHECK_WALABOT_RESULT(res, "Walabot_Disconnect");
    }
    #ifndef _SAMPLE_CODE_
    int main()
    {
    Inwall_SampleCode();
    }
    #endif

  4. Gesture recognition example: This sample code allows you to flip pages of a file (a pdf file, a presentation etc.) using a hand gesture.
    By moving your hand along the Walabots' y axis in a gentle wave fashion, a page would flip forward or backwards.
    After running the code, you need to bring into focus the file which you want to use the app with.
    In order to make the files' paged to flip, The code takes over the "PgUp" and "PgDn" keys of your keyboard.
    If you wish, you can decide which keys should be pressed as the outcome of your hand gesture, by changing the virtual key-codes (in the function PageFlip)
    IMPORTANT NOTE: The hand should cross the origin of the walabot device during its movement.
    #include "WalabotAPI.h"
    #include <stdio.h>
    #include <iostream>
    #include <conio.h>
    #include <string>
    #define WINVER 0x0500
    #include <windows.h>
    #include <fstream>
    // This sample code allows you to flip pages of a file (a pdf file, a presentation etc.) using a hand gesture.
    // By moving your hand along the Walabots' y axis in a gentle wave fashion, a page would flip forward or backwards.
    // After running the code, you need to bring into focus the file which you want to use the app with.
    // In order to make the files' paged to flip, The code takes over the "PgUp" and "PgDn" keys of your keyboard.
    // If you wish, you can decide which keys should be pressed as the outcome of your hand gesture, by changing the virtual key-codes (in the function PageFlip)
    // IMPORTANT NOTE: The hand should cross the origin of the walabot device during its movement.
    #define CHECK_WALABOT_RESULT(result, func_name) \
    { \
    if (result != WALABOT_SUCCESS) \
    { \
    unsigned int extended = Walabot_GetExtendedError(); \
    const char* errorStr = Walabot_GetErrorString(); \
    std::cout << std::endl << "Error at " __FILE__ << ":" \
    << std::dec << __LINE__ << " - " \
    << func_name << " result is 0x" << std::hex \
    << result << std::endl; \
    \
    std::cout << "Error string: " << errorStr << std::endl; \
    \
    std::cout << "Extended error: 0x" << std::hex \
    << extended << std::endl << std::endl; \
    \
    std::cout << "Press enter to continue ..."; \
    std::string dummy; \
    std::getline(std::cin, dummy); \
    return; \
    } \
    }
    // Global Variables
    int gFlag = 0; // 0 when the array of ypos samples needs to be completely reset with new samples
    const double gDeltaY = 0.6; // The difference by which 2 successive ypos samples, are checked for increasing/decreasing tendency
    const int gSampleSizeWindow = 6; // Number of ypos samples to be taken at each loop
    int gCleanSampleSize = 0; // Number of yPos samples received after a single loop (not every trigger action is guaranteed to return a target)
    int gRestTime = 300; // Amount of milliseconds to rest after identifying a gesture and turning a page (gives time to move the hand out
    // of the arena to avoid an unintentional reading)
    // Returns true if a there is at least one positive y position in YposSorted
    bool GotPositive(double YposSorted[])
    {
    for (int k = 0; k < gCleanSampleSize; k++)
    {
    if (YposSorted[k] > 0)
    {
    return true;
    }
    }
    return false;
    }
    // Returns true if a there is at least one negative y position in YposSorted
    bool GotNegative(double YposSorted[])
    {
    for (int k = 0; k < gCleanSampleSize; k++)
    {
    if (YposSorted[k] < 0)
    {
    return true;
    }
    }
    return false;
    }
    // Given the array YposArray - moves the actual target values to the front of the array
    double* SortYposArray(double YposArray[])
    {
    double YposSorted[gSampleSizeWindow];
    for (int k = 0; k < gSampleSizeWindow; k++)
    {
    if (YposArray[k] < 617)
    {
    YposSorted[gCleanSampleSize] = YposArray[k];
    gCleanSampleSize++;
    }
    }
    return YposSorted;
    }
    // Returns a score by checking the direction of the y coordinates in the array YposSorted
    int GetScore(double YposSorted[])
    {
    int score = 0;
    for (int k = 1; k < gCleanSampleSize; k++)
    {
    if ((YposSorted[k] - YposSorted[k - 1])<gDeltaY)
    {
    score++;
    }
    else if ((YposSorted[k] - YposSorted[k - 1])>gDeltaY)
    {
    score--;
    }
    }
    return score;
    }
    // Flips page
    void PageFlip(double YposArray[])
    {
    double *YsortedPointer;
    YsortedPointer = SortYposArray(YposArray);
    double YposSorted[gSampleSizeWindow];
    for (int k = 0; k < gCleanSampleSize; k++)
    {
    YposSorted[k] = *(YsortedPointer + k);
    }
    if (GotNegative(YposSorted) == true && GotPositive(YposSorted) == true)
    {
    int Score = GetScore(YposSorted);
    int CurrentCleanSampleSize = gCleanSampleSize;
    gCleanSampleSize = 0; // RESET VALUE
    if (Score > 0 && Score > (CurrentCleanSampleSize / 2.5))
    {
    INPUT ip;
    // Set up a generic keyboard event.
    ip.type = INPUT_KEYBOARD;
    ip.ki.wScan = 0; // hardware scan code for key
    ip.ki.time = 0;
    ip.ki.dwExtraInfo = 0;
    // Press the "PgDn" key
    ip.ki.wVk = 0x22; // virtual-key code for the "PgDn" key
    ip.ki.dwFlags = 0; // 0 for key press
    SendInput(1, &ip, sizeof(INPUT));
    // Release the "PgDn" key
    ip.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release
    SendInput(1, &ip, sizeof(INPUT));
    gFlag = 0;
    Sleep(gRestTime);
    }
    else if (Score < 0 && abs(Score) >(CurrentCleanSampleSize / 2.5))
    {
    INPUT ip;
    // Set up a generic keyboard event.
    ip.type = INPUT_KEYBOARD;
    ip.ki.wScan = 0; // hardware scan code for key
    ip.ki.time = 0;
    ip.ki.dwExtraInfo = 0;
    // Press the "PgUp" key
    ip.ki.wVk = 0x21; // virtual-key code for the "PgUp" key
    ip.ki.dwFlags = 0; // 0 for key press
    SendInput(1, &ip, sizeof(INPUT));
    // Release the "PgUp" key
    ip.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release
    SendInput(1, &ip, sizeof(INPUT));
    gFlag = 0;
    Sleep(gRestTime);
    }
    else
    {
    return;
    }
    }
    else
    {
    gCleanSampleSize = 0; // RESET VALUE
    return;
    }
    }
    // Get y of closest target projected on the Y-Z plane
    double GetYposOfClosestTarget(SensorTarget *targets, int numTargets)
    {
    // Set initial parameter values
    int ClosestTargetIndex = 0;
    double SizeOfClosestTargetYZ = sqrt(pow(targets[0].yPosCm, 2) + pow(targets[0].zPosCm, 2));
    for (int k = 1; k < numTargets; k++)
    {
    double SizeOfTargetYZ = sqrt(pow(targets[k].zPosCm, 2) + pow(targets[k].yPosCm, 2));
    if (SizeOfTargetYZ< SizeOfClosestTargetYZ)
    {
    ClosestTargetIndex = k;
    SizeOfClosestTargetYZ = SizeOfTargetYZ;
    }
    }
    return targets[ClosestTargetIndex].yPosCm;
    }
    // Get y coordinate of sensed target
    double GetYpos(SensorTarget* targets, int numTargets)
    {
    if (numTargets > 1)
    {
    return GetYposOfClosestTarget(targets, numTargets);
    }
    else if (numTargets == 1)
    {
    return targets->yPosCm;
    }
    else
    {
    return 617; // A value that is out of range at any case- marks that no actual target was detected
    }
    }
    void FlipPages_SampleCode()
    {
    // --------------------
    // Variable definitions
    // --------------------
    // Walabot_GetStatus - output parameters
    APP_STATUS appStatus;
    double calibrationProcess; // Percentage of calibration completed, if status is STATUS_CALIBRATING
    SensorTarget *targets;
    int numTargets;
    double YposArray[gSampleSizeWindow];
    // ------------------------
    // Initialize configuration
    // ------------------------
    double rArenaMin = 10.0;
    double rArenaMax = 40.0;
    double rArenaRes = 5.0;
    double thetaArenaMin = -20.0;
    double thetaArenaMax = 20.0;
    double thetaArenaRes = 10.0;
    double phiArenaMin = -45.0;
    double phiArenaMax = 45.0;
    double phiArenaRes = 5.0;
    double threshold = 8.0;
    // Configure Walabot database install location (for windows)
    res = Walabot_SetSettingsFolder("C:/ProgramData/Walabot/WalabotSDK");
    CHECK_WALABOT_RESULT(res, "Walabot_SetSettingsFolder");
    // Connect : Establish communication with Walabot.
    // ==================================================
    CHECK_WALABOT_RESULT(res, "Walabot_ConnectAny");
    // Configure : Set scan profile and arena
    // =========================================
    // Set Profile - SENSOR Profile
    // Walabot recording mode is configured with the following attributes:
    // -> Distance scanning through air;
    // -> High-resolution images, but slower capture rate;
    CHECK_WALABOT_RESULT(res, "Walabot_SetProfile");
    // Set arena size and resolution with Polar coordinates:
    res = Walabot_SetArenaR(rArenaMin, rArenaMax, rArenaRes);
    CHECK_WALABOT_RESULT(res, "Walabot_SetArenaR");
    res = Walabot_SetArenaTheta(thetaArenaMin, thetaArenaMax, thetaArenaRes);
    CHECK_WALABOT_RESULT(res, "Walabot_SetArenaTheta");
    res = Walabot_SetArenaPhi(phiArenaMin, phiArenaMax, phiArenaRes);
    CHECK_WALABOT_RESULT(res, "Walabot_SetArenaPhi");
    // Set threshold
    res = Walabot_SetThreshold(threshold);
    CHECK_WALABOT_RESULT(res, "Walabot_SetThreshold");
    // Set Walabot filtering type
    CHECK_WALABOT_RESULT(res, "Walabot_SetDynamicImageFilter");
    // Start: Start the system in preparation for scanning.
    // =======================================================
    res = Walabot_Start();
    CHECK_WALABOT_RESULT(res, "Walabot_Start");
    // calibrates scanning to ignore or reduce the signals
    CHECK_WALABOT_RESULT(res, "Walabot_StartCalibration");
    // calibrates scanning to ignore or reduce the signals
    res = Walabot_GetStatus(&appStatus, &calibrationProcess);
    CHECK_WALABOT_RESULT(res, "Walabot_GetStatus");
    // Display message to the user:
    std::cout << "The app is up and running- to use the app, bring your file into focus" << '\n';
    // Loop
    bool recording = true;
    while (recording)
    {
    if (gFlag == 0)
    {
    for (int k = 0; k < gSampleSizeWindow; k++)
    {
    // Trigger: Scan(sense) according to profile and record signals to be
    // available for processing and retrieval.
    // ====================================================================
    res = Walabot_Trigger();
    CHECK_WALABOT_RESULT(res, "Walabot_Trigger");
    // Get action : retrieve the last completed triggered recording
    // ================================================================
    res = Walabot_GetSensorTargets(&targets, &numTargets);
    CHECK_WALABOT_RESULT(res, "Walabot_GetSensorTargets");
    YposArray[k] = GetYpos(targets, numTargets);
    }
    gFlag = 1;
    PageFlip(YposArray);
    }
    if (gFlag == 1)
    {
    for (int k = 1; k < gSampleSizeWindow; k++)
    {
    YposArray[k - 1] = YposArray[k];
    }
    res = Walabot_Trigger();
    CHECK_WALABOT_RESULT(res, "Walabot_Trigger");
    res = Walabot_GetSensorTargets(&targets, &numTargets);
    CHECK_WALABOT_RESULT(res, "Walabot_GetSensorTargets");
    YposArray[gSampleSizeWindow - 1] = GetYpos(targets, numTargets);
    PageFlip(YposArray);
    }
    }
    // Stop and Disconnect.
    // ======================
    res = Walabot_Stop();
    CHECK_WALABOT_RESULT(res, "Walabot_Stop");
    CHECK_WALABOT_RESULT(res, "Walabot_Disconnect");
    }
    #ifndef _SAMPLE_CODE_
    int main()
    {
    FlipPages_SampleCode();
    }
    #endif



    Fill out our 5 question survey Share Your API Feedback