Commit 67f1d3d7 by Sascha Niklas Schneiders

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!