-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix collision behaviours #111
Conversation
@@ -522,6 +527,27 @@ inline void stepTrackerSystem(Engine &ctx, | |||
|
|||
void collisionDetectionSystem(Engine &ctx, | |||
const CandidateCollision &candidateCollision) { | |||
|
|||
// Technically there would never be a collision between (non valid expert) and (non expert). So one of the below checks would always be false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emphasis on NON VALID expert here.
src/sim.cpp
Outdated
@@ -263,6 +263,10 @@ inline void movementSystem(Engine &e, | |||
if (collisionEvent.hasCollided.load_relaxed()) | |||
{ | |||
if(e.data().params.collisionBehaviour == CollisionBehaviour::AgentStop) { | |||
velocity.linear.x = 0; | |||
velocity.linear.y = 0; | |||
velocity.linear.z = fminf(velocity.linear.z, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would we want to possibly return negative z velocity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for comment!
This PR intends to ignore collisions when objects are teleported away and they are NON VALID EXPERTS. That is they are not padding entities or teleported away because of prior collision.
Also, smaller changes included here adds a return statement to the teleport condition and zeroes out the velocity of the agent in the agent stop condition (This happens anyways due to the zerovel system but is now explicitly done.)
Also, adds a small condition to the info tensor if its not updated in the tracking system.