{"id":37733695,"url":"https://github.com/robotlearn/raisimpy","last_synced_at":"2026-01-16T13:54:53.433Z","repository":{"id":92884005,"uuid":"199732099","full_name":"robotlearn/raisimpy","owner":"robotlearn","description":"Raisimpy: Python wrappers for RaiSim","archived":false,"fork":false,"pushed_at":"2020-06-24T04:49:17.000Z","size":10367,"stargazers_count":39,"open_issues_count":2,"forks_count":10,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-01-29T20:52:42.628Z","etag":null,"topics":["python-wrapper","raisim","robotics","simulator"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robotlearn.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-07-30T21:46:30.000Z","updated_at":"2024-01-04T16:36:14.000Z","dependencies_parsed_at":"2023-05-04T03:31:28.372Z","dependency_job_id":null,"html_url":"https://github.com/robotlearn/raisimpy","commit_stats":{"total_commits":51,"total_committers":4,"mean_commits":12.75,"dds":0.3137254901960784,"last_synced_commit":"33521e2adc1cf4448f80e0859dbaa591e754ffcc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robotlearn/raisimpy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotlearn%2Fraisimpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotlearn%2Fraisimpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotlearn%2Fraisimpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotlearn%2Fraisimpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robotlearn","download_url":"https://codeload.github.com/robotlearn/raisimpy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotlearn%2Fraisimpy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python-wrapper","raisim","robotics","simulator"],"created_at":"2026-01-16T13:54:53.348Z","updated_at":"2026-01-16T13:54:53.425Z","avatar_url":"https://github.com/robotlearn.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"RaiSimPy: Python wrapper for RaiSim\n===================================\n\nThis folder contains python wrappers around RaiSim (``raisimLib`` and ``raisimOgre``) using ``pybind11``.\n\nSmall parts of the wrappers were inspired by the code given in the ``raisimGym/raisim_gym/env/`` folder. \nIf you use these wrappers, please acknowledge their contribution as well by citing [1-4].\n\nThe following wrappers have been tested on Ubuntu 16.04 with Python 3.5 and 2.7. Other platforms and Python \nversions might work as well but we didn't test them yet.\n\n\nHow to use the wrappers?\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nIn order to use the wrappers, you will have to install at least\n`raisimLib \u003chttps://github.com/leggedrobotics/raisimLib\u003e`_ and\n`raisimOgre \u003chttps://github.com/leggedrobotics/raisimOgre\u003e`_. You will also have to install\n`pybind11 \u003chttps://pybind11.readthedocs.io/en/stable/\u003e`_ as we use this to wrap the C++ code.\n\nIf you followed the installation procedure of ``raisimLib`` and/or ``raisimOgre``, you will have the two following\nenvironment variables defined:\n\n- WORKSPACE: workspace where you clone your git repos (e.g., ~/raisim_workspace)\n- LOCAL_BUILD: build directory where you install exported cmake libraries (e.g., ~/raisim_build)\n\nFirst, clone this repository:\n\n.. code-block:: bash\n\n    cd $WORKSPACE\n    git clone https://github.com/robotlearn/raisimpy\n    cd raisimpy\n\nThen, compile the python wrappers from the ``raisimpy`` folder by typing:\n\n.. code-block:: bash\n\n    mkdir build \u0026\u0026 cd build\n    cmake -DPYBIND11_PYTHON_VERSION=$PYTHON_VERSION -DCMAKE_PREFIX_PATH=$LOCAL_BUILD -DCMAKE_INSTALL_PREFIX=$LOCAL_BUILD ..\n    make -j4\n    make install\n\nwhere ``$PYTHON_VERSION`` is the Python version you wish to use (e.g. ``PYTHON_VERSION=3.5``).\n\nNow, you just need to ``export PYTHONPATH=$PYTHONPATH:$LOCAL_BUILD/lib`` to be able to access the python library. You can \nadd this ``export`` line in your ``bashrc``.\n\nOnce it has been compiled, you can access to the Python library ``raisimpy`` in your code with:\n\n.. code-block:: python\n\n    import raisimpy as raisim\n\n    print(dir(raisim))\n\n\nWe mostly follow the naming convention defined in ``raisimLib`` and ``raisimOgre``, however we follow the PEP8 guideline.\nThus, a C++ method like:\n\n.. code-block:: cpp\n\n    getComPosition()\n\nbecomes\n\n.. code-block:: python\n\n    get_com_position()\n\n\nNote that in the original ``raisimLib``, the authors sometimes use their own defined data types for vectors and\nmatrices (such as ``Vec\u003cn\u003e``, ``Mat\u003cn,m\u003e``, ``VecDyn``, ``MatDyn``, etc). The Ogre library used for the \nvisualization also uses its own defined data types (such as ``Vector3``, ``Matrix3``, ``Quaternion``, etc). \nWhen using ``raisimpy``, these datatypes are automatically converted (back and forth) to numpy arrays as this \nis the standard in Python. We also follow the convention that if an attribute is a python list or std::vector, \nwe add the suffix 's' at the end of the attribute, and we write the full name of the variables (i.e. without \nusing diminutives), such as:\n\n.. code-block:: cpp\n\n    Body b;\n    std::vector\u003cShape::Type\u003e shapes = b.colshape;\n\nin C++, becomes in Python:\n\n.. code-block:: python\n\n    b = Body()\n    shapes = b.collision_shapes  # no diminutives (colshape --\u003e collision_shape), and added the 's' suffix to specify it is a list.\n\n\nThe code has been documented, so you can always see it using ``help`` or ``?``, for instance:\n\n.. code-block:: python\n\n    import raisimpy as raisim\n    \n    world = raisim.World()\n    world.add_sphere?\n    # or\n    help(world.add_sphere)\n\n\nExamples\n~~~~~~~~\n\nHere is the C++ example that was provided in the README in [2]:\n\n.. code-block:: cpp\n\n    #include \"raisim/World.hpp\"\n\n    int main() {\n        raisim::World world;\n        auto anymal = world.addArticulatedSystem(\"pathToURDF\"); // initialized to zero angles and identity orientation. Use setState() for a specific initial condition\n        auto ball = world.addSphere(1, 1); // radius and mass\n        auto ground = world.addGround();\n\n        world.setTimeStep(0.002);\n        world.integrate();\n    }\n\nThis becomes in Python:\n\n.. code-block:: python\n\n    import raisimpy as raisim\n\n    world = raisim.World()\n    anymal = world.add_articulated_system(\"path_to_urdf\")\n    ball = world.add_sphere(radius=1, mass=1)\n    ground = world.add_ground()\n\n    world.set_time_step(0.002)\n    world.integrate()\n\n\nOther examples can be found in the ``examples`` folder, which are the sames as the ones that you can find in the\n``examples`` folders in ``raisimLib`` [2], ``raisimOgre`` [3], and ``raisimGym`` [4]. I will add the other examples\nas soon as I have the time.\n\n\nReferences\n~~~~~~~~~~\n\n- [1] \"Per-contact iteration method for solving contact dynamics\", Hwangbo et al., 2018\n- [2] raisimLib: https://github.com/leggedrobotics/raisimLib\n- [3] raisimOgre: https://github.com/leggedrobotics/raisimOgre\n- [4] raisimGym: https://github.com/leggedrobotics/raisimGym\n- [5] pybind11: https://pybind11.readthedocs.io/en/stable/\n\n\nTroubleshooting\n~~~~~~~~~~~~~~~\n\n- ``fatal error: Eigen/*: No such file or directory``\n    - If you have Eigen3 installed on your system, you probably have to replace all the ``#include \u003cEigen/*\u003e`` by\n      ``#include \u003ceigen3/Eigen/*\u003e``. You can create symlinks to solve this issue:\n\n    .. code-block:: bash\n\n        cd /usr/local/include\n        sudo ln -sf eigen3/Eigen Eigen\n        sudo ln -sf eigen3/unsupported unsupported\n\n    or you can replace the ``#include \u003cEigen/*\u003e`` by ``#include \u003ceigen3/Eigen/*\u003e``.\n\n- Segmentation fault. This is probably an oversight on my part, the error is probably due to some poor management \n  of pointers and memory allocation. E.g. an object has been deleted from the Python side but the C++ side is also \n  trying to delete it. Just open an issue on Github, and I will fix it as soon as I can. If you fixed it, you can \n  submit a pull request.\n\n- Error about adress mapping while running RL examples, like the following one:\n\n    .. code-block:: bash\n\n        Signal: Segmentation fault (11)\n        Signal code: Address not mapped (1)\n        Failing at address: xxxxx\n\n    this seems to be caused by TensorFlow, but I have to investigate deeper what causes that error.\n\n\nLICENSE\n~~~~~~~\n\nThe following software is distributed under the `MIT \u003chttps://choosealicense.com/licenses/mit/\u003e`_ License, \nhowever the RaiSim software is under the End-User License Agreement that you can find \n`here \u003chttps://github.com/leggedrobotics/raisimLib/blob/master/LICENSE.md\u003e`_.\n\n\nCitation\n~~~~~~~~\n\nIf the code presented here was useful to you, we would appreciate if you could cite the original authors:\n\n.. code-block:: latex\n\n    @article{hwangbo2018per,\n        title={Per-contact iteration method for solving contact dynamics},\n        author={Hwangbo, Jemin and Lee, Joonho and Hutter, Marco},\n        journal={IEEE Robotics and Automation Letters},\n        volume={3},\n        number={2},\n        pages={895--902},\n        year={2018},\n        publisher={IEEE}\n    }\n\n\nIf you still have some space in your paper for the references, you can add the following citation:\n\n.. code-block:: latex\n\n    @misc{delhaisse2019raisimpy\n        author = {Delhaisse, Brian and Rozo, Leonel},\n    \ttitle = {RaiSimPy: A Python wrapper for RaiSim},\n    \thowpublished = {\\url{https://github.com/robotlearn/raisimpy}},\n    \tyear=2019,\n\t}\n\nOtherwise, you can just add me in the acknowledgements ;)\n\nIf you use ``raisimpy`` through the `pyrobolearn \u003chttps://github.com/robotlearn/pyrobolearn\u003e`_ framework (this is an\nongoing work), you can cite this last one instead (but you still have to cite the authors of RaiSim).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotlearn%2Fraisimpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobotlearn%2Fraisimpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotlearn%2Fraisimpy/lists"}