You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get incorrect nearest points when I use the following code:
#include <fcl/narrowphase/distance.h>
using namespace fcl;
using S = double;
int main(){
Sphere<S> s1{20};
Sphere<S> s2{10};
Transform3<S> tf1{Transform3<S>::Identity()};
Transform3<S> tf2{Transform3<S>::Identity()};
DistanceRequest<S> request;
request.enable_signed_distance = true;
request.enable_nearest_points = true;
request.gjk_solver_type = GST_LIBCCD;
DistanceResult<S> result;
bool res{false};
// Expecting distance to be 10
result.clear();
tf2.translation() = Vector3<S>(0, 40, 0);
res = distance(&s1, tf1, &s2, tf2, request, result);
std::cout<<"fcl_result = "<<result.min_distance<<std::endl;
std::cout<<"fcl_result point 1 = "<<result.nearest_points[0]<<std::endl;
std::cout<<"fcl_result point 2 = "<<result.nearest_points[1]<<std::endl;
return 0;
}
The output of the executable is
fcl_result = 25
fcl_result point 1 = 0
27.3333
0
fcl_result point 2 = 0
-13.6667
0
This is copied almost verbatim from the tests, specifically the test_distance_spheresphere(...) function in test_fcl_signed_distance. The only difference is that tf2.translation() = Vector3<S>(0, 40, 0); instead of tf2.translation() = Vector3<S>( 40, 0, 0); (ie X and Y are flipped).
This also happens with using the Z coordinate, and with other primitives.
The text was updated successfully, but these errors were encountered:
I get incorrect nearest points when I use the following code:
The output of the executable is
This is copied almost verbatim from the tests, specifically the test_distance_spheresphere(...) function in test_fcl_signed_distance. The only difference is that
tf2.translation() = Vector3<S>(0, 40, 0);
instead oftf2.translation() = Vector3<S>( 40, 0, 0);
(ie X and Y are flipped).This also happens with using the Z coordinate, and with other primitives.
The text was updated successfully, but these errors were encountered: