Divergence Angle is now calculated by taking the arctan of d/y, velocity condition was removed.

This commit is contained in:
Karthik 2021-07-15 16:52:07 +02:00
parent dbfe5225fa
commit e808c3dbfb

View File

@ -1,9 +1,8 @@
function ret = exitCondition(this, ovenObj, PositionVector, VelocityVector, CollisionEvent) function ret = exitCondition(this, PositionVector, CollisionEvent)
d = Helper.calculateDistanceFromPointToLine(PositionVector, [0 0 0], [0 1 0]); d = Helper.calculateDistanceFromPointToLine(PositionVector, [0 0 0], [0 1 0]);
y = PositionVector(2); y = PositionVector(2);
DivergenceAngle = (d/abs(y)); DivergenceAngle = atan(d/abs(y));
%DivergenceAngle = atan(norm(cross(PositionVector, )) / norm(dot(PositionVector, [0 1 0]))); if (y >= 0) && (DivergenceAngle <= this.ExitDivergence) && ~CollisionEvent
if (y >= 0) && (DivergenceAngle <= this.ExitDivergence) && (abs(VelocityVector(2))<=ovenObj.VelocityCutoff) && ~CollisionEvent
ret = true; ret = true;
else else
ret = false; ret = false;