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 collision with robot chassis is not being handled #154

Open
FelipeMartins96 opened this issue Mar 3, 2021 · 1 comment
Open

Ball collision with robot chassis is not being handled #154

FelipeMartins96 opened this issue Mar 3, 2021 · 1 comment
Labels

Comments

@FelipeMartins96
Copy link
Contributor

Describe the bug
Ball collision with robot chassis is not being handled

To Reproduce
Steps to reproduce the behavior:

  1. Start grSim
  2. Move ball in robot direction, between wheels
  3. Observe the ball getting inside the robot

Expected behavior
Ball should not get inside the robot

Screenshots
image

Additional context
The code creating a surface between the ball and robot chassis is currently commented on the code.

//p->createSurface(robots[k]->chassis,ball);

I tested uncommenting this line, the ball stopped getting inside the robot, but it stopped contacting properly with the kicker.

@FelipeMartins96
Copy link
Contributor Author

I've got some ideas to test, but I was wondering what this callback does

grSim/src/sslworld.cpp

Lines 116 to 133 in 8d3b8c7

bool ballCallBack(dGeomID o1,dGeomID o2,PSurface* s, int /*robots_count*/)
{
if (_w->ball->tag!=-1) //spinner adjusting
{
dReal x,y,z;
_w->robots[_w->ball->tag]->chassis->getBodyDirection(x,y,z);
s->fdir1[0] = x;
s->fdir1[1] = y;
s->fdir1[2] = 0;
s->fdir1[3] = 0;
s->usefdir1 = true;
s->surface.mode = dContactMu2 | dContactFDir1 | dContactSoftCFM;
s->surface.mu = _w->cfg->BallFriction();
s->surface.mu2 = 0.5;
s->surface.soft_cfm = 0.002;
}
return true;
}

It seems that the ball->tag value is only set to -1 on the simulation step, and never changed to another value, so as far as I can see this callback is never running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant