Giter Club home page Giter Club logo

rbdl / rbdl Goto Github PK

View Code? Open in Web Editor NEW
508.0 16.0 140.0 15.1 MB

RBDL is a C++ library that contains some essential and efficient rigid body dynamics algorithms such as the Articulated Body Algorithm (ABA) for forward dynamics, Recursive Newton-Euler Algorithm (RNEA) for inverse dynamics, the Composite Rigid Body Algorithm (CRBA) for the efficient computation of the joint space inertia matrix and is also able to compute forward dynamics with external contact constraints and collision impulses. Furthermore it has some basic support for forward and inverse kinematics.

License: Other

CMake 4.48% C++ 86.21% C 0.44% Lua 0.75% Python 1.69% MATLAB 0.05% Cython 6.36% Shell 0.01%
articulated-body-algorithm inverse-dynamics forward-dynamics multi-body-dynamics inverse-kinematics robotics

rbdl's Introduction

RBDL - Rigid Body Dynamics Library Copyright (c) 2018-2022 Martin Felis [email protected] Felix Richter [email protected]

Introduction

RBDL is a highly efficient C++ library that contains some essential rigid body dynamics algorithms such as the Articulated Body Algorithm (ABA) for forward dynamics, Recursive Newton-Euler Algorithm (RNEA) for inverse dynamics and the Composite Rigid Body Algorithm (CRBA) for the efficient computation of the joint space inertia matrix. It further contains code for Jacobians, forward and inverse kinematics, handling of external constraints such as contacts and collisions, and closed-loop models.

The code was originally developed by Martin Felis [email protected] at the research group Optimization in Robotics and Biomechanics (ORB) of the Interdisciplinary Center for Scientific Computing (IWR) and Institute of Computer Engineering at Heidelberg University. The code closely follows the notation used in Roy Featherstone's book "Rigid Body Dynamics Algorithm".

Documentation

The documentation is contained in the code and can be extracted with the tool doxygen.

To create the documentation simply run

    doxygen Doxyfile

which will generate the documentation in the subdirectory ./doc/html. The main page will then be located in ./doc/html/index.html.

An online version of the generated documentation can be found at https://rbdl.github.io.

VCPKG package manager (for Windows, Linux and Mac)

As of 08-2021 rbdl is part of microsofts vcpkg, a tool to manage c++ dependencies on all major operating systems. The luamodel and urdfmodel addon are installed via vcpkg as well, other addons may be added in the future as well.

Install vcpkg by making a local clone from its GitHub repo https://github.com/Microsoft/vcpkg. Then run the vcpkg-bootstrapper script to set it up. For detailed installation instructions, see Install vcpkg. To integrate vcpkg with your Visual Studio or Visual Studio Code development environment, see Integrate vcpkg. Then, to use vcpkg to install or update a library, see Manage libraries with vcpkg. For more information about vcpkg commands, see vcpkg command-line reference.

Building RBDL from Source

The official rbdl git repository can be cloned from

    https://github.com/rbdl/rbdl

(See https://git-scm.com/downloads/guis/ for git clients.)

To make sure all submodules are correctly downloaded, clone the repository recursively!

git clone --recursive https://github.com/rbdl/rbdl

Upgrading from an older version of RBDL

For convenience there is a script to upgrade to the newest RBDL repository version.

./upgrade.sh

It pulls the latest commits from master and also checks out the correct version of all sub repositories. Manual upgrading requires doing the following:

git pull origin master
git submodule update --init

Building and Installation

Linux: RBDL

  1. Prior to installation update the apt system. Open a terminal and type
  sudo apt update
  sudo apt upgrade
  1. Install git
  sudo apt install git-core
  1. Install cmake
  sudo apt install cmake
  1. Install Eigen3 RBDL uses Eigen3 for efficient computations (http://eigen.tuxfamily.org).
  sudo apt install libeigen3-dev
  1. Install a c++ compiler The choice of compiler can have a large effect on performance. Consider evaluating a few different compilers, such as Clang, for the best performance.
  sudo apt-get install build-essential
  1. Install cmake-curses (optional) If you are planning on taking advantage of the many addons and other build options we recommend that you use cmake-curses as it makes the build configuration process faster and less prone to error.
  sudo apt install cmake-curses-gui
  1. Install Catch2 (optional) Install Catch2 if you want to run RBDL's test code.

At the moment most linux distributions do not have catch2 in their repositories yet. So the recommended install approach is to build it from source.

$ git clone --branch v2.x https://github.com/catchorg/Catch2.git
$ cd Catch2
$ cmake -Bbuild -H. -DBUILD_TESTING=OFF
$ sudo cmake --build build/ --target install 
  1. Build RBDL using CMake (http://www.cmake.org). To compile the library in a separate directory in Release mode use:
  mkdir /rbdl-build
  cd rbdl-build/
  cmake -D CMAKE_BUILD_TYPE=Release ../rbdl
  make

If you have installed cmake-curses-gui you can see all of the available build options by running cmake-curses

  mkdir /rbdl-build
  cd rbdl-build/
  ccmake ../rbdl 

at which point you will see full list of build options for RBDL. We recommend that you build and run RBDL's test code at least once by building RBDL with

RBDL_BUILD_TESTS                 ON
RUN_AUTOMATIC_TESTS              ON

Linux: RBDL's documentation

  1. Install doxygen
    sudo apt install doxygen
  1. Build the doxygen:
  • Open a terminal in the RBDL source directory and type
doxygen Doxyfile
  1. Open the file doc/html/index.html in a web-browser.

Linux: RBDL's examples

  1. Install Boost (optional) Boost is needed to run many of the example simulations that come with RBDL.
sudo apt install libboost-all-dev

Linux: RBDL's addon dependencies

  1. luamodel addon:
  • If you'd like to load model files written in Lua to RBDL. Without this addon you will need to build models programmatically, or read them in using the URDF addon. To do so:
  • Install Lua51
  sudo apt install lua5.1
  sudo apt install liblua5.1-0-dev
  • Build RBDL with
  RBDL_BUILD_ADDON_LUAMODEL        ON
  1. urdf addon
  • If you'd like to load model files written in URDF to RBDL. This addon uses the URDF_Parser library which is included as a submodule. You will need to have cloned the repository recursively! If you missed doing that you can intialize the submodules (from a terminal within the source directory) after the fact with:
git submodule init
git submodule update
  • Build RBDL with
RBDL_BUILD_ADDON_URDFREADER        ON
  1. muscle addon
  • If you'd like to include muscles in your RBDL muscles, such as those in Millard et al., then build RBDL with
  RBDL_BUILD_ADDON_GEOMETRY ON
  RBDL_BUILD_ADDON_MUSCLE   ON
  • The geometry addon is a dependency which cmake will automatically include
  • Millard M, Emonds AL, Harant M, Mombaur K. A reduced muscle model and planar musculoskeletal model fit for the simulation of whole-body movements. Journal of biomechanics. 2019 Apr 10.
  1. muscle addon: muscle fitting option
  • If you'd like to make use of the muscle fitting algorithms detailed in Millard et al.
  • Install Ipopt. One of the easier ways to do this is to follow these instructions from Ipopt's online documentation which guides you through the process. Instructions to build the code appear in the README located in the Ipopt folder
  • Configure RBDL's cmake file with these flags set to 'On'
        RBDL_BUILD_ADDON_GEOMETRY        ON
        RBDL_BUILD_ADDON_LUAMODEL        ON
        RBDL_BUILD_ADDON_MUSCLE          ON
        RBDL_BUILD_ADDON_MUSCLE_FITTING  ON
  • Set the CUSTOM_IPOPT_PATH to the main Ipopt directory.
  • Build RBDL
  • Update your .bashrc file so that Ipopt's lib folder is in LD_LIBRARY_PATH
      export IPOPT_HOME=/home/mjhmilla/dev/Ipopt-3.12.8
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$IPOPT_HOME/lib
  • As of March 2019 all of the muscle fitting code has been tested with Ipopt-3.12.8.
  • Millard M, Emonds AL, Harant M, Mombaur K. A reduced muscle model and planar musculoskeletal model fit for the simulation of whole-body movements. Journal of biomechanics. 2019 Apr 10.

Windows

Although RBDL can be installed on Windows, none of the ORB members currently uses Windows and so we are unable to provide detailed instructions.

Python Bindings

RBDL can also build an experimental python wrapper that works with python 3 and python 2. To do this enable the the RBDL_BUILD_PYTHON_WRAPPER cmake options. This will build the wrapper for python 3, if you want to use python 2 instead you will also have to enable the RBDL_USE_PYTHON_2 cmake option. The result of this is an extra python directory in the build directory. From within which you can install it using setup.py. This is done automatically when using make install

Linux: Python wrapper dependencies

  1. Install Python3, NumPy, SciPy, & Matplotlib (optional) Most of RBDL is accessible through Python. If you are interested in using the RBDL through Python these instructions:
  • If you are using Ubuntu 18.04 or later python3 comes pre-installed.
  • To check if you have python3, in a command shell type
python3 -V
  • If you already have python3 installed system-wide then you can get the remaining libraries with
sudo apt install cython3 python3-numpy python3-scipy python3-matplotlib
  • If you are not using Ubuntu 18.04, and do not currently have python3, please look for instructions online to install these libraries on your system.
  1. Build and install RBDL with the
RBDL_BUILD_PYTHON_WRAPPER : ON

(Note: you may need sudo privileges to install the rbdl.egg_info file to usr/local/lib/python directory.) 3. Add RBDL to Python's path Update your .bashrc file so that python can find the python version of rbdl. To do this you need to add the path to 'rbdl-build/python' to the PYTHONPATH which can be done by adding the following line to your .bashrc file.

export PYTHONPATH=$PYTHONPATH:<path-to-the-RBDL-build-directory>/python

Resources to learn more

There are four main ways to learn about anything that appears in RBDL:

  1. The examples folder
  • There are a set of deep-dive examples which are accompanied by detailed documentation: if you are new to RBDL start here first.
  • There are also a set of minimalistic examples
  • The examples cover the basics reasonably well, but currently many advanced items (quaternion joints, custom-joints, custom-constraints, muscle-fitting) do not have examples.
  1. The Doxygen documentation
  • The Doxygen for methods and components that were developed recently are covered in great detail (e.g. the Millard2016TorqueMuscle class in the muscle addon).
  • Doxygen for more well established methods are more sparsely documented.
  1. The test code;
  • A minimalistic example of every command and modeling component can be found in the test code (e.g. in rbdl/tests, addons/geometry/tests, addons/muscle/tests, etc).
  • A specific command can be easily found by using a text editor that can search an entire directory (e.g. sublime text) of text files for a keyword.
  1. The literature.
  • In addition to Featherstone's text and Felis's papers there are a number of exciting methods and modeling tools which are included in RBDL.
  • The appropriate literature references are mentioned in the doxygen for the method in question.

Citation

An overview of the theoretical and implementation details has been published in [https://doi.org/10.1007/s10514-016-9574-0](Felis, M.L. Auton Robot (2017) 41: 495). To cite RBDL in your academic research you can use the following BibTeX entry:

@Article{Felis2016,
  author="Felis, Martin L.",
  title="RBDL: an efficient rigid-body dynamics library using recursive algorithms",
  journal="Autonomous Robots",
  year="2016",
  pages="1--17",
  issn="1573-7527",
  doi="10.1007/s10514-016-9574-0",
  url="http://dx.doi.org/10.1007/s10514-016-9574-0"
}

Licensing

The library is published under the very permissive zlib free software license which should allow you to use the software wherever you need.

This is the full license text (zlib license):

RBDL - Rigid Body Dynamics Library
Copyright (c) 2011-2020 Martin Felis <[email protected]>

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

   1. The origin of this software must not be misrepresented; you must not
   claim that you wrote the original software. If you use this software
   in a product, an acknowledgment in the product documentation would be
   appreciated but is not required.

   2. Altered source versions must be plainly marked as such, and must not
   be misrepresented as being the original software.

   3. This notice may not be removed or altered from any source
   distribution.

Acknowledgements

Work on this library was originally funded by the Heidelberg Graduate School of Mathematical and Computational Methods for the Sciences (HGS), and the European FP7 projects ECHORD (grant number 231143) and Koroibot (grant number 611909).

Work on the geometry and muscle addons was completed by Matthew Millard [email protected]. Financial support from Deutsche Forschungs Gemeinschaft grant no. MI 2109/1-1 and from the European Commission within the H2020 project Spexor (GA 687662) is gratefully acknowledged.

rbdl's People

Contributors

antoinedelplace avatar bingjeff avatar briansoe66 avatar danhauer avatar dhruvkoolrajamani avatar emblem avatar harmooni avatar ju6ge avatar karsten1987 avatar martinfelis avatar mjhmilla avatar mkudruss avatar pariterre avatar peterqlee avatar pfernbach avatar saikishor avatar thomas-moulard avatar towoc avatar yycho0108 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rbdl's Issues

File to bulid URDFREADER with python

When I try to install with the RBDL_BUILD_ADDON_URDFREADER flag turned on, the installer prompts me that the file cannot be found

rbdl_loadmodel.cc:8:10: fatal error: addons/urdfreader/urdfreader.h: no such file
8 | #include <addons/urdfreader/urdfreader.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Do you know the solution please?

Acceleration and jacobian for the chosen point on the body

Hi,
I try to get jacobian and acceleration for end effector. I'm using methods: CalcPointJacobian and CalcPointAcceleration. I'm not sure how to properly choose point of the body for calculations. In the documentation I found that it's in the body coordinates. I can get transformation between body and base origins, but I don't know if that origin is in the body COM, or in the joint location. How it works?
Very helpful in my case would be access to coordinations of all bodies in the model. I import model from urdf, and model is simplified, so I don't have access to all of them. In the urdf I have some virtual bodies only for reference, to be able to get their position/jacobian/accelerations. But they are not in the list when I print named body origins overview, and their ID's don't exist. Is there any option to get that data?
I use RBDL-ORB version of the library.

I want to realize the inverse kinematics of robot grasp through the rbdl library,Can you give me method?

I am currently researching the inverse kinematics of the grasp contact points to realize the robot grasping. I have get the position and orientation of grasp contact points, and now i want to use the rbdl library to realize the inverse kinematics from the grasp contact points to the end of the gripper of the robot arm, so as to realize the robot grasping. Could anyone can tell me how to do that?

Cannot Build Add on URDFreader

I am trying to build with CMake and have managed to do successfully to create a static library for rbdl by itself. I then wanted to use the urdf reader but when including the flag to build the urdf add on i got an error saying:

4>LINK : fatal error LNK1104: cannot open file 'Release\rbdl_urdfreader.lib'

is there a fix to this or can i access a built version of the urdf addon to add to my project?

Python wrapper bug in joint_type_map

The joint_type_map in python/rbdl-wrapper.pyx seems like different from Joint.h in rbdl, there lacks of a joint type JointTypeEulerZXY, this makes the method rbdl.Joint.fromJointType() get wrong joint type when it is bebind the JointTypeEulerZXY.

Calculating force in a specific constraint

Hello,
I've been trying to calculate the forces at contact points in foot constraints, I currently have 2 contact constraints acting at the same exact point in Y and Z directions. I only want to calculate the force in the Z constraint.
I tried doing CS.force[getGroupIndexbyName("constraint name")] and CS.calcForces(..) and resolving it in the root frame and taking the last element from the resulting spatial vector. Both these methods result in different values for the forces and I'm not sure how to tell which one is correct in this case.
Any help would be appreciated.

Thank you!
Menna

Python wrapper - core dumped error

Hello,
I have followed the instructions for compiling RBDL including the python wrapper.
The build process of RBDL passes all of its tests.
The python wrapper is compiled successfully and installed successfully by pip.
Nevertheless, running the "test_wrapper.py" code results in the following error:
"...........Segmentation fault (core dumped)"
Could you please provide me assistance in resolving this issue?
Thank you

Doxygen equations don't build: GPL Ghostscript 9.50: Unrecoverable error, exit code 1

Is anyone else seeing this string of errors when they try to build the doxygen? For example:

Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1990 1 4 %oparray_pop 1989 1 4 %oparray_pop 1977 1 4 %oparray_pop 1833 1 4 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:731/1123(ro)(G)-- --dict:0/20(G)-- --dict:76/200(L)-- --dict:5/30(L)-- --dict:11/30(L)--
Current allocation mode is local
Current file position is 8386
GPL Ghostscript 9.50: Unrecoverable error, exit code 1
Generating image form_4.png for formula
Error: /undefined in getenv
Operand stack:
(outfile)

operator * undefind

hello Martin;
l want to use your RBDL library on TWINCAT ----a soft real-time soft PLC system, so that i need to compile RBDL to .lib static library.
So,I cant use Eigen and l use your simplemath library. this work may be no people do before.

After l cmake RBDL with VS2019 on win10,there are some problem.

operator * undefind;

and I find that there are three operator * in your class。

it seems that c++ allow only one operator overload in a class.

Im not very good in C++,so l hope get your reply.

The use of LOG macro conflicts with Google logging library

the macro name LOG (defined in Logging.h) is quite commonly used by libraries and is therefore has large potential conflict when integrating multiple libraries into a project.

In particular, the google logging library google-glog, defines LOG as their preferred abbreviated logging form, and this causes conflicts when including both glog/logging.h and rbdl/include/Logging.h from the same source file.

I suggest replacing the LOG macro with RBDL_LOG everywhere within this project to prevent this and other conflicts between libraries.

rbdl_urdfreader.a installed to bin folder

The rbdl_urdfreader.a static library is installed to the bin folder instead of the lib folder.

Current:

INSTALL (TARGETS rbdl_urdfreader-static rbdl_urdfreader_util
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_BINDIR}
)

Proposed:

INSTALL (TARGETS rbdl_urdfreader-static rbdl_urdfreader_util
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

Compilation error introduced by commit 10588489

I encountered a compilation error when trying to install RBDL. I ran

cmake -D CMAKE_BUILD_TYPE=Release -D RBDL_BUILD_PYTHON_WRAPPER=true ../

followed by

make install

The issue appeared on both macOS 11.6.4 and Ubuntu 20.04.3. git blame suggests that the change was introduced by commit 105884898b43933c5904cccab35ca7206935d2cc and indeed reverting to the commit before that (92e67e9f752c9533f6dcbb6892f3fcf5564bb09d) resolved the problem.

Full error message shown below.

Consolidate compiler generated dependencies of target rbdl
[  7%] Building CXX object CMakeFiles/rbdl.dir/src/rbdl_mathutils.cc.o
In file included from /*/rbdl/src/rbdl_mathutils.cc:14:
In file included from /*/include/rbdl/rbdl_mathutils.h:14:
In file included from /*/rbdl/include/rbdl/rbdl_math.h:66:
/*/rbdl/include/rbdl/Quaternion.h:77:31: error:
      implicit instantiation of undefined template
      'Eigen::MatrixSquareRootReturnValue<Eigen::Matrix<double, 4, 1,
      0, 4, 1> >'
      double sin_half_theta = sqrt(1.0 - cos_half_theta * cos...
                              ^
/usr/local/include/eigen3/Eigen/src/Core/util/ForwardDeclarations.h:306:34: note:
      template is declared here
template<typename Derived> class MatrixSquareRootReturnValue;
                                 ^
In file included from /*/rbdl/src/rbdl_mathutils.cc:14:
In file included from /*/rbdl/include/rbdl/rbdl_mathutils.h:14:
In file included from /*/rbdl/include/rbdl/rbdl_math.h:66:
/*/rbdl/include/rbdl/Quaternion.h:88:24: error:
      implicit instantiation of undefined template
      'Eigen::MatrixFunctionReturnValue<Eigen::Matrix<double, 4, 1,
      0, 4, 1> >'
      double ratio_a = sin((1 - alpha) * half_theta) / sin_ha...
                       ^
/usr/local/include/eigen3/Eigen/src/Core/util/ForwardDeclarations.h:305:34: note:
      template is declared here
template<typename Derived> class MatrixFunctionReturnValue;
                                 ^
In file included from /*/rbdl/src/rbdl_mathutils.cc:14:
In file included from /*/rbdl/include/rbdl/rbdl_mathutils.h:14:
In file included from /*/rbdl/include/rbdl/rbdl_math.h:66:
/*/rbdl/include/rbdl/Quaternion.h:89:24: error:
      implicit instantiation of undefined template
      'Eigen::MatrixFunctionReturnValue<Eigen::Matrix<double, 4, 1,
      0, 4, 1> >'
      double ratio_b = sin(alpha * half_theta) / sin_half_theta;
                       ^
/usr/local/include/eigen3/Eigen/src/Core/util/ForwardDeclarations.h:305:34: note:
      template is declared here
template<typename Derived> class MatrixFunctionReturnValue;
                                 ^
In file included from /*/rbdl/src/rbdl_mathutils.cc:14:
In file included from /*/rbdl/include/rbdl/rbdl_mathutils.h:14:
In file included from /*/rbdl/include/rbdl/rbdl_math.h:66:
/*/rbdl/include/rbdl/Quaternion.h:113:19: error:
      call to non-static member function without an object argument
        float w = sqrt (1.f + tr) * 0.5;
                  ^~~~
/*/rbdl/include/rbdl/Quaternion.h:120:19: error:
      call to non-static member function without an object argument
        float x = sqrt(1.0 + mat(0,0) - mat(1,1) - mat(2,2)) * 0.5;
                  ^~~~
/*/rbdl/include/rbdl/Quaternion.h:128:19: error:
      call to non-static member function without an object argument
        float y = sqrt(1.0 + mat(1,1) - mat(0,0) - mat(2,2)) * 0.5;
                  ^~~~
/*/rbdl/include/rbdl/Quaternion.h:136:19: error:
      call to non-static member function without an object argument
        float z = sqrt(1.0 + mat(2,2) - mat(0,0) - mat(1,1)) * 0.5;
                  ^~~~
7 errors generated.
make[2]: *** [CMakeFiles/rbdl.dir/src/rbdl_mathutils.cc.o] Error 1
make[1]: *** [CMakeFiles/rbdl.dir/all] Error 2
make: *** [all] Error 2

Point contact of wheel with the ground

Hey!

I'm trying to model a wheeled mobile robot using RBDL. I'm using the floating joint to model the mobile robot(similar to the humanoid robot). Maybe also I will try to use 3DoF joint, later. My question now mainly focuses on how to model the wheel and the ground contact? Should I just use the contact constraint and define the point where it should be touching the surface? Or is there anyother trick?

Thanks!

"import rbdl" error

When I use import rbdl after building RBDL's Python API
I am prompted
python3.7/site-packages/rbdl-2.6.0-py3.7-linux-x86_64.egg/rbdl.cpython-37m-x86_64-linux -gnu.so: undefined symbol: _ZN17RigidBodyDynamics13ConstraintSet20AddContactConstraintEjRK9Vector3_tS3_PKcd

How can I solve it please?
thanks a lot

benchmark addon: reduce code duplication

Don't like the mix of model and contact method though the code is fine and functional. Suggest to have a refactoring PR for a second round.

Suggestions:

  • Consider providing a std::function with the respective method from a list of function that you want to benchmark. Can share sample code.
  • Same for the models. Consider a list of models where each element is benchmarked.

Originally posted by @mkudruss in #7

newer lua library not supported

Dear Developers

I have installed Lua 5.3 via sudo apt install liblua5.3-0 liblua5.3-dev.

Then activating RBDL_BUILD_ADDON_LUAMODEL in ~rbdl/build$ ccmake . leads to the following error message, probably because LUA Version 5.1 is expected:

CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Lua51 (missing: LUA_LIBRARIES LUA_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.10/Modules/FindLua51.cmake:84
(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
addons/luamodel/CMakeLists.txt:9 (FIND_PACKAGE)

After exitting the error message both of these entries can be set manually:
LUA_INCLUDE_DIR LUA_INCLUDE_DIR-NOTFOUND
LUA_LIBRARY LUA_LIBRARY-NOTFOUND

It can be fixed by setting manually the correct path to lua5.3 for both entries. Then, LUA_LIBRARIES and LUA_MATH_LIBRARY are adapted automatically (Configuring twice):

LUA_INCLUDE_DIR /usr/include/lua5.3
LUA_LIBRARIES /usr/lib/x86_64-linux-gnu/liblua5.3.so;/usr/lib/x86_64-linux-gnu/libm.so
LUA_LIBRARY /usr/lib/x86_64-linux-gnu/liblua5.3.so
LUA_MATH_LIBRARY /usr/lib/x86_64-linux-gnu/libm.so

Since newer Lua versions are supported by RBDL, it would be great if RBDL would find them automatically as well.

Thanks,
Daniel

About dependency to Boost library in vcpkg

Hi, my apologies if this question is not appropriate here.

When I installed rbdl via vcpkg, I noticed that the whole Boost library is also installed as dependencies. But I thought Boost is optional if you do not need to build the samples? And the package folder do not include the built sample executables which makes me wonder if the installation of Boost is still necessary. It took me almost an hour to finish the installation. It would be nice if the installation of Boost can be skipped.

Boost errors when compiling with the URDF_READER add-on

Hi,
I am having some issues when compiling the library with the URDF_READER add-on.
Using the make command the following boost-related errors arise:

[ 71%] Built target rbdl
Scanning dependencies of target rbdl_urdfreader
[ 78%] Building CXX object addons/urdfreader/CMakeFiles/rbdl_urdfreader.dir/urdfreader.cc.o
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:15:9: error: ‘boost’ does not name a type; did you mean ‘bool’?
typedef boost::shared_ptrurdf::Link LinkPtr;
^~~~~
bool
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:16:15: error: ‘boost’ does not name a type; did you mean ‘bool’?
typedef const boost::shared_ptr ConstLinkPtr;
^~~~~
bool
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:17:9: error: ‘boost’ does not name a type; did you mean ‘bool’?
typedef boost::shared_ptrurdf::Joint JointPtr;
^~~~~
bool
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:18:9: error: ‘boost’ does not name a type; did you mean ‘bool’?
typedef boost::shared_ptrurdf::ModelInterface ModelPtr;
^~~~~
bool
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:39:16: error: ‘LinkPtr’ was not declared in this scope
typedef vector URDFLinkVector;
^~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:39:23: error: template argument 1 is invalid
typedef vector URDFLinkVector;
^
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:39:23: error: template argument 2 is invalid
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:40:16: error: ‘JointPtr’ was not declared in this scope
typedef vector URDFJointVector;
^~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:40:16: note: suggested alternative: ‘Joint’
typedef vector URDFJointVector;
^~~~~~~~
Joint
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:40:24: error: template argument 1 is invalid
typedef vector URDFJointVector;
^
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:40:24: error: template argument 2 is invalid
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:41:21: error: ‘LinkPtr’ was not declared in this scope
typedef map<string, LinkPtr > URDFLinkMap;
^~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:41:29: error: template argument 2 is invalid
typedef map<string, LinkPtr > URDFLinkMap;
^
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:41:29: error: template argument 4 is invalid
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:42:21: error: ‘JointPtr’ was not declared in this scope
typedef map<string, JointPtr > URDFJointMap;
^~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:42:21: note: suggested alternative: ‘Joint’
typedef map<string, JointPtr > URDFJointMap;
^~~~~~~~
Joint
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:42:30: error: template argument 2 is invalid
typedef map<string, JointPtr > URDFJointMap;
^
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:42:30: error: template argument 4 is invalid
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:44:42: error: ‘ModelPtr’ has not been declared
bool construct_model (Model* rbdl_model, ModelPtr urdf_model, bool floating_base, bool verbose) {
^~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc: In function ‘bool RigidBodyDynamics::Addons::construct_model(RigidBodyDynamics::Model*, int, bool, bool)’:
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:45:3: error: ‘LinkPtr’ was not declared in this scope
LinkPtr urdf_root_link;
^~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:48:24: error: base operand of ‘->’ is not a pointer
link_map = urdf_model->links_;
^~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:51:25: error: base operand of ‘->’ is not a pointer
joint_map = urdf_model->joints_;
^~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:56:17: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Tp, class _Sequence> class std::stack’
stack link_stack;
^
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:56:17: note: expected a type, got ‘LinkPtr’
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:56:17: error: template argument 2 is invalid
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:61:14: error: request for member ‘push’ in ‘link_stack’, which is of non-class type ‘int’
link_stack.push (link_map[(urdf_model->getRoot()->name)]);
^~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:61:40: error: base operand of ‘->’ is not a pointer
link_stack.push (link_map[(urdf_model->getRoot()->name)]);
^~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:64:3: error: ‘ConstLinkPtr’ was not declared in this scope
ConstLinkPtr& root = urdf_model->getRoot ();
^~~~~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:64:3: note: suggested alternative: ‘ConstraintSet’
ConstLinkPtr& root = urdf_model->getRoot ();
^~~~~~~~~~~~
ConstraintSet
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:64:17: error: ‘root’ was not declared in this scope
ConstLinkPtr& root = urdf_model->getRoot ();
^~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:64:17: note: suggested alternative: ‘rint’
ConstLinkPtr& root = urdf_model->getRoot ();
^~~~
rint
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:64:34: error: base operand of ‘->’ is not a pointer
ConstLinkPtr& root = urdf_model->getRoot ();
^~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:125:21: error: request for member ‘size’ in ‘link_stack’, which is of non-class type ‘int’
while (link_stack.size() > 0) {
^~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:126:13: error: expected ‘;’ before ‘cur_link’
LinkPtr cur_link = link_stack.top();
^~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:131:21: error: ‘cur_link’ was not declared in this scope
if (joint_idx < cur_link->child_joints.size()) {
^~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:131:21: note: suggested alternative: ‘u_long’
if (joint_idx < cur_link->child_joints.size()) {
^~~~~~~~
u_long
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:132:7: error: ‘JointPtr’ was not declared in this scope
JointPtr cur_joint = cur_link->child_joints[joint_idx];
^~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:132:7: note: suggested alternative: ‘Joint’
JointPtr cur_joint = cur_link->child_joints[joint_idx];
^~~~~~~~
Joint
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:138:18: error: request for member ‘push’ in ‘link_stack’, which is of non-class type ‘int’
link_stack.push (link_map[cur_joint->child_link_name]);
^~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:138:33: error: ‘cur_joint’ was not declared in this scope
link_stack.push (link_map[cur_joint->child_link_name]);
^~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:138:33: note: suggested alternative: ‘u_int’
link_stack.push (link_map[cur_joint->child_link_name]);
^~~~~~~~~
u_int
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:145:80: error: request for member ‘top’ in ‘link_stack’, which is of non-class type ‘int’
cout << "joint '" << cur_joint->name << "' child link '" << link_stack.top()->name << "' type = " << cur_joint->type << endl;
^~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:150:18: error: request for member ‘pop’ in ‘link_stack’, which is of non-class type ‘int’
link_stack.pop();
^~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:157:5: error: ‘JointPtr’ was not declared in this scope
JointPtr urdf_joint = joint_map[joint_names[j]];
^~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:157:5: note: suggested alternative: ‘Joint’
JointPtr urdf_joint = joint_map[joint_names[j]];
^~~~~~~~
Joint
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:158:13: error: expected ‘;’ before ‘urdf_parent’
LinkPtr urdf_parent = link_map[urdf_joint->parent_link_name];
^~~~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:159:13: error: expected ‘;’ before ‘urdf_child’
LinkPtr urdf_child = link_map[urdf_joint->child_link_name];
^~~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:164:45: error: ‘urdf_parent’ was not declared in this scope
rbdl_parent_id = rbdl_model->GetBodyId (urdf_parent->name.c_str());
^~~~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:164:45: note: suggested alternative: ‘urdf_model’
rbdl_parent_id = rbdl_model->GetBodyId (urdf_parent->name.c_str());
^~~~~~~~~~~
urdf_model
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:167:51: error: ‘urdf_joint’ was not declared in this scope
cerr << "Error while processing joint '" << urdf_joint->name
^~~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:167:51: note: suggested alternative: ‘urdf_model’
cerr << "Error while processing joint '" << urdf_joint->name
^~~~~~~~~~
urdf_model
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:173:9: error: ‘urdf_joint’ was not declared in this scope
if (urdf_joint->type == urdf::Joint::REVOLUTE || urdf_joint->type == urdf::Joint::CONTINUOUS) {
^~~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:173:9: note: suggested alternative: ‘rbdl_joint’
if (urdf_joint->type == urdf::Joint::REVOLUTE || urdf_joint->type == urdf::Joint::CONTINUOUS) {
^~~~~~~~~~
rbdl_joint
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:209:5: error: ‘urdf_joint’ was not declared in this scope
urdf_joint->parent_to_joint_origin_transform.rotation.getRPY (joint_rpy[0], joint_rpy[1], joint_rpy[2]);
^~~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:209:5: note: suggested alternative: ‘rbdl_joint’
urdf_joint->parent_to_joint_origin_transform.rotation.getRPY (joint_rpy[0], joint_rpy[1], joint_rpy[2]);
^~~~~~~~~~
rbdl_joint
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:230:9: error: ‘urdf_child’ was not declared in this scope
if (urdf_child->inertial) {
^~~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:230:9: note: suggested alternative: ‘urdf_model’
if (urdf_child->inertial) {
^~~~~~~~~~
urdf_model
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:261:36: error: ‘urdf_child’ was not declared in this scope
cout << "+ Adding Body: " << urdf_child->name << endl;
^~~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:261:36: note: suggested alternative: ‘urdf_model’
cout << "+ Adding Body: " << urdf_child->name << endl;
^~~~~~~~~~
urdf_model
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:277:32: error: ‘urdf_child’ was not declared in this scope
string trans_body_name = urdf_child->name + "_Translate";
^~~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:277:32: note: suggested alternative: ‘urdf_model’
string trans_body_name = urdf_child->name + "_Translate";
^~~~~~~~~~
urdf_model
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:283:85: error: ‘urdf_child’ was not declared in this scope
rbdl_model->AddBody (rbdl_parent_id, rbdl_joint_frame, rbdl_joint, rbdl_body, urdf_child->name);
^~~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:283:85: note: suggested alternative: ‘urdf_model’
rbdl_model->AddBody (rbdl_parent_id, rbdl_joint_frame, rbdl_joint, rbdl_body, urdf_child->name);
^~~~~~~~~~
urdf_model
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc: In function ‘bool RigidBodyDynamics::Addons::URDFReadFromString(const char*, RigidBodyDynamics::Model*, bool, bool)’:
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:312:3: error: ‘ModelPtr’ was not declared in this scope
ModelPtr urdf_model = urdf::parseURDF (model_xml_string);
^~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:312:3: note: suggested alternative: ‘Model’
ModelPtr urdf_model = urdf::parseURDF (model_xml_string);
^~~~~~~~
Model
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:314:32: error: ‘urdf_model’ was not declared in this scope
if (!construct_model (model, urdf_model, floating_base, verbose)) {
^~~~~~~~~~
/home/ale-cp/rbdl/addons/urdfreader/urdfreader.cc:314:32: note: suggested alternative: ‘model’
if (!construct_model (model, urdf_model, floating_base, verbose)) {
^~~~~~~~~~
model
addons/urdfreader/CMakeFiles/rbdl_urdfreader.dir/build.make:62: recipe for target 'addons/urdfreader/CMakeFiles/rbdl_urdfreader.dir/urdfreader.cc.o' failed
make[2]: *** [addons/urdfreader/CMakeFiles/rbdl_urdfreader.dir/urdfreader.cc.o] Error 1
CMakeFiles/Makefile2:664: recipe for target 'addons/urdfreader/CMakeFiles/rbdl_urdfreader.dir/all' failed
make[1]: *** [addons/urdfreader/CMakeFiles/rbdl_urdfreader.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

I am using Ubuntu 18.04, with Ubuntu 16.04 I am able to compile the everything without errors.
Do you have any idea how to fix this?

Python wrapper and undefined `ext_modules`

Hi,

I think something may have gone missing in the transition to python3.
When trying to install it now I get NameError: name 'ext_modules' is not defined. I can see that it is defined here

ext_modules=cythonize(ext_modules),

I think something went wrong when dev was merged into master as the the last commit by ju6ge did not have ext_modules=cythonize(ext_modules) in it.
But simply removing the line with ext_modules does not solve the problem as I get:
undefined symbol: _ZN17RigidBodyDynamics6Addons16URDFReadFromFileEPKcPNS_5ModelEbb.
I am building with RBDL_BUILD_ADDON_URDFREADER and RBDL_BUILD_PYTHON_WRAPPER on ubuntu 20.04.

Static library build fails

I am using tag v2.5.0 on ubuntu 16.04, with the following cmake options

//Build the benchmarking tool
RBDL_BUILD_ADDON_BENCHMARK:BOOL=OFF

//Build the lua model reader
RBDL_BUILD_ADDON_LUAMODEL:BOOL=OFF

//Build the (experimental) urdf reader
RBDL_BUILD_ADDON_URDFREADER:BOOL=ON

//Build experimental python wrapper
RBDL_BUILD_PYTHON_WRAPPER:BOOL=OFF

//Build statically linked library (otherwise dynamiclly linked)
RBDL_BUILD_STATIC:BOOL=ON

//Build the test executables
RBDL_BUILD_TESTS:BOOL=OFF

//Enable logging (warning: major impact on performance!)
RBDL_ENABLE_LOGGING:BOOL=OFF

//Value Computed by CMake
RBDL_SOURCE_DIR:STATIC=/home/arturo/Code/advr-superbuild/external/rbdl

//Enable storing of version information in the library (requires
// build from valid repository)
RBDL_STORE_VERSION:BOOL=OFF

//Use the URDF library provided by ROS
RBDL_USE_ROS_URDF_LIBRARY:BOOL=ON

//Use slow math instead of the fast Eigen3 library (faster compilation)
RBDL_USE_SIMPLE_MATH:BOOL=OFF

the linking error suggests that the static build lacks some linker flags!

[100%] Linking CXX executable rbdl_urdfreader_util
librbdl_urdfreader.a(urdfreader.cc.o): In function `RigidBodyDynamics::Addons::URDFReadFromString(char const*, RigidBodyDynamics::Model*, bool, bool)':
urdfreader.cc:(.text+0x39af): undefined reference to `urdf::parseURDF(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
addons/urdfreader/CMakeFiles/rbdl_urdfreader_util.dir/build.make:96: recipe for target 'addons/urdfreader/rbdl_urdfreader_util' failed
make[2]: *** [addons/urdfreader/rbdl_urdfreader_util] Error 1
CMakeFiles/Makefile2:499: recipe for target 'addons/urdfreader/CMakeFiles/rbdl_urdfreader_util.dir/all' failed
make[1]: *** [addons/urdfreader/CMakeFiles/rbdl_urdfreader_util.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

One more thing: I think it would be nice to compile with -fPIC for static builds, which right now is not done. Otherwise, it is not possible to use the static rbdl inside a shared library. And I also forgot to thank you for this great library that you're sharing.

Question about Floating Base model

Add six virtual joints on the base to handle the floating base model. When solve the inverse dynamics, what is the meaning of the results values of virtual joints.
For example, I use RBDL function InverseDynamics(model, q, Dq, DDq, Tau) to solve inverse dynamics, and the return Tau has the values of virtual joints. Why the values of virtual joints is not equal to zero? If they must have values, what the meaning is?

base link named as ''base_link'' for floating base robot error

I just happened to test a robot with a its base link named as ''base_link''.
When this robot has been loaded as a floating base robot, everything calculated are with repect to the robot base instead of the inertia base (world). Then I tried to change ''base_link'' to ''base'', everything works. I think another ''base_link'' is created as the world link name, it conflicts with the robot root link name.

Investigate performance regression of InverseKinematics for point constraints

The new InverseKinematics (

bool InverseKinematics (
implementation adds support for orientation constraints whereas the original (
RBDL_DLLAPI bool InverseKinematics (
) only supported point constraints.

However when using the new implementation with only point constraints it is considerably slower than the original InverseKinematics. Ideally in this case the new implementation should be just as fast.

Analytical Inverse of Joint Space Inertia Matrix

Hi,

I opened an issue on a previous repo of rbdl. Just to let you know I have implemented this feature in Biorbd. It is essentially based on rbdl. So it could be almost straightforward to implement it in rbdl.

Here is the code :
https://github.com/pyomeca/biorbd/blob/7fe01d1eb2ba546d42b112610289b08e557f4919/src/RigidBody/Joints.cpp#L808-L930

Also, implementing the analytical inverse of the joint space inertia matrix could enhance the performance of other algorithms.

Regards,

Pierre

How to install previous version?

Hi, I would like to use the 2.6.0 version. Could you please tell me how to install previous version?

Thank you very much.

Best,
Jin

Library alternative - MATLAB

Hi roboticist fellows,

I started during my Master degree a library in MatLab about Robotics called quindim. To make you aware of it, run the examples in respective folder. You are hopefully the ones who have knowhow about the theme. The plan to improve the library by implementation considers either other methods or languages.

I would thank you for experimenting it.

InverseKinematics solution gives joint angles outside the joint range

Hello,

I have been testing the new InverseKinematics with the InverseKinematicsConstraintSet (https://github.com/rbdl/rbdl/blob/master/include/rbdl/Kinematics.h#L361-L412). I am loading the RBDL from the URDF model from ROS. The end result I am getting is way beyond the joint range and some of the angles are more than 4*PI. Is this normal and intended?.

I have also observed that some of the analytically feasible configurations are not being feasible with this InverseKinematics Method. What's the success rate of this IK?. In order to increase the changes only changing the max_steps and tolerances or is there anything else that can be done?

Thank you,

conda package for python wrapper?

Hi, I was wondering if there are any plans to create a conda package for rbdl, including the python wrapper? It would make installation quite a bit easier.

Gravitational component of dyamic model

I'm finishing a task for the master I'm doing and I need this information as soon as possible. I have to create a PD control loop with gravity compensation (i.e. g(q)), I have read that it can be obtained through the InverseDynamics function and also with NonlinearEffects, but I do not understand how it is done.

Defining fext in Inverse Dynamics

Hi,
I am trying to define the fext that is applied on the robot by taking in the readings from the ft_sensors and passing it directly to the Inverse Dynamics function.
It seems like there is an issue with defining it this way, as the result of the Inverse dynamics looks so high.
In the documentation it states forces in base coordinate, how can I transform them.

 fext[left_foot_sole][0] = left_ft_sensor.wrench.torque.x;
fext[left_foot_sole][1] = left_ft_sensor.wrench.torque.y;
fext[left_foot_sole][2] = left_ft_sensor.wrench.torque.z;
fext[left_foot_sole][3] = left_ft_sensor.wrench.force.x;
fext[left_foot_sole][4] = left_ft_sensor.wrench.force.y;
fext[left_foot_sole][5] = left_ft_sensor.wrench.force.z;

Is it possible to get Forces acting on floating base, from constrained Inverse Dynamics function?

Hi!
I'm working on Floating Base model of quadruped. I want to get forces acting on robot's body from model and accelerations (of leg joints and acting on the body). To compute inverse dynamics I implemented InverseDynamicsConstraints() and InverseDynamicsConstraintsRelaxed() functions. Possible Constraint Sets are defined and system is switching between them depend on robot state (I read that this is now best solution for changing constraint sets). Robot is underactuated so mainly Relaxed function is used. But forces that I get from function have only zeroes for forces acting on floating base. Is there a possibility to get these forces? Cause I assume that there always will be forces acting on robot's body.
I also tried InverseDynamics(), but computed forces sometimes are extremely big and I can't find cause of this behavior. My another idea was to "deceive" RBDL and set all actuatedDoF to true in SetActuationMap() method, but it crashed program. Maybe I can get those forces with another method?
Thanks in advance for your help!

Access Read Violation on Inverse Kinematics Function

When calling the InverseKinematics(Model, Qinit, ConstraintSet, Qres) I get
"Access violation reading location 0x0000000000000000."
with no indication where the violation is?
Is there an example of using the InverseKinematics function anywhere so i can check where I am missing something?

The model is imported via URDF using the AddOn, i have defined the body ids, target rotation and location, weights and used the end effector location as body_points in the constraint set and cant find any null pointers in the variables.

Issues with contact constraints and gravity

Hi Felix!

A couple hours ago today I made an issue on the pyomeca rbdl-casadi repo and Benjamin (@pariterre ) pointed us to version 3.2.0 (thanks Benjamin!). Menna (@MennatallahRihan) and I compiled 3.2.0 version ourselves, but we (+ Jonathan @jfslin) are still facing the same gravity and contact constraint issues described in the aforementioned issue, which can be found here: pyomeca/rbdl-casadi#22

Below is an example code of a pendulum with a 6-dof base that is free-falling.

#include <iostream>
#include "Modeldynamics.h"
#include <rbdl/rbdl.h>

using namespace RigidBodyDynamics;
using namespace RigidBodyDynamics::Math;
RigidBodyDynamics::Model model;
casadi::MX fd(const VectorNd &Q, const VectorNd &Qdot, const VectorNd &Tau)
{
  VectorNd Qddot(model.dof_count);
  ForwardDynamics(model, Q, Qdot, Tau, Qddot);
  return casadi::MX::vertcat({Qdot,Qddot});
}

int main(int argc, char *argv[])
{
  rbdl_check_api_version(RBDL_API_VERSION);

  if (!RigidBodyDynamics::Addons::LuaModelReadFromFile("../models/pendulum.lua", &model, false))
  {
    std::cerr << "Error loading model -- aborting" << std::endl;
    abort();
  }
  cout << "correctly loaded model " << endl;

  auto Q_sym = VectorNd::sym("Q", model.dof_count);
  auto QDot_sym = VectorNd::sym("QDot", model.dof_count);
  auto Tau_sym = VectorNd::sym("Tau", model.dof_count);
  casadi::Function fd_fun = casadi::Function("fd_fun", {Q_sym, QDot_sym, Tau_sym}, {fd(Q_sym, QDot_sym, Tau_sym)}, {"Q", "QDot", "Tau"}, {"QDDot"}).expand();

  auto Q = casadi::MX::zeros(model.dof_count);
  auto QDot = casadi::MX::zeros(model.dof_count);
  auto Tau = casadi::MX::zeros(model.dof_count);

  casadi::MX QDDot = fd_fun(casadi::MXDict{{"Q", Q}, {"QDot", QDot}, {"Tau", Tau}}).at("QDDot");

  // std::cout << QDDot << std::endl;
  // auto x = casadi::MX::vertcat({Q_sym, QDot_sym});

  casadi::MXDict ode_dict = {{"x", casadi::MX::vertcat({Q_sym, QDot_sym})}, {"p", Tau_sym}, {"ode", QDDot}};
  vector<double> x_init = {0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0};
  vector<double> u_init = {0, 0, 0, 0, 0, 0};
  casadi::Function ref_integrator = integrator("ref_integrator",
                                               "cvodes", ode_dict, {{"tf", 0.01}, {"verbose", true}, {"expand", true}});

  map<string, DM> arg, res;

  std::ofstream of("animation.csv");
  for (int i = 0; i < 90; i++)
  {
    if (i < 1)
    {
      arg["x0"] = x_init;
    }
    else
    {
      arg["x0"] = res.at("xf");
    }
    arg["p"] = u_init;
    res = ref_integrator(arg);

    cout << setw(2) << "xf = " << res.at("xf") << endl;
    of << i << ", ";
    for (unsigned int i = 0; i < model.dof_count; i++)
    {
      of << res.at("xf")(i) << ", ";
    }
    of << "\n";
  }

  return 0;
}

We are not sure if this is the correct implementation, so any guidance would be greatly appreciated. It would also be helpful if you could provide us with a similar sample code that utilizes integration and ForwardDynamics() or ForwardDynamicsContactsDirect() (we notice that the casadi_simple example only calls FD once).

Hope to hear from you soon!

Thanks,
Menna and Jan

module 'rbdl' has no attribute 'CalZeroMomentPoint'

Hi,
I'm now using rbdl with python to implement human pose estimation.
While I need to calculate the zero point, I can not use the rbdl.CalZeroMomentPoint.
But I see there has this attribute in the source code.

Did there anything I miss to build when I am doing cmake?

Screenshot from 2022-07-19 16-44-44 (2)
Screenshot from 2022-07-19 16-44-14 (2)

Thanks a lot for replying.

Python InverseDynamics does not take in f_ext

I am trying to use the python wrapper and I want to run InverseDynamics with the optional f_ext, however I get the error that InverseDynamics only takes in 5 objects. Looking in the file rbdl-wrapper.pyx it seems that python has no optional variable for f_ext and when its passed to the C++ function it is always NULL.

image

cmake/FindRBDL.cmake:30 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)

 Could NOT find RBDL (missing: RBDL_LIBRARIES)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindRBDL.cmake:30 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  dwl/CMakeLists.txt:7 (find_package)

Can some guide me how to resolve this issue. I did install RBDL library but why there is an issue with Cmake to access the library

Compile error on Ubuntu-20.04

eigen3 and SimpleMath all fail

Consolidate compiler generated dependencies of target rbdl
[ 7%] Building CXX object CMakeFiles/rbdl.dir/src/rbdl_version.cc.o
[ 15%] Building CXX object CMakeFiles/rbdl.dir/src/rbdl_mathutils.cc.o
In file included from /workspace/codes/rbdl-master/include/rbdl/rbdl_math.h:66,
from /workspace/codes/rbdl-master/include/rbdl/rbdl_mathutils.h:14,
from /workspace/codes/rbdl-master/src/rbdl_mathutils.cc:14:
/workspace/codes/rbdl-master/include/rbdl/Quaternion.h: In member function ‘RigidBodyDynamics::Math::Quaternion RigidBodyDynamics::Math::Quaternion::slerp(double, RigidBodyDynamics::Math::Quaternion) const’:
/workspace/codes/rbdl-master/include/rbdl/Quaternion.h:77:73: error: no matching function for call to ‘RigidBodyDynamics::Math::Quaternion::sqrt(double) const’
77 | double sin_half_theta = sqrt(1.0 - cos_half_theta * cos_half_theta);
| ^
In file included from /usr/include/eigen3/Eigen/Core:436,
from /usr/include/eigen3/Eigen/Dense:1,
from /workspace/codes/rbdl-master/include/rbdl/rbdl_math.h:34,
from /workspace/codes/rbdl-master/include/rbdl/rbdl_mathutils.h:14,
from /workspace/codes/rbdl-master/src/rbdl_mathutils.cc:14:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.