results plot1 WIP
This commit is contained in:
@@ -7,11 +7,11 @@ function validate(obj)
|
||||
|
||||
%% Communications Network Validators
|
||||
if max(conncomp(graph(obj.adjacency))) ~= 1
|
||||
warning("Network is not connected");
|
||||
error("Network is not connected");
|
||||
end
|
||||
|
||||
if any(obj.adjacency - obj.constraintAdjacencyMatrix < 0, "all")
|
||||
warning("Eliminated network connections that were necessary");
|
||||
error("Eliminated network connections that were necessary");
|
||||
end
|
||||
|
||||
%% Obstacle Validators
|
||||
@@ -20,10 +20,9 @@ function validate(obj)
|
||||
for kk = 1:size(obj.agents, 1)
|
||||
P = min(max(obj.agents{kk}.pos, obj.obstacles{jj}.minCorner), obj.obstacles{jj}.maxCorner);
|
||||
d = obj.agents{kk}.pos - P;
|
||||
if dot(d, d) < obj.agents{kk}.collisionGeometry.radius^2
|
||||
warning("%s colliding with %s by %d", obj.agents{kk}.label, obj.obstacles{jj}.label, dot(d, d) - obj.agents{kk}.collisionGeometry.radius^2); % this will cause quadprog to fail
|
||||
if dot(d, d) < obj.agents{kk}.collisionGeometry.radius^2 - 1e-3
|
||||
error("%s colliding with %s by %d", obj.agents{kk}.label, obj.obstacles{jj}.label, - dot(d, d) + obj.agents{kk}.collisionGeometry.radius^2); % this will cause quadprog to fail
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user