# Physics Simulation Forum

 Page 1 of 1 [ 7 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: RBDL - Rigid Body Dynamics LibraryPosted: Sat Mar 31, 2012 4:02 pm

Joined: Sat Oct 29, 2011 9:32 pm
Posts: 12
Hi everyone,

I have been working on a reduced coordinate rigid body dynamics library written in C++ that might be of use for some people around here. Unlike bullet, which includes integrators and collision checking, this library focuses on the dynamics of rigid multi-body systems. It is a fairly efficient[1] implementation of some well know dynamics algorithms, such as:

• Recursive Newton Euler Algorithm for inverse dynamics
• Composite Rigid Body Algorithm to compute the joint space inertia matrix
• Articulated Body Algorithm (sometimes called "Featherstone Algorithm") for forward dynamics

Furthermore it contains some methods for forward and inverse kinematics and contact handling (i.e. the method described by Kokkevis and Metaxas in the Paper "Practical Physics for Articulated Characters", Game Developers Conference, 2004).

The code is tested using ~90 automated tests and uses Eigen3 (http://eigen.tuxfamily.org/index.php?title=Main_Page) as a underlying math library, but different libraries could be incorporated instead. Currently I use this software in my daily scientific research to generate human and robot motions using optimal control methods.

It is available under the zlib license and the code is hosted by bitbucket.

Best regards,
Martin

[1] some raw numbers concerning efficiency (system specs: i7 920 processor and a 64 bit Ubuntu Linux):
For a model with 31 degrees of freedom:
inverse dynamics: 0.79 * 1.0e-5 (s)
forward dynamics: 1.85 * 1.0e-5 (s)
The numbers represent the average time spent for each function that were obtained with the benchmark program that comes with the code and a sample count of 100.000 calls to each method.

Top

 Post subject: Re: RBDL - Rigid Body Dynamics LibraryPosted: Sun May 13, 2012 7:17 am

Joined: Sun May 13, 2012 7:14 am
Posts: 4
This is awesome!

I tried to compile the source with Visual Studio 10 on Windows 7 and got the following error:

1. Cmake command I used to generate rbdl.sln
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release ..\

2. Visual Studio 2010 build error:

Error 1 error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::string' (or there is no acceptable conversion) C:\Users\Kevin\Source\RBDL\rbdl\src\rbdl_version.cc 32 1 rbdl
Warning 2 warning C4099: 'RigidBodyDynamics::Model' : type name first seen using 'class' now seen using 'struct' c:\users\kevin\source\rbdl\rbdl\src\Model.h 129 1 rbdl
Warning 3 warning C4099: 'RigidBodyDynamics::Model' : type name first seen using 'class' now seen using 'struct' c:\users\kevin\source\rbdl\rbdl\src\Model.h 129 1 rbdl
Warning 4 warning C4244: 'argument' : conversion from 'double' to 'unsigned int', possible loss of data C:\Users\Kevin\Source\RBDL\rbdl\src\Model.cc 31 1 rbdl
Warning 5 warning C4099: 'RigidBodyDynamics::Model' : type name first seen using 'class' now seen using 'struct' c:\users\kevin\source\rbdl\rbdl\src\Model.h 129 1 rbdl
Error 6 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Kinematics.cc 28 1 rbdl
Error 7 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Kinematics.cc 73 1 rbdl
Error 8 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Kinematics.cc 191 1 rbdl
Error 9 error C2057: expected constant expression C:\Users\Kevin\Source\RBDL\rbdl\src\Kinematics.cc 211 1 rbdl
Error 10 error C2466: cannot allocate an array of constant size 0 C:\Users\Kevin\Source\RBDL\rbdl\src\Kinematics.cc 211 1 rbdl
Error 11 error C2133: 'e' : unknown size C:\Users\Kevin\Source\RBDL\rbdl\src\Kinematics.cc 211 1 rbdl
Error 12 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Kinematics.cc 240 1 rbdl
Error 13 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Kinematics.cc 294 1 rbdl
Warning 14 warning C4018: '<' : signed/unsigned mismatch C:\Users\Kevin\Source\RBDL\rbdl\src\Kinematics.cc 374 1 rbdl
Warning 15 warning C4018: '<' : signed/unsigned mismatch C:\Users\Kevin\Source\RBDL\rbdl\src\Kinematics.cc 433 1 rbdl
Warning 16 warning C4099: 'RigidBodyDynamics::Model' : type name first seen using 'class' now seen using 'struct' c:\users\kevin\source\rbdl\rbdl\src\Model.h 129 1 rbdl
Warning 17 warning C4099: 'RigidBodyDynamics::Model' : type name first seen using 'struct' now seen using 'class' c:\users\kevin\source\rbdl\rbdl\src\Dynamics.h 21 1 rbdl
Error 18 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Dynamics.cc 35 1 rbdl
Error 19 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Dynamics.cc 196 1 rbdl
Error 20 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Dynamics.cc 240 1 rbdl
Error 21 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Dynamics.cc 311 1 rbdl
Warning 22 warning C4099: 'RigidBodyDynamics::Model' : type name first seen using 'class' now seen using 'struct' c:\users\kevin\source\rbdl\rbdl\src\Model.h 129 1 rbdl
Warning 23 warning C4099: 'RigidBodyDynamics::Model' : type name first seen using 'struct' now seen using 'class' c:\users\kevin\source\rbdl\rbdl\src\Dynamics.h 21 1 rbdl
Error 24 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Contacts.cc 141 1 rbdl
Error 25 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Contacts.cc 287 1 rbdl
Error 26 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Contacts.cc 399 1 rbdl
Error 27 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Contacts.cc 488 1 rbdl
Error 28 error C2065: '__func__' : undeclared identifier C:\Users\Kevin\Source\RBDL\rbdl\src\Contacts.cc 553 1 rbdl
29 IntelliSense: no operator "==" matches these operands c:\users\kevin\source\rbdl\rbdl\src\rbdl_version.cc 32 21 rbdl

Top

 Post subject: Re: RBDL - Rigid Body Dynamics LibraryPosted: Sun May 13, 2012 1:01 pm

Joined: Sat Oct 29, 2011 9:32 pm
Posts: 12
Hi kingchurch,

I tried to fix all warnings and compiler errors you posted. But unfortunately I do not have access to a Visual Studio 10 compiler right now.

Thank you!
Martin

Top

 Post subject: Re: RBDL - Rigid Body Dynamics LibraryPosted: Sun May 13, 2012 5:05 pm

Joined: Sun May 13, 2012 7:14 am
Posts: 4
The "ALL_BUILD" project builds fine now! Thanks!
The "INSTALL" project still has some build errors, not sure if it's intended for windows platform:

------
Error 1 error MSB3073: The command "setlocal
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 113 6 INSTALL
-------

When I tried to run the "rbdl" project it pops an error box as the following:

"Microsoft Visual Studio - Unable to start program C:\Source\RBDL\rbdl\build\Debug\rbdl.dll"

BTW, how to run the 60 test cases ?

Top

 Post subject: Re: RBDL - Rigid Body Dynamics LibraryPosted: Sun May 13, 2012 5:45 pm

Joined: Sat Oct 29, 2011 9:32 pm
Posts: 12
The "INSTALL" project is used to install the library and header files to the appropriate directories in Linux and similar operating systems as they have a certain specification where to put things.

To use the library in Windows it is sufficient to build the dll. To use RBDL in a project you would then have to tell the compiler where to look for the include files (in your case this would be the path to the src folder of the RBDL and additionally the folder "src" in the "build" directory) and tell the linker where to find the rbdl.dll (probably "build/rbdl.dll"). With this you should be able to use RBDL in any project.

To run the test cases you need the UnitTest++ testing framework. You can find it at http://unittest-cpp.sourceforge.net/. Once obtained, you would then have to tell CMake where to find it. Easiest way would probably be using the CMake GUI.

Please note that the RBDL is only a library. It does not come with an executable that can be run to look or modify simulations. You would have to write an integrator and visualisation yourself to do so.

Top

 Post subject: Re: RBDL - Rigid Body Dynamics LibraryPosted: Sun May 13, 2012 6:00 pm

Joined: Sun May 13, 2012 7:14 am
Posts: 4
The INSTALL problem is because of lack of administrative privilege. It can be worked around by copy/paste the install cmake command line to a command prompt with administrative privilege. With that the RBDL header files can be installed to "C:\Program Files (x86)\RBDL\include\rbdl". However the library files were not installed to the "C:\Program Files (x86)\RBDL" folder.

However then I met CMake problems for "tests" folder as the following:

~~~~
Microsoft Windows [Version 6.1.7600]

c:\Source\RBDL\rbdl\tests>mkdir build
c:\Source\RBDL\rbdl\tests>cd build
c:\Source\RBDL\rbdl\tests\build>cmake ..\
-- Building for: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at C:/Users/Source/RBDL/rbdl/CMake/FindUnitTest++.cmake:33 (ME
SSAGE):
Could not find UnitTest++
Call Stack (most recent call first):
CMakeLists.txt:26 (FIND_PACKAGE)

~~~~~~~~~

Also CMAKE fails for "example" folder as the following:

~~~~~~~~~~
Microsoft Windows [Version 6.1.7600]

c:\Source\RBDL\rbdl\tests>mkdir build

c:\Source\RBDL\rbdl\tests>cd build

c:\Source\RBDL\rbdl\tests\build>cmake ..\
-- Building for: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at C:/Source/RBDL/rbdl/CMake/FindUnitTest++.cmake:33 (ME
SSAGE):
Could not find UnitTest++
Call Stack (most recent call first):
CMakeLists.txt:26 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!

Top

 Post subject: Re: RBDL - Rigid Body Dynamics LibraryPosted: Sun May 13, 2012 6:28 pm

Joined: Sat Oct 29, 2011 9:32 pm
Posts: 12
All the errors you posted are due to CMake not finding UnitTest++:
kingchurch wrote:
CMake Error at C:/Users/Source/RBDL/rbdl/CMake/FindUnitTest++.cmake:33 (ME
SSAGE):
Could not find UnitTest++
Call Stack (most recent call first):
CMakeLists.txt:26 (FIND_PACKAGE)
Please install it and set the CMake variables UNITTEST++_INCLUDE_DIR and UNITTEST++_LIBRARY appropriately if they are not detected automatically. This is best done with the CMake GUI.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 7 posts ]

#### Who is online

Users browsing this forum: No registered users and 0 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities