Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Milan dev #59

Open
wants to merge 26 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .deploy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Misc]
#if set to true, all logs from commands will be shown. Default is false.
verbose=false
verbose=true

#if set to true, Travis will always try to build the package/asset, even when there isn't a tag. Default is true.
always_run=true
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.svn
.git
Temp/*
Assembly*
*.sln
*.userprefs
/Library
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Assets/UnitySteer"]
path = Assets/UnitySteer
url = https://github.com/ricardojmendez/UnitySteer.git
20 changes: 18 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
language: objective-c

install:
- sh ./.deploy/travis/py_set_up.sh
- sh ./.deploy/travis/py_set_up.sh

script:
- python ./.deploy/travis/main_parser.py
- python ./.deploy/travis/main_parser.py

addons:
sonarqube:
organization: "odmehb-github"
token:
secure: "aCpEzF7VFed9bhZ1Lb/Jm4t+zvR3o2R8RyjNfwoN776ODi8NzDqt/R9nuZmSA2zfT6XNL4AacFAmEgjt52v27wdLwDTSqUW1w3s+xcVOj7uNj/MMap0FhtilJNE7VTyPtkhH+bVGPrjZaLvRHlqt/tYPbK4Pz7Y8RCz4wZrowOvLbt87lJUJsVM2/VbMZjrRm9M2JHzdbn6afTlquCQsIvsTQCIttP3mRAYEEUMTkO4CfdlxThRUJTc+8QmGD/avA9M56+FyRjo+sTVIsK49NYykn2opkosRPHIlGJHP3XmVss0srCuK1oUq4T+ZMDe0EvyIIGQtT+P4msbZVVb1PnlyWwHtDncRZI/ge+SpZlqzhJkT+RGj7fEe66LVXy162DZdMEu3lgCpyci6+kqAvDwj/sLlSqvBiAwpIuAnyd38l1cQtIFr6L9a3/Tx5x+eLi/9SbRZEoaR6io367FEGQMT7pfnyya045flfBbxD2mdGgJkz9iQqSubM5Oj4A5PXtEn52COJzeCxCcH8VEVSW7JJ67LsjLqEyFvl0c3B8YVsSENm02pFXuUMjZOHu+hOq1b9v799C7LXys6Q2CrK4IS4yipHOAudxbACy6vrTNaiovN1FBqQvkafmTmEy8RN/C72NmmWsqMWtsB9tqbkuqmMmwbXdMtMu/YGvnxG5Y="
branches:
- master
- development

script:
# other script steps might be done before running the actual SonarQube analysis
- sonar-scanner

notifications:
slack: csapatnevteam:pOaxl7fQfoNZj97ERSgqZGL6
Binary file added Assets/MainScene.unity
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/MainScene.unity.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/UnitySteer.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Assets/UnitySteer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.svn
.git
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ private void OnDisable()

private void OnUpdateRadar(object obj)
{
Profiler.BeginSample("OnUpdateRadar");
UnityEngine.Profiling.Profiler.BeginSample("OnUpdateRadar");
_detectedColliders = Detect();
FilterDetected();
if (OnDetected != null)
{
Profiler.BeginSample("Detection event handler");
UnityEngine.Profiling.Profiler.BeginSample("Detection event handler");
OnDetected(this);
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();
}
#if TRACEDETECTED
if (DrawGizmos)
Expand All @@ -237,7 +237,7 @@ private void OnUpdateRadar(object obj)
Debug.Log(sb.ToString());
}
#endif
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();
}

public void UpdateRadar()
Expand All @@ -264,14 +264,14 @@ protected virtual void FilterDetected()
* took about 75% of the time used for the frame.
*
*/
Profiler.BeginSample("Base FilterDetected");
UnityEngine.Profiling.Profiler.BeginSample("Base FilterDetected");

_vehicles.Clear();
_obstacles.Clear();
_detectedObjects.Clear();


Profiler.BeginSample("Initial detection");
UnityEngine.Profiling.Profiler.BeginSample("Initial detection");
for (var i = 0; i < _detectedColliders.Length; i++)
{
var id = _detectedColliders[i].GetInstanceID();
Expand All @@ -288,9 +288,9 @@ protected virtual void FilterDetected()
_detectedObjects.Add(detectable);
}
}
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();

Profiler.BeginSample("Filtering out vehicles");
UnityEngine.Profiling.Profiler.BeginSample("Filtering out vehicles");
for (var i = 0; i < _detectedObjects.Count; i++)
{
var d = _detectedObjects[i];
Expand All @@ -304,8 +304,8 @@ protected virtual void FilterDetected()
_obstacles.Add(d);
}
}
Profiler.EndSample();
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();
}
#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected override void Start()

protected override Vector2 CalculateForce()
{
Profiler.BeginSample("Accumulating repulsion");
UnityEngine.Profiling.Profiler.BeginSample("Accumulating repulsion");
var accumulator = Vector2.zero;
var totalCount = 0;
var now = Time.time;
Expand Down Expand Up @@ -98,7 +98,7 @@ protected override Vector2 CalculateForce()
Debug.DrawLine(position, futurePosition, Color.blue);
Debug.DrawLine(position + accumulator, futurePosition, Color.magenta);
#endif
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();

return accumulator;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ protected override Vector2 CalculateForce()
{
// steering accumulator and count of neighbors, both initially zero
var steering = Vector2.zero;
Profiler.BeginSample("SteerForNeighborGroup.Looping over neighbors");
UnityEngine.Profiling.Profiler.BeginSample("SteerForNeighborGroup.Looping over neighbors");
// I'd prefer an iterator, but trying to cut down on allocations
for (var i = 0; i < _neighbors.Count; i++)
{
Expand All @@ -185,7 +185,7 @@ protected override Vector2 CalculateForce()
{
Debug.DrawLine(Vehicle.Position, other.Position, Color.magenta);
}
Profiler.BeginSample("SteerForNeighborGroup.Adding");
UnityEngine.Profiling.Profiler.BeginSample("SteerForNeighborGroup.Adding");
for (var bi = 0; bi < _behaviors.Length; bi++)
{
var behavior = _behaviors[bi];
Expand All @@ -194,16 +194,16 @@ protected override Vector2 CalculateForce()
steering += behavior.CalculateNeighborContribution(other) * behavior.Weight;
}
}
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();
}
}
;
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();

Profiler.BeginSample("Normalizing");
UnityEngine.Profiling.Profiler.BeginSample("Normalizing");
// Normalize for pure direction
steering.Normalize();
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();

return steering;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected override Vector2 CalculateForce()
* and distance to affect the avoidance - the further away the intersection
* is, the less weight they'll carry.
*/
Profiler.BeginSample("Accumulate spherical obstacle influences");
UnityEngine.Profiling.Profiler.BeginSample("Accumulate spherical obstacle influences");
for (var i = 0; i < Vehicle.Radar.Obstacles.Count; i++)
{
var sphere = Vehicle.Radar.Obstacles[i];
Expand All @@ -129,7 +129,7 @@ protected override Vector2 CalculateForce()
var oppositeDirection = Vehicle.Position - sphere.Position;
avoidance += avoidanceMultiplier * oppositeDirection;
}
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();

avoidance /= Vehicle.Radar.Obstacles.Count;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ protected void CalculateForces()
{
return;
}
Profiler.BeginSample("Calculating vehicle forces");
UnityEngine.Profiling.Profiler.BeginSample("Calculating vehicle forces");

var force = Vector2.zero;

Profiler.BeginSample("Adding up basic steerings");
UnityEngine.Profiling.Profiler.BeginSample("Adding up basic steerings");
for (var i = 0; i < Steerings.Length; i++)
{
var s = Steerings[i];
Expand All @@ -181,7 +181,7 @@ protected void CalculateForces()
force += s.WeighedForce;
}
}
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();
LastRawForce = force;

// Enforce speed limit. Steering behaviors are expected to return a
Expand All @@ -205,7 +205,7 @@ protected void CalculateForces()
// but things are working just fine for now, and it seems like
// overkill.
var adjustedVelocity = Vector2.zero;
Profiler.BeginSample("Adding up post-processing steerings");
UnityEngine.Profiling.Profiler.BeginSample("Adding up post-processing steerings");
for (var i = 0; i < SteeringPostprocessors.Length; i++)
{
var s = SteeringPostprocessors[i];
Expand All @@ -215,7 +215,7 @@ protected void CalculateForces()
adjustedVelocity += s.WeighedForce;
}
}
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();


if (adjustedVelocity != Vector2.zero)
Expand All @@ -228,7 +228,7 @@ protected void CalculateForces()

// Update vehicle velocity
SetCalculatedVelocity(newVelocity);
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();
}


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions 3D/Behaviors/Radar.cs → Assets/UnitySteer/3D/Behaviors/Radar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ private void OnDisable()

private void OnUpdateRadar(object obj)
{
Profiler.BeginSample("OnUpdateRadar");
UnityEngine.Profiling.Profiler.BeginSample("OnUpdateRadar");
_detectedColliders = Detect();
FilterDetected();
if (OnDetected != null)
{
Profiler.BeginSample("Detection event handler");
UnityEngine.Profiling.Profiler.BeginSample("Detection event handler");
OnDetected(this);
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();
}
#if TRACEDETECTED
if (DrawGizmos)
Expand All @@ -237,7 +237,7 @@ private void OnUpdateRadar(object obj)
Debug.Log(sb.ToString());
}
#endif
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();
}

public void UpdateRadar()
Expand Down Expand Up @@ -265,14 +265,14 @@ protected virtual void FilterDetected()
* took about 75% of the time used for the frame.
*
*/
Profiler.BeginSample("Base FilterDetected");
UnityEngine.Profiling.Profiler.BeginSample("Base FilterDetected");

_vehicles.Clear();
_obstacles.Clear();
_detectedObjects.Clear();


Profiler.BeginSample("Initial detection");
UnityEngine.Profiling.Profiler.BeginSample("Initial detection");
for (var i = 0; i < _detectedColliders.Length; i++)
{
var id = _detectedColliders[i].GetInstanceID();
Expand All @@ -289,9 +289,9 @@ protected virtual void FilterDetected()
_detectedObjects.Add(detectable);
}
}
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();

Profiler.BeginSample("Filtering out vehicles");
UnityEngine.Profiling.Profiler.BeginSample("Filtering out vehicles");
for (var i = 0; i < _detectedObjects.Count; i++)
{
var d = _detectedObjects[i];
Expand All @@ -305,8 +305,8 @@ protected virtual void FilterDetected()
_obstacles.Add(d);
}
}
Profiler.EndSample();
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();
}
#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected override void Start()

protected override Vector3 CalculateForce()
{
Profiler.BeginSample("Accumulating repulsion");
UnityEngine.Profiling.Profiler.BeginSample("Accumulating repulsion");
var accumulator = Vector3.zero;
var totalCount = 0;
var now = Time.time;
Expand Down Expand Up @@ -99,7 +99,7 @@ protected override Vector3 CalculateForce()
Debug.DrawLine(position, futurePosition, Color.blue);
Debug.DrawLine(position + accumulator, futurePosition, Color.magenta);
#endif
Profiler.EndSample();
UnityEngine.Profiling.Profiler.EndSample();

return accumulator;
}
Expand Down
Loading