Skip to content

Commit

Permalink
Added Simulation features common test (#362)
Browse files Browse the repository at this point in the history
Signed-off-by: ahcorde <ahcorde@gmail.com>
  • Loading branch information
ahcorde authored Jul 8, 2022
1 parent 0a7d9ea commit 0d18a15
Show file tree
Hide file tree
Showing 5 changed files with 915 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dartsim/src/ShapeFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ Vector3d ShapeFeatures::GetEllipsoidShapeRadii(
{
const auto *shapeInfo = this->ReferenceInterface<ShapeInfo>(_ellipsoidID);

dart::dynamics::EllipsoidShape *ellipsoid =
static_cast<dart::dynamics::EllipsoidShape *>(
dart::dynamics::MeshShape *ellipsoid =
static_cast<dart::dynamics::MeshShape *>(
shapeInfo->node->getShape().get());

return ellipsoid->getRadii();
return ellipsoid->getBoundingBox().getMax();
}

/////////////////////////////////////////////////
Expand Down
8 changes: 6 additions & 2 deletions test/common_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ set(TEST_TYPE "COMMON_TEST")
set(tests
basic_test
construct_empty_world
simulation_features
)

link_directories(${PROJECT_BINARY_DIR}/test)

function(configure_common_test PHYSICS_ENGINE_NAME test_name)
add_test(NAME ${test_name}_${PHYSICS_ENGINE_NAME}
COMMAND
Expand All @@ -23,11 +22,16 @@ foreach(test ${tests})
gz-plugin${GZ_PLUGIN_VER}::loader
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
${PROJECT_LIBRARY_TARGET_NAME}
${PROJECT_LIBRARY_TARGET_NAME}-sdf
gtest
gtest_main
${PROJECT_NAME}_test_lib_loader
)

target_compile_definitions(${TEST_TYPE}_${test} PRIVATE
"TEST_WORLD_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/worlds/\""
)

if (${BULLET_FOUND})
configure_common_test("bullet" ${TEST_TYPE}_${test})
endif()
Expand Down
Loading

0 comments on commit 0d18a15

Please sign in to comment.