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

Add bullet-featherstone plugin #373

Merged
merged 50 commits into from
Oct 15, 2022
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
8a35b7a
Rename CMake project to gz
chapulina Jun 8, 2022
d091f81
Merge branch 'main' into gz_cmake_project
chapulina Jun 16, 2022
9bd970b
CMake target
chapulina Jun 16, 2022
26298a8
WIP -- adding a plugin that uses the bullet featherstone API
mxgrey Jun 22, 2022
de21325
Implementation finished -- needs testing
mxgrey Jun 24, 2022
9efed54
Adding entity management features
mxgrey Jun 29, 2022
d4cb7bc
Debugging the inexplicable SIGKILL
mxgrey Jun 29, 2022
6848f17
Remove debug output
mxgrey Jun 30, 2022
ea761f3
Fix model poses
mxgrey Jun 30, 2022
54ebb8f
Fix setting the joint torque
mxgrey Jun 30, 2022
3510c89
Merge branch 'main' into add-bullet-featherstone
ahcorde Jun 30, 2022
afbb659
Merge remote-tracking branch 'origin/main' into add-bullet-featherstone
ahcorde Jul 6, 2022
99a26b2
make linters happy
ahcorde Jul 6, 2022
0b2000f
Merge branch 'main' into add-bullet-featherstone
ahcorde Jul 7, 2022
e7d4e5b
Added common test to featherstone
ahcorde Jul 7, 2022
599ca75
Merge branch 'main' into add-bullet-featherstone
ahcorde Jul 8, 2022
baa3ba5
Fixed guard headers (#379)
ahcorde Jul 11, 2022
4d1e235
Merge branch 'main' into add-bullet-featherstone
ahcorde Jul 12, 2022
554ff4d
Merge branch 'main' into add-bullet-featherstone
ahcorde Jul 12, 2022
2ef0902
Merge branch 'main' into add-bullet-featherstone
ahcorde Jul 13, 2022
579d32e
Merge branch 'main' into add-bullet-featherstone
ahcorde Jul 15, 2022
8fca02f
Merge branch 'main' into add-bullet-featherstone
ahcorde Jul 15, 2022
886e7bd
Merge branch 'main' into add-bullet-featherstone
ahcorde Jul 15, 2022
ddb01b7
Added suggestions to #373 (#374)
ahcorde Jul 20, 2022
f3c1be2
Merge branch 'main' into add-bullet-featherstone
ahcorde Jul 26, 2022
46650dc
Merge branch 'main' into add-bullet-featherstone
scpeters Jul 29, 2022
39a3354
⬆️ Bump main to 7.0.0~pre1 (#399)
chapulina Aug 8, 2022
dd9a61c
Merge branch 'main' into add-bullet-featherstone
ahcorde Aug 22, 2022
c352f06
Style
ahcorde Aug 26, 2022
0d89e44
Fixed test
ahcorde Aug 26, 2022
1a9a841
Fixed Dartsim SDFFeatures_TEST (#405)
ahcorde Sep 1, 2022
1e02e7d
Merge branch 'main' into add-bullet-featherstone
ahcorde Sep 2, 2022
89e911f
Rmoved common test world_features
ahcorde Sep 5, 2022
ace7d0f
Merge remote-tracking branch 'origin/gz-physics6' into add-bullet-fea…
ahcorde Sep 13, 2022
169f16c
Update target to gz-physics6
mjcarroll Sep 14, 2022
16abf65
Added Shapes Features to bullet-featherstone (#382)
ahcorde Sep 16, 2022
3acc6fb
Bullet featherstone fix joint pose (#418)
ahcorde Sep 19, 2022
1ba9c2d
Merge branch 'gz-physics6' into add-bullet-featherstone
ahcorde Sep 20, 2022
6215f68
Fixed pose in attach methods
ahcorde Sep 20, 2022
1994480
[bullet-featherstone] mesh collisions (#424)
mjcarroll Sep 20, 2022
3981fdb
Fixed bullet-featherstone mesh collisions (#425)
ahcorde Sep 21, 2022
a5b2f7d
Bullet-featherstone fix ellipsoid collision (#426)
ahcorde Sep 21, 2022
ffda143
Bullet-featherstone Added detachable joints (#428)
ahcorde Sep 29, 2022
e2aed3f
Merge branch 'gz-physics6' into add-bullet-featherstone
ahcorde Oct 6, 2022
31df0db
Removed traces from test
ahcorde Oct 6, 2022
36e57a2
Bullet featherstone: Added contacts and improved simulation tests (#429)
ahcorde Oct 12, 2022
ade8b92
Added FreeGroupWorld Velocities and minor fixes (#435)
ahcorde Oct 13, 2022
04737e8
Bullet-featherstone: Apply external forces and torques (#438)
mjcarroll Oct 13, 2022
590718e
Merge branch 'gz-physics6' into add-bullet-featherstone
mjcarroll Oct 13, 2022
d7fd295
Bullet-featherstone: comment out ellipsoid on focal (#439)
mjcarroll Oct 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ set(GZ_PHYSICS_ENGINE_INSTALL_DIR
# Configure the build
#============================================================================
gz_configure_build(QUIT_IF_BUILD_ERRORS
COMPONENTS sdf heightmap mesh dartsim tpe bullet)
COMPONENTS sdf heightmap mesh dartsim tpe bullet bullet-featherstone)


#============================================================================
Expand Down
74 changes: 74 additions & 0 deletions bullet-featherstone/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# This component expresses custom features of the bullet plugin, which can
# expose native bullet data types.
gz_add_component(bullet-featherstone INTERFACE
DEPENDS_ON_COMPONENTS sdf mesh
GET_TARGET_NAME features)

link_directories(${BULLET_LIBRARY_DIRS})
target_link_libraries(${features} INTERFACE IgnBullet::IgnBullet)

gz_get_libsources_and_unittests(sources test_sources)

# TODO(MXG): Think about an gz_add_plugin(~) macro for ign-cmake
set(engine_name bullet-featherstone-plugin)
gz_add_component(${engine_name}
SOURCES ${sources}
DEPENDS_ON_COMPONENTS bullet-featherstone
GET_TARGET_NAME bullet_plugin)

target_link_libraries(${bullet_plugin}
PUBLIC
${features}
${PROJECT_LIBRARY_TARGET_NAME}-sdf
${PROJECT_LIBRARY_TARGET_NAME}-mesh
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-math${GZ_MATH_VER}::eigen3)

# Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir
install(TARGETS ${bullet_plugin} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})

# The library created by `gz_add_component` includes the ign-physics version
# (i.e. libgz-physics1-name-plugin.so), but for portability,
# we also install an unversioned symlink into the same versioned folder.
set(versioned ${CMAKE_SHARED_LIBRARY_PREFIX}${bullet_plugin}${CMAKE_SHARED_LIBRARY_SUFFIX})
set(unversioned ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME_NO_VERSION_LOWER}-${engine_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
if (WIN32)
# disable MSVC inherit via dominance warning
target_compile_options(${bullet_plugin} PUBLIC "/wd4250")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy
${GZ_PHYSICS_ENGINE_INSTALL_DIR}\/${versioned}
${GZ_PHYSICS_ENGINE_INSTALL_DIR}\/${unversioned})")
else()
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned})
INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})
endif()
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned})
INSTALL(FILES ${PROJECT_BINARY_DIR}/${unversioned} DESTINATION ${GZ_PHYSICS_ENGINE_INSTALL_DIR})

# Testing
gz_build_tests(
TYPE UNIT_bullet_featherstone
SOURCES ${test_sources}
LIB_DEPS
${features}
gz-plugin${GZ_PLUGIN_VER}::loader
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
${PROJECT_LIBRARY_TARGET_NAME}-sdf
${PROJECT_LIBRARY_TARGET_NAME}-mesh
TEST_LIST tests)

foreach(test ${tests})

target_compile_definitions(${test} PRIVATE
"bullet_plugin_LIB=\"$<TARGET_FILE:${bullet_plugin}>\""
"TEST_WORLD_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/worlds/\""
"GZ_PHYSICS_RESOURCE_DIR=\"${GZ_PHYSICS_RESOURCE_DIR}\"")

endforeach()

if(TARGET UNIT_FindFeatures_TEST)

target_compile_definitions(UNIT_FindFeatures_TEST PRIVATE
"bullet_plugin_LIB=\"$<TARGET_FILE:${bullet_plugin}>\"")

endif()
45 changes: 45 additions & 0 deletions bullet-featherstone/src/Base.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2022 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#include "Base.hh"

namespace gz {
namespace physics {
namespace bullet_featherstone {

/////////////////////////////////////////////////
WorldInfo::WorldInfo(std::string name_)
: name(std::move(name_))
{
this->collisionConfiguration =
std::make_unique<btDefaultCollisionConfiguration>();
this->dispatcher =
std::make_unique<btCollisionDispatcher>(collisionConfiguration.get());
this->broadphase = std::make_unique<btDbvtBroadphase>();
this->solver = std::make_unique<btMultiBodyConstraintSolver>();
this->world = std::make_unique<btMultiBodyDynamicsWorld>(
dispatcher.get(), broadphase.get(), solver.get(),
collisionConfiguration.get());

/* TO-DO(Lobotuerk): figure out what this line does*/
world->getSolverInfo().m_globalCfm = 0;
btGImpactCollisionAlgorithm::registerAlgorithm(dispatcher.get());
}

} // namespace bullet_featherstone
} // namespace physics
} // namespace gz
Loading