Skip to content

Commit

Permalink
Merge branch 'main' into fix/remove-pedestrian-duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
mackierx111 committed Aug 22, 2024
2 parents f098d65 + b02ce2a commit fafefe9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Unity.Jobs;
using UnityEngine;
using UnityEngine.Profiling;
using GeometryUtility = AWSIM.Lanelet.GeometryUtility;

namespace AWSIM.TrafficSimulation
{
Expand Down Expand Up @@ -281,6 +282,8 @@ private struct RightOfWayCheckJob
public static float maximumOverrunStopPointForLaneRules = 1f;

public static float differenceOrientationDegreesImplyingPerpendicularRoad = 35f;

public static float minimumDistanceBetweenNPCs = 70f;

// In
public Transform EGOTransform;
Expand Down Expand Up @@ -402,6 +405,11 @@ public void Execute()
}
}

static private bool isCloseEachOther(NPCVehicleInternalState refState, NPCVehicleInternalState otherState)
{
return GeometryUtility.Distance2D(refState.Vehicle.transform.position, otherState.Vehicle.transform.position) < minimumDistanceBetweenNPCs;
}

static private bool isYieldingDueToRules(NPCVehicleInternalState refState)
{
return refState.YieldPhase == NPCVehicleYieldPhase.LEFT_HAND_RULE_ENTERING_INTERSECTION ||
Expand Down Expand Up @@ -479,6 +487,9 @@ static private bool isLeftHandRuleEnteringIntersection(NPCVehicleInternalState r
{
foreach (var otherState in states)
{
if (!isCloseEachOther(refState, otherState))
continue;

if (!shouldBeConsideredForYielding(refState, otherState))
continue;

Expand All @@ -505,6 +516,9 @@ static private bool isLeftHandRuleOnIntersection(NPCVehicleInternalState refStat
{
foreach (var otherState in states)
{
if (!isCloseEachOther(refState, otherState))
continue;

if (!shouldBeConsideredForYielding(refState, otherState))
continue;

Expand Down Expand Up @@ -539,6 +553,9 @@ static private bool isIntersectionBusy(NPCVehicleInternalState refState, IReadOn
{
foreach (var otherState in states)
{
if (!isCloseEachOther(refState, otherState))
continue;

if (!shouldBeConsideredForYielding(refState, otherState))
continue;

Expand Down Expand Up @@ -572,6 +589,9 @@ static private bool isSomeVehicleForcingPriority(NPCVehicleInternalState refStat
{
foreach (var otherState in states)
{
if (!isCloseEachOther(refState, otherState))
continue;

if (!shouldBeConsideredForYielding(refState, otherState))
continue;

Expand Down Expand Up @@ -630,6 +650,9 @@ static bool IsLaneDominatedByAny(TrafficLane lane, IReadOnlyList<NPCVehicleInter
dominatingVehicle = null;
foreach (var otherState in states)
{
if (!isCloseEachOther(refState, otherState))
continue;

if (!shouldBeConsideredForYielding(refState, otherState))
continue;

Expand Down
2 changes: 1 addition & 1 deletion docs/DeveloperGuide/TroubleShooting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ This document describes the most common errors encountered when working with AWS
|Error when starting AWSIM binary. `segmentation fault (core dumped)`| - Check if yourNvidia drivers or Vulkan API are installed correctly<br> - When building binary please pay attantion whether the `Graphic Jobs` option in `Player Settings` is disabled. It should be disabled since it may produce segmentation fault errors. Please check [forum](https://forum.unity.com/threads/segmentation-fault-core-dumped-in-standalone-app-but-not-in-editor.1226610/) for more details. |
|Initial pose does not match automatically. |Set initial pose manually. <br>![](Image_Initial_0.png)<br>![](Image_Initial_1.png)|
|Unity crashes and check the log for the cause of the error.|**Editor log file location**<br>Windows :<br> `C:\Users\username\AppData\Local\Unity\Editor\Editor.log`<br>Linux :<br> `~/.config/unity3d/.Editor.log` <br><br> **Player log file location**<br> Windows : `C:\Users\username\AppData\LocalLow\CompanyName\ProductName\output_log.txt`<br>Linux :<br>`~/.config/unity3d/CompanyName/ProductName/Player.log`<br><br>See also : [Unity Documentation - Log Files](https://docs.unity3d.com/2021.1/Documentation/Manual/LogFiles.html)|
|Safe mode dialog appears when starting UnityEditor. <br><br> or <br><br> error : `No usable version of libssl was found`|1. download libssl <br> `$ wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.11_amd64.deb` <br><br> 2. install <br> `sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.11_amd64.deb`|
|Safe mode dialog appears when starting UnityEditor. <br><br> or <br><br> error : `No usable version of libssl was found`|1. download libssl <br> `$ wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.13_amd64.deb` <br><br> 2. install <br> `sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.13_amd64.deb`|
|(Windows) Unity Editor's error:`Plugins: Failed to load 'Assets/RGLUnityPlugin/Plugins/Windows/x86_64/RobotecGPULidar.dll' because one or more of its dependencies could not be loaded.`|Install [Microsoft Visual C++ Redistributable packages for Visual Studio 2015, 2017, 2019, and 2022](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#visual-studio-2015-2017-2019-and-2022) (X64 Architecture)|
|(Windows) Built-binary or Unity Editor freeze when simulation started|Update/Install latest NIC(NetworkInterfaceCard) drivers for your PC.<br>Especially, if you can find latest drivers provided by chip vendors for the interfaces (not by Microsoft), we recommend vendors' drivers.|

0 comments on commit fafefe9

Please sign in to comment.