fixed cone radius and sigmoid sensor test parameters
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
classdef fixedCardinalSensor
|
||||
% Senses in the +/-x, +/- y directions at some specified fixed length
|
||||
properties
|
||||
alphaTilt = NaN;
|
||||
r = 0.1; % fixed sensing length
|
||||
end
|
||||
|
||||
@@ -27,6 +28,9 @@ classdef fixedCardinalSensor
|
||||
neighborValues (4, 1) double;
|
||||
neighborPos (4, 3) double;
|
||||
end
|
||||
|
||||
% Set alphaTilt to produce an FOV cone with radius 'r' on the ground
|
||||
obj.alphaTilt = atan2(obj.r, agent.pos(3));
|
||||
|
||||
% Evaluate objective at position offsets +/-[r, 0, 0] and +/-[0, r, 0]
|
||||
currentPos = agent.pos(1:2);
|
||||
@@ -70,7 +74,6 @@ classdef fixedCardinalSensor
|
||||
end
|
||||
|
||||
value = 0.5 * ones(size(targetPos, 1), 1);
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -7,8 +7,6 @@ classdef sigmoidSensor
|
||||
betaPan = NaN;
|
||||
alphaTilt = NaN;
|
||||
betaTilt = NaN;
|
||||
|
||||
r = NaN;
|
||||
end
|
||||
|
||||
methods (Access = public)
|
||||
@@ -32,8 +30,6 @@ classdef sigmoidSensor
|
||||
obj.betaPan = betaPan;
|
||||
obj.alphaTilt = alphaTilt;
|
||||
obj.betaTilt = betaTilt;
|
||||
|
||||
obj.r = obj.alphaDist;
|
||||
end
|
||||
function [values, positions] = sense(obj, agent, sensingObjective, domain, partitioning)
|
||||
arguments (Input)
|
||||
@@ -68,13 +64,13 @@ classdef sigmoidSensor
|
||||
value (:, 1) double;
|
||||
end
|
||||
|
||||
d = vecnorm(agentPos - targetPos, 2, 2);
|
||||
panAngle = atan2(targetPos(:, 2) - agentPos(2), targetPos(:, 1) - agentPos(1)) - agentPan;
|
||||
tiltAngle = atan2(targetPos(:, 3) - agentPos(3), d) - agentTilt;
|
||||
d = vecnorm(agentPos - targetPos, 2, 2); % distance from sensor to target
|
||||
x = vecnorm(agentPos(1:2) - targetPos(:, 1:2), 2, 2); % distance from sensor nadir to target nadir (i.e. distance ignoring height difference)
|
||||
tiltAngle = atan2(targetPos(:, 3) - agentPos(3), x) - agentTilt;
|
||||
|
||||
% Membership functions
|
||||
mu_d = 1 - (1 ./ (1 + exp(-obj.betaDist .* (d - obj.alphaDist)))); % distance
|
||||
mu_p = (1 ./ (1 + exp(-obj.betaPan .* (panAngle + obj.alphaPan)))) - (1 ./ (1 + exp(-obj.betaPan .* (panAngle - obj.alphaPan)))); % pan
|
||||
mu_p = 1; % pan
|
||||
mu_t = (1 ./ (1 + exp(-obj.betaPan .* (tiltAngle + obj.alphaPan)))) - (1 ./ (1 + exp(-obj.betaPan .* (tiltAngle - obj.alphaPan)))); % tilt
|
||||
|
||||
value = mu_d .* mu_p .* mu_t * 1e12;
|
||||
|
||||
Reference in New Issue
Block a user