Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mani-monaj/maxcoverage
base: ffa803f71e
...
head fork: mani-monaj/maxcoverage
compare: f055c4fe2d
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 69 additions and 0 deletions.
  1. +10 −0 README
  2. +10 −0 contribcircle.cc
  3. +49 −0 matlab/generateBeleifPlot.m
View
10 README
@@ -1,3 +1,13 @@
This project is for SFU CS889 course project.
The project framework has been forked from: https://github.com/rtv/stagectrl.git
+
+Command Line Usage
+
+`stage -g -c --args "--disabled --leader --relaycount N" ./maniproject.world 2>log.txt1
+
+-g -c Stage Command Lines (Disable GUI, show clock)
+--disabled Disable robot belief usage in Circle algorithm [Default: false]
+--leader Start with one robot as INGROUP [Default : false]
+--relaycount N Number of relays per message (selected messages only) [Default: 3]
+
View
10 contribcircle.cc
@@ -117,6 +117,7 @@ void setRobotState(robot_t* r, RobotState s)
r->position->SetColor(StateColors[s]);
r->inbox.clear();
r->d2c.clear();
+
}
// No Broadcast support yet ...
@@ -165,6 +166,7 @@ void sendMessage(MessageType type, int sender, int receiver, unsigned int rid, u
{
totalMessageCounterMy++;
MessageList.push_back(msg);
+
}
}
@@ -346,6 +348,14 @@ int FiducialUpdate( ModelFiducial* fid, robot_t* robot)
if (robot->position->GetId() == loggerID)
{
fprintf(stderr, "\n%ld,%ld,%ld,%d,", (unsigned long int) (robot->position->GetWorld()->SimTimeNow() /1000.0), totalMessageCounterNaive, totalMessageCounterMy, NUMBEROFSEARCHINGROBOTS);
+// std::set<Stg::Model*>::iterator modit;
+// std::set<Stg::Model*> allModels = robot->position->GetWorld()->GetAllModels();
+// for (modit = allModels.begin(); modit !=allModels.end(); ++ modit )
+// {
+// Stg::Model* mod = *(modit);
+// Stg::ModelPosition* rPos = (Stg::ModelPosition*) mod;
+// printf("*** Robot %d @ <%6.4f, %6.4f>\n", rPos->GetId(), rPos->GetPose().x, rPos->GetPose().y);
+// }
}
if (robot->state == INGROUP)
View
49 matlab/generateBeleifPlot.m
@@ -0,0 +1,49 @@
+function generateBeleifPlot(filename, plottitle)
+data = csvread(filename);
+[row, col] = size(data);
+t = data(:,1);
+n = data(:,4);
+rawb = data(:,5:col-1);
+b = zeros(row,1);
+s = zeros(row,1);
+
+err = 0.0;
+errc = 0;
+for i = 1:row
+ oneb = rawb(i, find(rawb(i,:) > 0));
+ if (n(i) == 0)
+ b(i,1) = 0;
+ s(i,1) = 0;
+ else
+ for j = 1:length(oneb)
+ err = err + ((oneb(j) - n(i)) ^ 2);
+ errc = errc + 1;
+ end
+ b(i,1) = mean(oneb);
+ s(i,1) = std(oneb);
+ end
+
+end
+%b = mean(rawb,2);
+%s = std(rawb,0,2);
+
+%err = (b - n).^2;
+%err = sqrt(sum(err) / row);
+err = sqrt(err / errc);
+fprintf('RMS Error: %6.4f\n', err);
+ub = b + s;
+lb = b - s;
+
+plot(t, ub, 'color', [0.8 0.8 0.8], 'Marker', '.', 'LineStyle', 'none', 'MarkerSize', 6);
+plot(t, lb, 'color', [0.8 0.8 0.8], 'Marker', '.', 'LineStyle', 'none', 'MarkerSize', 6);
+hold on;
+plot(t,n,t,b);
+hold off;
+title(plottitle);
+ylabel('Number of Robots');
+xlabel('time (ms)');
+legend('Std Dev','Actual Number of robots','Mean of robot beleifs');
+grid on;
+
+
+end

No commit comments for this range

Something went wrong with that request. Please try again.