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

Ball colliding with chassis, but not interfering on kicker/ball contact #155

Conversation

FelipeMartins96
Copy link
Contributor

Identify the Bug

#154

Description of the Change

  • Created a ball with a robot chassis surface to be analyzed for collisions;
  • Removed previous ball callback function which was not being utilized;
  • Used the ball callback function so the ball still reaches the kicker;
    • The robot chassis is defined as a full cylinder, so it overlaps with the robot front, if a simple collision check between ball and chassis is performed, the ball would collide with the chassis before reaching the kicker;

Alternate Designs

  • I thought about implementing the robot chassis as multiple "faces", so it could better represent the robot geometry, but that approach would be more difficult and possibly reduce the simulator performance, but that should also solve the chassis/chassis collision.
  • The PWorld::createSurfaceBallChassis function created may be unnecessary, It was added so at the callback it was not needed to check which object was each;

Possible Drawbacks

  • I'm not sure if the previous ball callback function should be removed or fixed;
  • Performance impact was not tested;
  • The code quality was not ideal;
  • Kicker angle value is hardcoded;
  • I believe the force being exerted by the ball on the robot is being ignored since the surface is one way only. I'm still a bit confused about how that works;

Verification Process

  • Used the grSim wasd commands to move the ball in the robot direction and tried to see if the ball would get inside. Tried different robots and angles;

Release Notes

  • Fixing the ball collision with the robot chassis

@FelipeMartins96
Copy link
Contributor Author

this pr may be problematic with this piece of code

if (flag)
{
for (int i=0;i<surfaces.count();i++)
sur_matrix[(*(int*)(dGeomGetData(surfaces[i]->id1)))][*((int*)(dGeomGetData(surfaces[i]->id2)))] =
sur_matrix[(*(int*)(dGeomGetData(surfaces[i]->id2)))][*((int*)(dGeomGetData(surfaces[i]->id1)))] = i;
}

@FelipeMartins96
Copy link
Contributor Author

Additional testing showed some inconsistencies with the calculations, I'll be closing the request until further testing and improvements

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.

1 participant