Skip to content

Commit

Permalink
fixup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Aug 28, 2018
1 parent a689e5b commit 1d99a26
Show file tree
Hide file tree
Showing 40 changed files with 1,439 additions and 1,370 deletions.
25 changes: 19 additions & 6 deletions tesseract_collision/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8.3)
project(tesseract_collision)

add_compile_options(-std=c++11 -Wall -Wextra)
add_definitions(-DBT_USE_DOUBLE_PRECISION)

find_package(catkin REQUIRED COMPONENTS
bullet3_ros
Expand Down Expand Up @@ -43,7 +44,8 @@ include_directories(
)

add_library(${PROJECT_NAME}_bullet
src/bullet/bullet_contact_checker.cpp
src/bullet/bullet_cast_managers.cpp
src/bullet/bullet_discrete_managers.cpp
src/bullet/bullet_utils.cpp
)

Expand All @@ -70,6 +72,14 @@ if (CATKIN_ENABLE_TESTING)

find_package(rostest REQUIRED)

find_package(OpenMP REQUIRED)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else(OPENMP_FOUND)
message (STATUS "Not found OpenMP")
endif()

include_directories(
${catkin_INCLUDE_DIRS}
)
Expand All @@ -83,15 +93,18 @@ if (CATKIN_ENABLE_TESTING)
catkin_add_gtest(${PROJECT_NAME}_box_cone_unit test/collision_box_cone_unit.cpp)
target_link_libraries(${PROJECT_NAME}_box_cone_unit ${PROJECT_NAME}_bullet ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES})

catkin_add_gtest(${PROJECT_NAME}_box_mesh_unit test/collision_box_mesh_unit.cpp)
target_link_libraries(${PROJECT_NAME}_box_mesh_unit ${PROJECT_NAME}_bullet ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES})

catkin_add_gtest(${PROJECT_NAME}_box_box_mesh_unit test/collision_box_box_mesh_unit.cpp)
target_link_libraries(${PROJECT_NAME}_box_box_mesh_unit ${PROJECT_NAME}_bullet ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES})
catkin_add_gtest(${PROJECT_NAME}_box_box_unit test/collision_box_box_unit.cpp)
target_link_libraries(${PROJECT_NAME}_box_box_unit ${PROJECT_NAME}_bullet ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES})

catkin_add_gtest(${PROJECT_NAME}_large_dataset_unit test/collision_large_dataset_unit.cpp)
target_link_libraries(${PROJECT_NAME}_large_dataset_unit ${PROJECT_NAME}_bullet ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES})

catkin_add_gtest(${PROJECT_NAME}_sphere_sphere_unit test/collision_sphere_sphere_unit.cpp)
target_link_libraries(${PROJECT_NAME}_sphere_sphere_unit ${PROJECT_NAME}_bullet ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES})

catkin_add_gtest(${PROJECT_NAME}_multi_threaded_unit test/collision_multi_threaded_unit.cpp)
target_link_libraries(${PROJECT_NAME}_multi_threaded_unit ${PROJECT_NAME}_bullet ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES})

# catkin_add_gtest(${PROJECT_NAME}_convex_concave_unit test/convex_concave_unit.cpp)
# target_link_libraries(${PROJECT_NAME}_convex_concave_unit ${PROJECT_NAME}_bullet ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES})
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/

#include <tesseract_collision/bullet/bullet_utils.h>
#include <tesseract_collision/continuous_contact_manager_base.h>
#include <tesseract_core/continuous_contact_manager_base.h>

#ifndef TESSERACT_COLLISION_BULLET_CAST_MANAGERS_H
#define TESSERACT_COLLISION_BULLET_CAST_MANAGERS_H
Expand All @@ -53,11 +53,8 @@ class BulletCastSimpleManager : public ContinuousContactManagerBase
{
public:

/**
* @brief Constructor
* @param dispatcher The collision dispatcher. This class does not take ownershipe of the pointer.
*/
BulletCastSimpleManager(btCollisionDispatcher* dispatcher);
BulletCastSimpleManager();
~BulletCastSimpleManager() {}

ContinuousContactManagerBasePtr clone() const override;

Expand Down Expand Up @@ -92,7 +89,7 @@ class BulletCastSimpleManager : public ContinuousContactManagerBase

const ContactRequest& getContactRequest() const override;

void contactTest(ContactDistanceData& collisions) override;
void contactTest(ContactResultMap& collisions) override;

/**
* @brief A a bullet collision object to the manager
Expand All @@ -101,12 +98,13 @@ class BulletCastSimpleManager : public ContinuousContactManagerBase
void addCollisionObject(COWPtr& cow);

private:
ContactRequest request_; /**< @brief The active contact request message */
btCollisionDispatcher* dispatcher_; /**< @brief The bullet collision dispatcher used for getting object to object collison algorithm */
btDispatcherInfo dispatch_info_; /**< @brief The bullet collision dispatcher configuration information */
Link2Cow link2cow_; /**< @brief A map of all (static and active) collision objects being managed */
std::vector<COWPtr> cows_; /**< @brief A vector of collision objects (active followed by static) */
Link2Cow link2castcow_; /**< @brief A map of cast (active) collision objects being managed. */
ContactRequest request_; /**< @brief The active contact request message */
std::unique_ptr<btCollisionDispatcher> dispatcher_; /**< @brief The bullet collision dispatcher used for getting object to object collison algorithm */
btDispatcherInfo dispatch_info_; /**< @brief The bullet collision dispatcher configuration information */
btDefaultCollisionConfiguration coll_config_; /**< @brief The bullet collision configuration */
Link2Cow link2cow_; /**< @brief A map of all (static and active) collision objects being managed */
std::vector<COWPtr> cows_; /**< @brief A vector of collision objects (active followed by static) */
Link2Cow link2castcow_; /**< @brief A map of cast (active) collision objects being managed. */

};
typedef std::shared_ptr<BulletCastSimpleManager> BulletCastSimpleManagerPtr;
Expand Down Expand Up @@ -159,11 +157,7 @@ class BulletCastBVHManager : public ContinuousContactManagerBase
{
public:

/**
* @brief Constructor
* @param dispatcher The collision dispatcher. This class does not take ownershipe of the pointer.
*/
BulletCastBVHManager(btCollisionDispatcher* dispatcher);
BulletCastBVHManager();
~BulletCastBVHManager();

ContinuousContactManagerBasePtr clone() const override;
Expand Down Expand Up @@ -199,7 +193,7 @@ class BulletCastBVHManager : public ContinuousContactManagerBase

const ContactRequest& getContactRequest() const override;

void contactTest(ContactDistanceData& collisions) override;
void contactTest(ContactResultMap& collisions) override;

/**
* @brief A a bullet collision object to the manager
Expand All @@ -209,8 +203,9 @@ class BulletCastBVHManager : public ContinuousContactManagerBase

private:
ContactRequest request_; /**< @brief The active contact request message */
btCollisionDispatcher* dispatcher_; /**< @brief The bullet collision dispatcher used for getting object to object collison algorithm */
std::unique_ptr<btCollisionDispatcher> dispatcher_; /**< @brief The bullet collision dispatcher used for getting object to object collison algorithm */
btDispatcherInfo dispatch_info_; /**< @brief The bullet collision dispatcher configuration information */
btDefaultCollisionConfiguration coll_config_; /**< @brief The bullet collision configuration */
std::unique_ptr<btBroadphaseInterface> broadphase_; /**< @brief The bullet broadphase interface */
Link2Cow link2cow_; /**< @brief A map of all collision objects being managed */
Link2Cow link2castcow_; /**< @brief A map of cast collision objects being managed. */
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#define TESSERACT_COLLISION_BULLET_DISCRETE_MANAGERS_H

#include <tesseract_collision/bullet/bullet_utils.h>
#include <tesseract_collision/discrete_contact_manager_base.h>
#include <tesseract_core/discrete_contact_manager_base.h>
namespace tesseract
{

Expand All @@ -51,11 +51,8 @@ class BulletDiscreteSimpleManager : public DiscreteContactManagerBase
{
public:

/**
* @brief Constructor
* @param dispatcher The collision dispatcher. This class does not take ownershipe of the pointer.
*/
BulletDiscreteSimpleManager(btCollisionDispatcher* dispatcher);
BulletDiscreteSimpleManager();
~BulletDiscreteSimpleManager() {}

DiscreteContactManagerBasePtr clone() const override;

Expand All @@ -80,7 +77,7 @@ class BulletDiscreteSimpleManager : public DiscreteContactManagerBase

void setCollisionObjectsTransform(const TransformMap& transforms) override;

void contactTest(ContactDistanceData& collisions) override;
void contactTest(ContactResultMap &collisions) override;

void setContactRequest(const ContactRequest& req) override;

Expand All @@ -99,11 +96,12 @@ class BulletDiscreteSimpleManager : public DiscreteContactManagerBase
const Link2Cow& getCollisionObjects() const;

private:
ContactRequest request_; /**< @brief The active contact request message */
btCollisionDispatcher* dispatcher_; /**< @brief The bullet collision dispatcher used for getting object to object collison algorithm */
btDispatcherInfo dispatch_info_; /**< @brief The bullet collision dispatcher configuration information */
Link2Cow link2cow_; /**< @brief A map of all (static and active) collision objects being managed */
std::vector<COWPtr> cows_; /**< @brief A vector of collision objects (active followed by static) */
ContactRequest request_; /**< @brief The active contact request message */
std::unique_ptr<btCollisionDispatcher> dispatcher_; /**< @brief The bullet collision dispatcher used for getting object to object collison algorithm */
btDispatcherInfo dispatch_info_; /**< @brief The bullet collision dispatcher configuration information */
btDefaultCollisionConfiguration coll_config_; /**< @brief The bullet collision configuration */
Link2Cow link2cow_; /**< @brief A map of all (static and active) collision objects being managed */
std::vector<COWPtr> cows_; /**< @brief A vector of collision objects (active followed by static) */

};
typedef std::shared_ptr<BulletDiscreteSimpleManager> BulletDiscreteSimpleManagerPtr;
Expand Down Expand Up @@ -153,12 +151,7 @@ class BulletDiscreteBVHManager : public DiscreteContactManagerBase
{
public:

/**
* @brief Constructor
* @param dispatcher The collision dispatcher. This class does not take ownershipe of the pointer.
*/
BulletDiscreteBVHManager(btCollisionDispatcher* dispatcher);

BulletDiscreteBVHManager();
~BulletDiscreteBVHManager();

DiscreteContactManagerBasePtr clone() const override;
Expand All @@ -184,7 +177,7 @@ class BulletDiscreteBVHManager : public DiscreteContactManagerBase

void setCollisionObjectsTransform(const TransformMap& transforms) override;

void contactTest(ContactDistanceData& collisions) override;
void contactTest(ContactResultMap& collisions) override;

void setContactRequest(const ContactRequest& req) override;

Expand All @@ -204,8 +197,9 @@ class BulletDiscreteBVHManager : public DiscreteContactManagerBase

private:
ContactRequest request_; /**< @brief The active contact request message */
btCollisionDispatcher* dispatcher_; /**< @brief The bullet collision dispatcher used for getting object to object collison algorithm */
std::unique_ptr<btCollisionDispatcher> dispatcher_; /**< @brief The bullet collision dispatcher used for getting object to object collison algorithm */
btDispatcherInfo dispatch_info_; /**< @brief The bullet collision dispatcher configuration information */
btDefaultCollisionConfiguration coll_config_; /**< @brief The bullet collision configuration */
std::unique_ptr<btBroadphaseInterface> broadphase_; /**< @brief The bullet broadphase interface */
Link2Cow link2cow_; /**< @brief A map of all (static and active) collision objects being managed */

Expand Down
Loading

0 comments on commit 1d99a26

Please sign in to comment.