简体   繁体   中英

How to generate graph for rate of traversal

In Fig 20 of this Coverage paper , shows the rate of coverage of robot navigation. For 5000 iterations, how does one plot the coverage rate versus the number of planned points visited by robot in a simulation? I do not know how to implement the following formula and how to populate the data for matrix A.

Coverage C = 1/N * (summation i=1 to N, A(i) )

A represents the coverage for each cell.

  • A(i) = 1 when the cell i is covered
  • A(i) = 0 , otherwise

The robot's workspace N is a square terrain of 20*20 normalized cell units.

Thank you.

The formula just computes the coverage as the mean value of matrix A, so in Matlab just:

C = mean(A);

assuming indeed A(i) == 1 if cell i is covered, and 0 otherwise. To compute the coverage for a certain robot track, initizialize A to 20x20 = 400 zero values, discretize each robot position to the cell grid, and set each of those cells to A(i) = 1. The exact implementation of how to do this really depends on your code, and I can not help you with that.

Good luck

Given:

  • N -- 20x20 matrix indicating the robot's workspace.
  • Some kind of function that determines whether or not a cell in the robot's workspace is "covered". Let's call it coverfun such that A=coverfun(N,num_planned_pts_visited) . Likely, you will have to figure out how to write this function from domain-specific knowledge, the paper, or from emailing the authors of the paper.

Compute:

  • The coverage quantity C .

The code will probably look something like this:

MAX_PTS_VISITED = 5000;

C = zeros(MAX_PTS_VISITED,1);
for i = 1:MAX_PTS_VISITED,
   A = coverfun(N, i);
   C(i) = mean(A);
end

plot(1:MAX_PTS_VISITED, C);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM