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

Triball benchmark #30

Open
wants to merge 95 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
8dffa87
added mcap logging
yaswanth1701 May 19, 2024
3546e7f
mcap logging working
yaswanth1701 May 20, 2024
b628363
Update README.md
yaswanth1701 May 20, 2024
be140c7
minor changes
yaswanth1701 May 20, 2024
d1bf109
added results
yaswanth1701 May 20, 2024
3e9b38b
minor change
yaswanth1701 May 20, 2024
c50b659
added mcap to csv conversion script
yaswanth1701 May 22, 2024
b83987f
mcap to csv working
yaswanth1701 May 23, 2024
450bbae
minor changes
yaswanth1701 May 23, 2024
1ff4315
added quaternion to proto message
yaswanth1701 May 24, 2024
27435fb
removing simbody boxes_model_count benchmark until it's fixed
yaswanth1701 May 29, 2024
c534d62
added collision element to proto message
yaswanth1701 May 29, 2024
76b0291
added benchmark configuration to csv files
yaswanth1701 May 29, 2024
2bf6c62
added logging for multiple box left to test
yaswanth1701 Jun 1, 2024
4315b36
minor change
yaswanth1701 Jun 1, 2024
e832942
added multi box logging and tested
yaswanth1701 Jun 2, 2024
c9c2ab7
changes to cmake file
yaswanth1701 Jun 3, 2024
fcdb8a0
changes to cmakelist
yaswanth1701 Jun 4, 2024
40a0fc7
resolved python path issue
yaswanth1701 Jun 5, 2024
d36b934
Update README.md
yaswanth1701 Jul 1, 2024
42fb3eb
added log.hh which is similar to gz-sim benchmark
yaswanth1701 Jul 1, 2024
ed6a92e
changes to file path in mcap to csv file
yaswanth1701 Jul 7, 2024
c41c74b
added python package requirement to readme
yaswanth1701 Jul 9, 2024
456452a
added post processing script
yaswanth1701 Jun 2, 2024
a444b19
Post processing working
yaswanth1701 Jun 3, 2024
644e67e
added time ratio
yaswanth1701 Jun 3, 2024
d07c21f
minor changes
yaswanth1701 Jun 3, 2024
c8d806d
renamed files
yaswanth1701 Jun 3, 2024
dca522c
change to post processing
yaswanth1701 Jul 2, 2024
c8a349d
changes to results
yaswanth1701 Jul 2, 2024
b6a1d3b
changes to cmake file and post-processing
yaswanth1701 Aug 1, 2024
63cf9d5
Update README.md
yaswanth1701 Aug 1, 2024
04a89d5
deleted some files
yaswanth1701 Aug 1, 2024
37bf60a
merged with log-dev
yaswanth1701 Aug 1, 2024
3888ba8
minor changes
yaswanth1701 Aug 1, 2024
3e5f1a1
minor changes
yaswanth1701 Aug 1, 2024
9754323
post-processing
yaswanth1701 Aug 1, 2024
eb4dc1e
logging world angular velocity
yaswanth1701 Aug 3, 2024
7ebdcb3
minor changes
yaswanth1701 Aug 3, 2024
50e2baf
Merge branch 'master' into post-processing
yaswanth1701 Aug 4, 2024
2cf0b5f
Update boxes_post_processing.py
yaswanth1701 Aug 4, 2024
79d1a07
added gz source files for triball benchmark
yaswanth1701 Jul 15, 2024
f8434d8
sdf file for tirball benchmark
yaswanth1701 Jul 15, 2024
26cf0fa
added triball contact models
yaswanth1701 Jul 20, 2024
8a32424
changes to source files
yaswanth1701 Jul 20, 2024
561a407
added triball proto msg
yaswanth1701 Jul 20, 2024
1baffb4
proto msg updated
yaswanth1701 Jul 20, 2024
d4ae6d6
changes to logging for triball benchmark
yaswanth1701 Jul 22, 2024
a40873b
changes to triball.cc
yaswanth1701 Jul 22, 2024
335276d
complete triball benchmark (left to test)
yaswanth1701 Jul 25, 2024
8885735
minor changes
yaswanth1701 Jul 25, 2024
632cf1b
changes to cmake
yaswanth1701 Jul 25, 2024
02de186
changes to cmakef files
yaswanth1701 Jul 25, 2024
6cd53f2
Update CMakeLists.txt
yaswanth1701 Jul 25, 2024
3d4a1da
changes to cmake file
yaswanth1701 Jul 25, 2024
14a2a94
error fixes
yaswanth1701 Jul 25, 2024
312edc6
added proto header files into log.hh
yaswanth1701 Jul 25, 2024
56610ef
changes to proto messages
yaswanth1701 Jul 25, 2024
78946d4
added proto messages
yaswanth1701 Jul 26, 2024
1b9aca8
debugging done
yaswanth1701 Jul 26, 2024
2c48880
triball benchmakr working
yaswanth1701 Jul 27, 2024
8eb9fc4
everthing working
yaswanth1701 Jul 27, 2024
d6a1d8f
changes to log files
yaswanth1701 Jul 27, 2024
53901ab
added results
yaswanth1701 Jul 28, 2024
e7afd5a
modified results
yaswanth1701 Jul 28, 2024
aac97e4
updated results
yaswanth1701 Jul 28, 2024
e1db3b8
minor changes
yaswanth1701 Jul 29, 2024
394aad9
minor changes
yaswanth1701 Jul 29, 2024
147da75
added triball files
yaswanth1701 Jul 29, 2024
e8dfc79
few changes to clean up
yaswanth1701 Aug 1, 2024
855a3a0
added varing cog height to benchmark
yaswanth1701 Aug 4, 2024
3f76f1d
minor changes
yaswanth1701 Aug 4, 2024
2222cbd
merged with post processing and triball benchmark working
yaswanth1701 Aug 5, 2024
7874c5d
removed assert from triball.cc
yaswanth1701 Aug 5, 2024
da1fb55
minor changes
yaswanth1701 Aug 5, 2024
2a9eb02
changes to test files
yaswanth1701 Aug 5, 2024
d6dfa7b
bullet not working
yaswanth1701 Aug 5, 2024
6cda7aa
changes for sliding case of triball
yaswanth1701 Aug 6, 2024
159600e
sdf working for sliding case triball
yaswanth1701 Aug 6, 2024
33c64b0
added sliding triball test source files
yaswanth1701 Aug 6, 2024
53789ee
minor changes
yaswanth1701 Aug 6, 2024
ef3b925
triball sliding working
yaswanth1701 Aug 7, 2024
aea072f
Add files via upload
yaswanth1701 Aug 9, 2024
1cc45a6
Add files via upload
yaswanth1701 Aug 9, 2024
7be13b8
Update README.md
yaswanth1701 Aug 9, 2024
6ac670e
added post processing yet to complete
yaswanth1701 Aug 10, 2024
1581c8f
minor changes
yaswanth1701 Aug 13, 2024
eef5121
minor changes
yaswanth1701 Aug 13, 2024
e6c3742
post processing script finished left to test
yaswanth1701 Aug 13, 2024
f7696cf
changes to post-processing script
yaswanth1701 Aug 15, 2024
0874444
minor changes
yaswanth1701 Aug 17, 2024
820bbc7
minor changes
yaswanth1701 Aug 17, 2024
25ba95a
minor changes
yaswanth1701 Aug 17, 2024
1431852
minor changes
yaswanth1701 Aug 17, 2024
e6bdca3
added results
yaswanth1701 Aug 17, 2024
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
54 changes: 38 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ project(benchmark_gazebo)
enable_testing()

include(FindBoost)

find_package(PkgConfig REQUIRED)
pkg_check_modules(zstd REQUIRED IMPORTED_TARGET libzstd)
pkg_check_modules(lz4 REQUIRED IMPORTED_TARGET liblz4)

find_package(protobuf CONFIG)

if(NOT Protobuf_FOUND)
find_package(Protobuf REQUIRED)
endif()
Expand All @@ -23,27 +26,44 @@ if (NOT GAZEBO_FOUND)
message (STATUS "Looking for gazebo - not found")
message (FATAL_ERROR "Missing: Gazebo version 11.")
endif()

include_directories(${GAZEBO_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/gtest/include
${PROJECT_SOURCE_DIR}/gtest
)
link_directories(${GAZEBO_LIBRARY_DIRS})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")

# Build gtest
add_library(gtest STATIC gtest/src/gtest-all.cc)
add_library(gtest_main STATIC gtest/src/gtest_main.cc)
target_link_libraries(gtest_main gtest tbb)
set(PROTO_FILES proto/boxes_msg.proto)
include(${PROJECT_SOURCE_DIR}/tools/TestMacro.cmake)
set(MCAP_DEPENDENCIES PkgConfig::lz4 PkgConfig::zstd)

set(TEST_TYPE "BENCHMARK")
set(WORLDS_DIR_PATH "${PROJECT_SOURCE_DIR}/worlds")
set(TEST_RESULT_DIR "${PROJECT_SOURCE_DIR}/test_results")
set(TEST_TYPE "BENCHMARK")

include(${PROJECT_SOURCE_DIR}/tools/TestMacro.cmake)

set(MCAP_DEPENDENCIES PkgConfig::lz4 PkgConfig::zstd)

set(PROTO_FILES proto/boxes_msg.proto proto/triball_msg.proto
proto/Accel.proto proto/Pose.proto proto/Quaternion.proto
proto/Twist.proto proto/Vector3.proto proto/Wrench.proto)

include_directories(${Protobuf_INCLUDE_DIRS})

protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})

configure_file(${PROJECT_SOURCE_DIR}/PathConfig.h.in PathConfig.h)

set(PROTOBUF_DESCRIPTION_DIR ${CMAKE_SOURCE_DIR}/mcap/cpp/examples/protobuf/)
set(PROTOBUF_DESCRIPTION_SRC
${PROTOBUF_DESCRIPTION_DIR}/BuildFileDescriptorSet.cpp
)

set(TEST_NAME boxes)
# Boxes tests
set(BOXES_TEST_FILES
boxes_dt.cc
Expand All @@ -52,20 +72,22 @@ set(BOXES_TEST_FILES
set(GZ_BUILD_TESTS_EXTRA_EXE_SRCS
boxes.cc
)
set(PROTOBUF_DESCRIPTION_DIR ${CMAKE_SOURCE_DIR}/mcap/cpp/examples/protobuf/)
set(PROTOBUF_DESCRIPTION_SRC
${PROTOBUF_DESCRIPTION_DIR}/BuildFileDescriptorSet.cpp
)

gz_build_tests(${BOXES_TEST_FILES})

set_tests_properties(BENCHMARK_boxes_dt PROPERTIES TIMEOUT 500)
set_tests_properties(BENCHMARK_boxes_model_count PROPERTIES TIMEOUT 3000)

# # Collide sphere tests
# set(COLLIDE_SPHERES_TEST_FILES
# collide_spheres_dt.cc
# )
# set(GZ_BUILD_TESTS_EXTRA_EXE_SRCS
# collide_spheres.cc
# )
# gz_build_tests(${COLLIDE_SPHERES_TEST_FILES})
set(TEST_NAME triball)
set(TRIBALL_TEST_FILES
triball_configuration.cc
triball_sliding.cc
)

set(GZ_BUILD_TESTS_EXTRA_EXE_SRCS
triball.cc
)

gz_build_tests(${TRIBALL_TEST_FILES})

set_tests_properties(BENCHMARK_triball_configuration PROPERTIES TIMEOUT 500)
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ or on your own machine following the instructions given below:
![boxes benchmark animation: simple trajectory](img/boxes_5_simple.gif)
![boxes benchmark animation: complex trajectory](img/boxes_5_complex.gif)

* [Triball: rigid bodies in contact](triball_description.ipynb)

These benchmarks can be run for the physics engines supported by gazebo:

* [Open Dynamics Engine (ODE)](http://ode.org), (source code on [bitbucket](https://bitbucket.org/odedevs/ode))
Expand All @@ -37,7 +39,8 @@ and then clone and build the benchmarks:

~~~
git clone https://github.com/scpeters/benchmark
pip install lz4 protobuf zstandard
pip install lz4 protobuf zstandard pandas
sudo apt-get install python3-gz-math7
cd benchmark
git submodule update --init --recursive
mkdir build
Expand Down
8 changes: 4 additions & 4 deletions boxes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ void BoxesTest::Boxes(const std::string &_physicsEngine, double _dt,

auto model = models[model_no];
link = model->GetLink();
// linear velocity
// linear velocity in world frame
ignition::math::Vector3d v = link->WorldCoGLinearVel();
// angular velocity
// angular velocity in world frame
ignition::math::Vector3d a = link->WorldAngularVel();
log.recordTwist(model_no, v, a);
// linear position

// linear position in world frame
ignition::math::Pose3d pose = link->WorldInertialPose();
log.recordPose(model_no, pose);
}
Expand Down
1 change: 1 addition & 0 deletions boxes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace gazebo
, bool
, bool
> char1double1int1bool2;

class BoxesTest : public ServerFixture,
public testing::WithParamInterface<char1double1int1bool2>
{
Expand Down
Loading