RcsPySim
A robot control and simulation library
RcsPySim Documentation

RcsPySim is a framework for accessing simulations powered by Rcs as a Python module unsing pybind11.

It is written for research purposes with the focus on learning robot control policies from (randomized) physics simulations. The use case in mind is to employ the C++ simulations as a black box and feed the resulting data to a reinforcement learning algorithm on the Python side of the framework called Pyrado.

RcsPySim Structure

RcsPySim can be divided in two parts. One part contains are C++ classes which construct the experiments, receive data from the the Python side, and connect to the Rcs framework. The second part uses pybind11 to bind all RcsPySim C++ classes and functions into a Python module called rcsenv. This module can then be imported (as done in Pyrado) in order to generate data from Rcs-based simulations.

Installation

Please follow the readme-file in the root project folder (one level above RcsPySim folder).

Where to start

Check out Rcs::ExperimentConfig where the simulation environments are specified and Rcs::RcsSimEnv which runs the simulations.

Information about Rcs graphs

In Rcs, he kinematic dependency ob bodies is modeled as a graph. There can be multiple graphs in one program, and the same graph you be used by multiple object. Thus, it important to understand, on which graph an operation is executed. In general, RcsPySim uses 2 graphs: (i) a graph, called "config graph", which is created from the environment specific config xml-file, then stored in the config attribute of the Rcs::RcsSimEnv class. This graph is also later passed to the Rcs::PhysicsParameterManager which takes care of the domain parameter randomization. (ii) a graph, called "desired graph", which is a deep copy from the config graph. The desired graph only exists in the Rcs::ActionModelIK and its derived classes. To be more exact, the controller within these action models owns this copied graph. Note, that depending on how the simulation was created, the viewer is receives a node based on the config graph, and a node based on the controller's desired graph.