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

fcl::distance crashes with access violation when using fcl::Halfspace #623

Open
SalomeOffer opened this issue Sep 4, 2024 · 0 comments
Open

Comments

@SalomeOffer
Copy link

Hi,
I am encountering an access violation exception when using fcl::distance with an fcl::Halfspacef object. The exception occurs consistently whenever I attempt to calculate the distance between an fcl::Boxf and an fcl::Halfspacef.

What i did :

  1. Create a fcl::Boxf object and an fcl::Halfspacef object.
  2. Set up fcl::CollisionObjectf instances for both geometries with identity transforms.
  3. Attempt to compute the distance using fcl::distance.
  4. The program crashes with an access violation exception.

Code Snippet :

Eigen::Vector3f right_normal(1.0f, 0.0f, 0.0f); // X-axis aligned
float           offset = 0.0f;
auto            right_halfspace = std::make_shared<fcl::Halfspacef>(right_normal, offset);

// Create the box with dimensions
float len = 4.0f;
auto  box = std::make_shared<fcl::Boxf>(len, len, len);

// Set up collision objects with identity transforms
fcl::CollisionObjectf halfspace_obj(right_halfspace, fcl::Transform3f::Identity());
fcl::CollisionObjectf box_obj(box, fcl::Transform3f::Identity());

// Prepare distance request and result structures
fcl::DistanceRequestf request;
fcl::DistanceResultf  result;

// Compute the distance
fcl::distance(&box_obj, &halfspace_obj, request, result);

// Retrieve the minimum distance
auto min_dist = result.min_distance;

Questions:
Does this imply that fcl::distance does not support fcl::Halfspacef?

Best Regards,

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