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

how to get tow collide objs contacts #590

Open
myagen opened this issue Dec 23, 2022 · 0 comments
Open

how to get tow collide objs contacts #590

myagen opened this issue Dec 23, 2022 · 0 comments

Comments

@myagen
Copy link

myagen commented Dec 23, 2022

hello my friends
I noticed that getting the contact points of two colliding objects was wrong,as bellow is my testing codes

fcl::CollisionResult<S> local_resul;

local_result.clear();
std::vector<Contact<S>> contacts;
contacts.clear();

detail::MeshCollisionTraversalNode<BV> node;
```
if (!detail::initialize(
node, m1, pose1, m2, pose2,
CollisionRequest<S>(num_max_contacts, true, num_max_contacts, true), local_result)) {
return -1;
}


           ` node.enable_statistics = true;`

           ` detail::collide(&node);`
          `  if (local_result.numContacts() > 0) {`
             `   /*local_result.getContacts(contacts);`
            `    std::sort(contacts.begin(), contacts.end());*/`
              `  local_result.clear();`

              `  CollisionRequest<S> request(num_max_contacts, true);`
             `   int num_contacts = collide(&m1, pose1, &m2, pose2, request, local_result);`
            `    local_result.getContacts(contacts);// `
}

local_result.getContacts(contacts);  is not right to get the contacts

could you tell us how to get these contact points by use the function getContacts

Thanks!
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

No branches or pull requests

1 participant