How to parse position data emitted by DWUSB GUI?

The following is the code from a sample main.c file that prints out the fields in the position data coming over LCM:

 --- BEGINNING OF CODE ---

 #include < stdio.h>
 #include < string.h> 
 #include < inttypes.h>
 #include < lcm/lcm.h>
 #include "uwbtalk/uwbtalk.h"

 #define DEFAULT_LCM_PORT    7667

void POS3_receive_callback(const lcm_recv_buf_t *rbuf, const char *channel, const uwbtalk_pos3_t *pos3, void *user);
void POS3_rpt_receive_callback(const lcm_recv_buf_t *rbuf, const char *channel, const uwbtalk_pos3_rpt_t *pos3_rpt, void *user);

int main(int n_args, char* args[]) {
    int port = 0;

    // If the user supplies a port number, use it
    if (n_args == 2) {
        port = atoi(args[1]);
    }

    // If the port is 0, use the default lcm port
    if (port == 0) {
        port = DEFAULT_LCM_PORT;
    }


    lcm_t           *mLcm;
    uwbtalk_pos3_t_subscription_t       *mPos3Sub;
    uwbtalk_pos3_rpt_t_subscription_t   *mPos3RptSub;

    // Format the lcm url
    char _lcm_url[100];
    sprintf(_lcm_url, "udpm://239.255.76.67:%d?ttl=1", port);

    //STARTUP:
    mLcm = lcm_create(_lcm_url);
    if(!mLcm) {
        // error
        printf("Error initializing lcm!!\n");
        fflush(stdout);
    }

    // establish subscriptions:
    if (mLcm) {
        mPos3Sub =    uwbtalk_pos3_t_subscribe(mLcm, UWBTALK_CHAN_POS3, POS3_receive_callback, NULL);
        mPos3RptSub = uwbtalk_pos3_rpt_t_subscribe(mLcm, UWBTALK_CHAN_POS3_RPT,POS3_rpt_receive_callback, NULL);
        
        int busy = 1;
        
        // Handle lcm messages until we stop receiving
        do { 
             // handle messages over lcm with a 100 ms timeout
             busy = lcm_handle_timeout(mLcm, 100);
        } while (busy);
   
        // Shutdown LCM
        if (mPos3Sub) uwbtalk_pos3_t_unsubscribe(mLcm, mPos3Sub);
        if (mPos3RptSub) uwbtalk_pos3_rpt_t_unsubscribe(mLcm, mPos3RptSub);
        lcm_destroy(mLcm);
    }

    printf("Exiting...\n");
    return 0;
}

void POS3_receive_callback(const lcm_recv_buf_t *rbuf, const char *channel, const uwbtalk_pos3_t *pos3, void *user) {
    printf("Rx pos3 over lcm with id %hd...\n", pos3->id);    
    // process the received data....    
    printf("\t Serial: %08"PRIX64"\n", pos3->serial_num);
    printf("\t     ID: %hd\n", pos3->id);
    printf("\t      X: %f\n", pos3->x);
    printf("\t      Y: %f\n", pos3->y);
    printf("\t      Z: %f\n", pos3->z);
    printf("\tQuality: %f\n", pos3->quality);
    // Note: Battery voltage always reports 0, except on custom engineered boards
    printf("\tBattery: %hd\n", pos3->battery_voltage);
}

void POS3_rpt_receive_callback(const lcm_recv_buf_t *rbuf, const char *channel, const uwbtalk_pos3_rpt_t *pos3_rpt, void *user) {
        printf("Rx pos3 report over lcm with id %hd...\n", pos3_rpt->id);
        printf("\ttimestamp: %"PRId64"\n\tnum_targets: %hd\n", pos3_rpt->timestamp, pos3_rpt->num_targets);
        // process the received data....    
        int i;
        for (i = 0; i < pos3_rpt->num_targets; i++) {
            printf("\t\t Target Serial: %08"PRIX64"\n", pos3_rpt->target[i].serial_num);
            printf("\t\t     Target ID: %"PRId16"\n", pos3_rpt->target[i].id);
            printf("\t\t      Target X: %f\n", pos3_rpt->target[i].x);
            printf("\t\t      Target Y: %f\n", pos3_rpt->target[i].y);
            printf("\t\t      Target Z: %f\n", pos3_rpt->target[i].z);
            printf("\t\tTarget Quality: %f\n", pos3_rpt->target[i].quality);
            // Note: Battery voltage always reports 0, except on custom engineered boards
            printf("\t\tTarget Battery: %"PRId16"\n", pos3_rpt->target[i].battery_voltage);
        }
}

 --- END OF CODE ---

The make command you will need to compile this code sample is as follows:

gcc main.c uwbtalk/uwbtalk_pos3_t.c uwbtalk/uwbtalk_pos3_rpt_t.c -o pos3_example -pthread -L/usr/local/lib -llcm -lgthread-2.0 -lglib-2.0 -I./

Do note that the uwbtalk folder containing all of the uwbtalk definition files will need to be located in the same directory as your main.c file.

For more examples of using LCM, you can also refer to the LCM website, which is located at https://lcm-proj.github.io.