Data visualization on Matlab - GiulioRomualdi/DecaWaveEVB1000Experiments GitHub Wiki

How to make an histogram of the ranges between the anchors

Run

plot_a2a_histograms(autoranging)

where autoranging is the struct containing the autoranging data.
An example of the output is shown below

How to make a 3D plot of a path

  1. Draw the ground plane and the anchors using

    draw_world(anchor_cartesian, plane_height, title);

    where

    • anchors_cartesian is a 3 x 4 matrix containing the cartesian coordinates of the anchors;
    • plane_height is the height of the common plane where the anchor A0, A1 and A2 are placed;
    • title is the title of the plot;

    the matrix anchors_cartesian can be provided using the position of the anchors saved with the DecaWave EVB1000 Collector software or the position of the anchors obtained in postprocessing from the ranges collected during the autoranging.

    Example:

    % use position of anchors from Collector
    % suppose there is a file of the form tag_<device_ID>_DD_MM_YYYY_apr.csv in the working directory
    coords = load_anchor_position()
    
    % draw ground plane and anchors
    draw_world(coords, plane_height, 'anchors from Collector');

    Example:

    % use position of anchors obtained in postprocessing
    % suppose the struct autoranging is available
    coords = eval_anch_pos(autoranging)
    
    % draw ground plane and anchors
    % use coords.joined for example
    draw_world(coords.joined, plane_height, 'anchors obtained in postprocessing');
  2. Draw a 3D path using

    plot_path(x, y, z, plane_height, skip_samples, legend)
    

    where

    • x, y and z are vector of coordinates of the path;
    • plane_height is the height of the common plane where the anchor A0, A1 and A2 are placed;
    • skip_samples indicates that the first skip_samples samples of x, y and z will be discarded. skip_samples = 1 means no skipping;
    • legend is the text associated to the path in the legend.

    plot_path can be called several times to superimpose paths.

    Example:

    % choose the title
    title = 'Trilateration comparison using autoranging';
    
    % set the plane height
    plane_height = 1.0;
    
    % obtain anchor_cartesian somehow
    
    % draw groud plane and anchors
    draw_world(anchor_cartesian, plane_height, title);
    
    % load trilateration data obtained from DecaWave EVB1000 Collector
    % suppose there are files of the form tag_<device_ID>_DD_MM_YYYY_tpr.csv in the working directory
    trilateration = load_data_paths_trilateration()
    
    % cycle through the paths of all the tags
    for tag_id = fields(trilateration)'
      plot_path(trilateration.(tag_id{:}).x,...
                trilateration.(tag_id{:}).y,...
                trilateration.(tag_id{:}).z,...
                plane_height, 1, tag_id{:});
    end

    An example of the output is shown below Example:

    % choose the title
    title = 'Trilateration obtained in postprocessing';
    
    % set the plane height
    plane_height = 1.0;
    
    % use position of anchors obtained in postprocessing
    % suppose the struct autoranging is available
    anch_coords = eval_anch_pos(autoranging)
    
    % draw groud plane and anchors
    draw_world(anch_coords.joined, plane_height, title);
    
    % use trilateration data obtained in postprocessing
    % suppose path.csv is a file containing ranges
    path = load_data_path_ranges('path.csv');
    trilat = trilateration_all_types(path, anch_coords);
    
    % compare trilateration obtained with DecaWave and DecaWave Cycle algorithms
    plot_path(trilat.joined.dw.x,...
              trilat.joined.dw.y,...
              trilat.joined.dw.z,...
              plane_height, 1, 'DecaWave');
    
    plot_path(trilat.joined.dw_cycle.x,...
              trilat.joined.dw_cycle.y,...
              trilat.joined.dw_cycle.z,...
              plane_height, 1, 'DecaWave Cycle');

    An example of the output is shown below

Plot cartesian components separately

Cartesian components of a path can be plotted separately using

plot_component(data, skip_samples, title, y_axis_label, legend)

where:

  • data is the vector containing the samples of the component of interest;
  • skip_samples indicates that the first skip_samples samples of x, y and z will be discarded. skip_samples = 1 means no skipping;
  • title is the title of the figure;
  • y_axis_label is the label printed on the y axis;
  • legend is the text associated to the signal in the legend.

Example

% load trilateration data obtained from DecaWave EVB1000 Collector
% suppose there are files of the form tag_<device_ID>_DD_MM_YYYY_tpr.csv in the working directory
trilat = load_data_paths_trilateration()

% generate a figure
figure;

% plot the x component of the path executed by the tag #0
plot_component(trilateration.tag_0.x, 1, '', 'x', 'Tag 0')

% plot the x component of the path executed by the tag #1
plot_component(trilateration.tag_1.x, 1, '', 'x', 'Tag 1')

An example of the output is shown below

Example

% use position of anchors obtained in postprocessing
% suppose the struct autoranging is available
anch_coords = eval_anch_pos(autoranging)

% use trilateration data obtained in postprocessing
% suppose path.csv is a file containing ranges
path = load_data_path_ranges('path.csv');
trilat = trilateration_all_types(path, anch_coords);

% generate a figure
figure;

% compare the x components obtained using DecaWave, DecaWave Cycle and Algebraic algorithms
plot_component(trilat.joined.dw.x, 1, '', 'x', 'dw');
plot_component(trilat.joined.algebraic.x, 1, '', 'x', 'algebraic');
plot_component(trilat.joined.dw_cycle.x, 1, '', 'x', 'dw cycle');

An example of the output is shown below

⚠️ **GitHub.com Fallback** ⚠️