Wrapped the exit condition in to its own function now checking if the position, velocity meet certain criteria and account for collision events.
This commit is contained in:
parent
058fa0fb19
commit
b6d56e9e7b
11
MOT Capture Process Simulation/@MOTSimulator/exitCondition.m
Normal file
11
MOT Capture Process Simulation/@MOTSimulator/exitCondition.m
Normal file
@ -0,0 +1,11 @@
|
||||
function ret = exitCondition(this, PositionVector, VelocityVector, CollisionEvent)
|
||||
d = Helper.calculateDistanceFromPointToLine(PositionVector, [0 0 0], [0 1 0]);
|
||||
y = PositionVector(2);
|
||||
DivergenceAngle = (d/abs(y));
|
||||
%DivergenceAngle = atan(norm(cross(PositionVector, )) / norm(dot(PositionVector, [0 1 0])));
|
||||
if (y >= 0) && (DivergenceAngle <= this.MOTExitDivergence) && (abs(VelocityVector(2))<=this.VelocityCutoff) && ~CollisionEvent
|
||||
ret = true;
|
||||
else
|
||||
ret = false;
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user