42 #include "gtest/gtest.h" 51 std::shared_ptr<Box<S>> box0(
new Box<S>(1,1,1));
52 std::shared_ptr<Box<S>> box1(
new Box<S>(1,1,1));
56 std::vector<ContactPoint<S>> contact_points;
61 tf0.linear() =
Quaternion<S>(.6, .8, 0, 0).toRotationMatrix();
64 bool res = solver.
shapeIntersect(*box0, tf0, *box1, tf1, &contact_points);
68 for (
const auto& contact_point : contact_points)
70 cout <<
"contact points: " << contact_point.pos.transpose() << endl;
71 cout <<
"pen depth: " << contact_point.penetration_depth << endl;
72 cout <<
"normal: " << contact_point.normal << endl;
74 cout <<
"result: " << res << endl;
86 vector<Contact<S>> contacts;
89 cout << contacts.size() <<
" contacts found" << endl;
91 cout <<
"position: " << contact.pos << endl;
99 test_general<double>();
103 int main(
int argc,
char* argv[])
105 ::testing::InitGoogleTest(&argc, argv);
106 return RUN_ALL_TESTS();
FCL_DEPRECATED bool shapeIntersect(const Shape1 &s1, const Transform3< S > &tf1, const Shape2 &s2, const Transform3< S > &tf2, Vector3< S > *contact_points, S *penetration_depth, Vector3< S > *normal) const
intersection checking between two shapes
Eigen::Quaternion< S > Quaternion
Eigen::Transform< S, 3, Eigen::Isometry > Transform3
int main(int argc, char *argv[])
void getContacts(std::vector< Contact< S >> &contacts_)
get all the contacts
Eigen::Matrix< S, 3, 1 > Vector3
GTEST_TEST(FCL_GENERAL, general)
collision and distance solver based on libccd library.
template FCL_EXPORT std::size_t collide(const CollisionObject< double > *o1, const CollisionObject< double > *o2, const CollisionRequest< double > &request, CollisionResult< double > &result)
Parameters for performing collision request.
Center at zero point, axis aligned box.
the object for collision or distance computation, contains the geometry and the transform information...
#define EXPECT_TRUE(args)