Aufgrund einer Wartung wird GitLab am 18.01. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 18.01. between 8:00 and 9:00 am.

Commit 67f1d3d7 authored by Sascha Niklas Schneiders's avatar Sascha Niklas Schneiders
Browse files

adapted to new math grammar, missing brackets in grammar seem to cause issues

parent c9bdbd58
......@@ -26,9 +26,9 @@ component SteeringAngleCalculator{
//calculate base steering angle
Q globalOrientation = orientation*(M_PI/180);
if (globalOrientation > M_PI) {
if (globalOrientation > M_PI)
globalOrientation -= 2 * M_PI;
}
end
Q orientedDistance = distance;
......@@ -41,11 +41,11 @@ component SteeringAngleCalculator{
Q cosineAngle = v2 / sqrt(v1 * v1 + v2 * v2);
Q angle = acos(cosineAngle);
if (v1 > 0) {
if (v1 > 0)
orientationOfTrajectory = -angle;
} else {
else
orientationOfTrajectory = angle;
}
end
Q angleTrajectoryAndCarDirection = orientationOfTrajectory - globalOrientation;
......@@ -54,23 +54,21 @@ component SteeringAngleCalculator{
Q finalAngle = angleTrajectoryAndCarDirection + angleTowardsTrajectory;
//correct angle
if (finalAngle > M_PI){
if (finalAngle > M_PI)
finalAngle -= 2 * M_PI;
}elseif (finalAngle < -M_PI){
elseif (finalAngle < -M_PI)
finalAngle += 2 * M_PI;
}
end
newSteeringAngle = finalAngle*(180/M_PI);
//correct angle depending on car
angle = newSteeringAngle;
if angle < minSteeringAngle{
if angle < minSteeringAngle
angle = minSteeringAngle;
}
elseif angle > maxSteeringAngle{
elseif angle > maxSteeringAngle
angle = maxSteeringAngle;
}
end
newSteeringAngle = -angle;
}
......
......@@ -5,15 +5,15 @@ component BasicPortsMath{
out (0:1:100) result;
implementation Math{
if counter < 0{
if counter < 0
result = 0;
}
elseif counter < 100{
elseif counter < 100
result = counter;
}
else{
else
result = 100;
}
end
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment