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

Fix collision behaviours #111

Merged
merged 4 commits into from
May 12, 2024
Merged

Fix collision behaviours #111

merged 4 commits into from
May 12, 2024

Conversation

aaravpandya
Copy link
Collaborator

@aaravpandya aaravpandya commented May 9, 2024

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.

@aaravpandya aaravpandya marked this pull request as ready for review May 9, 2024 16:47
@@ -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.
Copy link
Collaborator Author

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);
Copy link
Contributor

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?

Copy link
Contributor

@eugenevinitsky eugenevinitsky left a 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!

@aaravpandya aaravpandya merged commit 351e6a4 into main May 12, 2024
1 check failed
@aaravpandya aaravpandya deleted the ap_collisionBehaviours branch May 12, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants