Git Product home page Git Product logo

robotology / gym-ignition Goto Github PK

View Code? Open in Web Editor NEW
218.0 18.0 24.0 62.92 MB

Framework for developing OpenAI Gym robotics environments simulated with Ignition Gazebo

Home Page: https://robotology.github.io/gym-ignition

License: GNU Lesser General Public License v3.0

CMake 22.96% C++ 50.92% Python 24.87% Shell 0.06% SWIG 0.64% Dockerfile 0.41% C 0.14%
openai-gym openai-gym-environment openai reinforcement-learning simulation gazebo ignition robotics ignitionrobotics ignition-gazebo gym-ignition scenario gym

gym-ignition's Introduction

gym-ignition

⚠️ Warning ⚠️

This project is no longer actively maintained, and development has stalled. For an in-depth description of the current status and actionable steps to revive development, please consult #430.

Description

gym-ignition is a framework to create reproducible robotics environments for reinforcement learning research.

It is based on the ScenarIO project which provides the low-level APIs to interface with the Ignition Gazebo simulator. By default, RL environments share a lot of boilerplate code, e.g. for initializing the simulator or structuring the classes to expose the gym.Env interface. Gym-ignition provides the Task and Runtime abstractions that help you focusing on the development of the decision-making logic rather than engineering. It includes randomizers to simplify the implementation of domain randomization of models, physics, and tasks. Gym-ignition also provides powerful dynamics algorithms compatible with both fixed-base and floating-based robots by exploiting robotology/idyntree and exposing high-level functionalities.

Gym-ignition does not provide out-of-the-box environments ready to be used. Rather, its aim is simplifying and streamlining their development. Nonetheless, for illustrative purpose, it includes canonical examples in the gym_ignition_environments package.

Visit the website for more information about the project.

Installation

  1. First, follow the installation instructions of ScenarIO.
  2. pip install gym-ignition, preferably in a virtual environment.

Contributing

You can visit our community forum hosted in GitHub Discussions. Even without coding skills, replying user's questions is a great way of contributing. If you use gym-ignition in your application and want to show it off, visit the Show and tell section! You can advertise there your environments created with gym-ignition.

Pull requests are welcome.

For major changes, please open a discussion first to propose what you would like to change.

Citation

@INPROCEEDINGS{ferigo2020gymignition,
    title={Gym-Ignition: Reproducible Robotic Simulations for Reinforcement Learning},
    author={D. {Ferigo} and S. {Traversaro} and G. {Metta} and D. {Pucci}},
    booktitle={2020 IEEE/SICE International Symposium on System Integration (SII)},
    year={2020},
    pages={885-890},
    doi={10.1109/SII46433.2020.9025951}
} 

License

LGPL v2.1 or any later version.


Disclaimer: Gym-ignition is an independent project and is not related by any means to OpenAI and Open Robotics.

gym-ignition's People

Contributors

diegoferigo avatar firefoxmetzger avatar movefasta avatar traversaro 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  avatar  avatar

gym-ignition's Issues

Discussion on the Robot abstraction

Currently the Robot interface has only the support of getting and setting joint values. It is enough for the simple environments we have developed, but definitely it has to be extended. I open this issue as placeholder for the discussion about how to structure the interface.

An initial list of feature we need to have is the following:

  • Joints (almost finalized)
    • Position
    • Velocity
    • Acceleration
    • Torque
    • PID
  • Links
    • Pose (frame orientation + position)
  • Sensors
    • IMU
    • Camera
    • F/T (not yet supported by Ignition Gazebo)
  • Other
    • Floating base
    • Contact wrenches

The existing interfaces are the following: gympp::Robot and gym_ignition.base.Robot.

Currently the robot interface is unique. Likely this is not scalable, there would be too many methods. We should think how to split it in many interfaces while maintaining consistency between python and C++.

Reminder: the python interface will switch to numpy arrays soon

Group Runtimes kwargs in dedicated classes

In order to make sure that all Runtimes provide a minimum set of features that can be configured by the user, we should group the kwargs passed during the initialization in a dedicate class. Task as an example:

kwargs={'task': cartpole_discrete.CartPoleDiscrete,
'robot': sim.cartpole.CartPoleRobot,
'sdf': "CartPole/CartPole.sdf",
'world': "DefaultEmptyWorld.world",
'rtf': max_float,
'agent_rate': 1000,
'physics_rate': 1000,
})

We might have an abstract base class with the common options (e.g. the task and the robot) and then specialize it for each runtime.

Equation of motion of a pendulum modeled as a cylinder

In order to render the equation you need to enable MathJAX on GitHub. It can be done using Chrome or Firefox extensions.

This information should be moved to the website as soon as we have one.

Pendulum System

pendulum

Modeling with Newton Laws

1. Inertia of a cylinder rotating around its center of mass

\begin{equation}
I_{com} = \frac{1}{12} m (3 r^2 + L^2)
\end{equation}

2. Express inertia in the pivot point using the parallel axis theorem

\begin{aligned}
I_{pivot} &= I_{com} + m \left( \frac{L}{2} \right)^2 \\
&= \dots = \frac{m}{12} (4L^2+3r^2)
\end{aligned}

3. Apply the second Newton Law in its rotational form

\begin{aligned}
\tau_{net} = I_{pivot} \ddot\theta = \left( \frac{L}{2} \right) m g sin(\theta)
\end{aligned}

\begin{aligned}
\ddot\theta = \dots = \frac{6g}{4L + 3 r^2 / L} sin(\theta)
\end{aligned}

Modeling with Lagrange Equations

1. Calculate the lagrangian of the system

\begin{equation}
K = \frac{1}{2} m v^2 + \frac{1}{2} I_{com} \dot\theta^2
\end{equation}

\begin{equation}
U = \frac{1}{2} mg \left( \frac{L}{2} \right) cos(\theta)
\end{equation}

\begin{aligned}
L &= K - U \\
&= \frac{1}{2} m v^2 + \frac{1}{2} I_{com} \dot\theta^2 - \frac{1}{2} mg \left( \frac{L}{2} \right) cos(\theta) \\
&= \frac{1}{2} m \left( \frac{L}{2} \right)^2 \dot\theta^2 + \frac{1}{2} I_{com} \dot\theta^2 - \frac{1}{2} mg \left( \frac{L}{2} \right) cos(\theta)
\end{aligned}

2. Apply the Euler-Lagrange equation

\begin{equation}
\frac{d}{dt} \frac{\partial L}{\partial \dot\theta} - \frac{\partial L}{\partial \theta} = 0
\end{equation}

Calculate the partial derivatives:

\begin{equation}
\frac{\partial L}{\partial \dot\theta} = \left( m \left( \frac{L}{2} \right)^2 + I_{com} \right) \dot\theta
\end{equation}

\begin{equation}
\frac{\partial L}{\partial \theta} = mg \left( \frac{L}{2} \right) sin(\theta)
\end{equation}

Substituting the derivatives and $I_{com}$:

\begin{aligned}
\ddot\theta = \dots = \frac{6g}{4L + 3 r^2 / L} sin(\theta)
\end{aligned}

Calculate the system dynamics with Euler integration

\begin{aligned}
\dot\theta_k &= \dot\theta_{k-1} + \ddot\theta_k \Delta t \\
\theta_k &= \theta_{k-1} + \dot\theta_k \Delta t
\end{aligned}

green-pi

Releases versioning

This project follows both Semantic Versioning and PEP440 guidelines.

We have a CD pipeline that is triggered by:

  • Github Release and Prerelease (push gym-ignition package)
  • Commits on devel (push to gym-ignition-nightly package)

In the first case, since GH releases are always associated with a tag, we check that the tag is PEP440 compliant before proceeding. The problem of this approach is that we cannot use the prefix v for the released tags, because it would not pass the PEP440 test.

I propose the following:

  1. We use the v prefix for released tags
  2. In GHA, before checking PEP440, we check that the tag has the v prefix and we remove it
  3. We validate the rest with PEP440
  4. We proceed as before for the release

In this way, if it the future we want another GHA triggered by tags (that might not be releases) we can use the filter - v*.

I already checked and pypa/setuptools_scm allows v* tags and generates compliant PEP440 versioned packages.

Error at compiling time

Trying to build gym-ignition in Dev mode as outlined in the readme file, I stumbled upon a build error when running

cmake --build .

In particular, the affected part is the build of Physics.cpp

cmake --build output
(gym-ignition-env) kammo@kammo-XPS-15-9560:~/repos/gym-ignition/build$ cmake --build .
Scanning dependencies of target tiny-process-library
[  2%] Building CXX object _deps/tinyprocesslibrary-build/CMakeFiles/tiny-process-library.dir/process.cpp.o
[  5%] Building CXX object _deps/tinyprocesslibrary-build/CMakeFiles/tiny-process-library.dir/process_unix.cpp.o
[  8%] Linking CXX shared library ../../lib/libtiny-process-library.so
[  8%] Built target tiny-process-library
Scanning dependencies of target gympp
[ 11%] Building CXX object gympp/CMakeFiles/gympp.dir/src/Space.cpp.o
[ 14%] Building CXX object gympp/CMakeFiles/gympp.dir/src/Random.cpp.o
[ 17%] Linking CXX shared library ../lib/libgympp.so
[ 17%] Built target gympp
Scanning dependencies of target RobotSingleton
[ 20%] Building CXX object ignition/CMakeFiles/RobotSingleton.dir/src/RobotSingleton.cpp.o
[ 22%] Linking CXX shared library ../lib/libRobotSingleton.so
[ 22%] Built target RobotSingleton
Scanning dependencies of target IgnitionRobot
[ 25%] Building CXX object ignition/CMakeFiles/IgnitionRobot.dir/src/IgnitionRobot.cpp.o
[ 28%] Linking CXX shared library ../lib/libIgnitionRobot.so
[ 28%] Built target IgnitionRobot
Scanning dependencies of target TaskSingleton
[ 31%] Building CXX object ignition/CMakeFiles/TaskSingleton.dir/src/TaskSingleton.cpp.o
[ 34%] Linking CXX shared library ../lib/libTaskSingleton.so
[ 34%] Built target TaskSingleton
Scanning dependencies of target ECMSingleton
[ 37%] Building CXX object ignition/CMakeFiles/ECMSingleton.dir/src/ECMSingleton.cpp.o
[ 40%] Linking CXX shared library ../lib/libECMSingleton.so
[ 40%] Built target ECMSingleton
Scanning dependencies of target GazeboWrapper
[ 42%] Building CXX object ignition/CMakeFiles/GazeboWrapper.dir/src/GazeboWrapper.cpp.o
[ 45%] Linking CXX shared library ../lib/libGazeboWrapper.so
[ 45%] Built target GazeboWrapper
Scanning dependencies of target IgnitionEnvironment
[ 48%] Building CXX object ignition/CMakeFiles/IgnitionEnvironment.dir/src/IgnitionEnvironment.cpp.o
[ 51%] Linking CXX shared library ../lib/libIgnitionEnvironment.so
[ 51%] Built target IgnitionEnvironment
Scanning dependencies of target PhysicsSystem
[ 54%] Building CXX object plugins/Physics/CMakeFiles/PhysicsSystem.dir/Physics.cpp.o
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::CreatePhysicsEntities(const ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:293:10: error: parse error in template argument list
     _ecm.EachNew<components::World, components::Name, components::Gravity>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:295:19: error: reference to ‘components’ is ambiguous
             const components::World* /* _world */,
                   ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:312:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::CreatePhysicsEntities(const ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:312:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:314:10: error: parse error in template argument list
     _ecm.EachNew<components::Model, components::Name, components::Pose, components::ParentEntity>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:316:19: error: reference to ‘components’ is ambiguous
             const components::Model*,
                   ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:352:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::CreatePhysicsEntities(const ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:352:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:354:10: error: parse error in template argument list
     _ecm.EachNew<components::Link, components::Name, components::Pose, components::ParentEntity>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:356:19: error: reference to ‘components’ is ambiguous
             const components::Link* /* _link */,
                   ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:391:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::CreatePhysicsEntities(const ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:391:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:396:10: error: parse error in template argument list
     _ecm.EachNew<components::Collision,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  components::Name,
                  ~~~~~~~~~~~~~~~~~
                  components::Pose,
                  ~~~~~~~~~~~~~~~~~
                  components::Geometry,
                  ~~~~~~~~~~~~~~~~~~~~~
                  components::CollisionElement,
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  components::ParentEntity>([&](const Entity& _entity,
                  ~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:402:54: error: reference to ‘components’ is ambiguous
                                                const components::Collision*,
                                                      ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:453:7: error: expected ‘{’ before ‘;’ token
     });
       ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::CreatePhysicsEntities(const ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:453:7: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:456:10: error: parse error in template argument list
     _ecm.EachNew<components::Joint,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~
                  components::Name,
                  ~~~~~~~~~~~~~~~~~
                  components::JointType,
                  ~~~~~~~~~~~~~~~~~~~~~~
                  components::Pose,
                  ~~~~~~~~~~~~~~~~~
                  components::ThreadPitch,
                  ~~~~~~~~~~~~~~~~~~~~~~~~
                  components::ParentEntity,
                  ~~~~~~~~~~~~~~~~~~~~~~~~~
                  components::ParentLinkName,
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  components::ChildLinkName>(
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:465:19: error: reference to ‘components’ is ambiguous
             const components::Joint* /* _joint */,
                   ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:510:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::CreatePhysicsEntities(const ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:510:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:512:10: error: parse error in template argument list
     _ecm.EachNew<components::BatterySoC>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:513:42: error: reference to ‘components’ is ambiguous
         [&](const Entity& _entity, const components::BatterySoC*) -> bool {
                                          ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:517:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::CreatePhysicsEntities(const ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:517:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::RemovePhysicsEntities(const ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:529:10: error: parse error in template argument list
     _ecm.EachRemoved<components::Model>([&](const Entity& _entity, const components::Model *
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:529:74: error: reference to ‘components’ is ambiguous
 ed<components::Model>([&](const Entity& _entity, const components::Model *
                                                        ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:556:7: error: expected ‘{’ before ‘;’ token
     });
       ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::RemovePhysicsEntities(const ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:556:7: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdatePhysics(ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:562:10: error: parse error in template argument list
     _ecm.Each<components::BatterySoC>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:563:42: error: reference to ‘components’ is ambiguous
         [&](const Entity& _entity, const components::BatterySoC* _bat) {
                                          ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:569:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdatePhysics(ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:569:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:572:10: error: parse error in template argument list
     _ecm.Each<components::Joint, components::Name>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:573:42: error: reference to ‘components’ is ambiguous
         [&](const Entity& _entity, const components::Joint*, const components::Name* _name) {
                                          ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:683:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdatePhysics(ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:683:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:686:10: error: parse error in template argument list
     _ecm.Each<components::ExternalWorldWrenchCmd>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:687:42: error: reference to ‘components’ is ambiguous
         [&](const Entity& _entity, const components::ExternalWorldWrenchCmd* _wrenchComp) {
                                          ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:698:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdatePhysics(ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:698:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:700:10: error: parse error in template argument list
     _ecm.Each<components::Model, components::WorldPoseCmd>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:702:19: error: reference to ‘components’ is ambiguous
             const components::Model*,
                   ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:739:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdatePhysics(ignition::gazebo::v2::EntityComponentManager&)’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:739:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:746:10: error: parse error in template argument list
     _ecm.Each<components::WorldPoseCmd>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:747:36: error: reference to ‘components’ is ambiguous
         [&](const Entity& _entity, components::WorldPoseCmd*) -> bool {
                                    ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:750:10: error: no matching function for call to ‘ignition::gazebo::v2::EntityComponentManager::Each<<expression error> >(gympp::plugins::Physics::Impl::UpdatePhysics(ignition::gazebo::v2::EntityComponentManager&)::<lambda(const Entity&, int*)>)’
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, const ComponentTypeTs* ...)> >::type) const
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:750:10: error: template argument 1 is invalid
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, ComponentTypeTs* ...)> >::type)
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:750:10: error: template argument 1 is invalid
         });
          ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:753:14: error: parse error in template argument list
         _ecm.RemoveComponent<components::WorldPoseCmd>(entity);
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:753:62: error: no matching function for call to ‘ignition::gazebo::v2::EntityComponentManager::RemoveComponent<<expression error> >(const Entity&)’
         _ecm.RemoveComponent<components::WorldPoseCmd>(entity);
                                                              ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:171:20: note: candidate: template<class ComponentTypeT> bool ignition::gazebo::v2::EntityComponentManager::RemoveComponent(ignition::gazebo::v2::Entity)
               bool RemoveComponent(Entity _entity);
                    ^~~~~~~~~~~~~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:171:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:753:62: error: template argument 1 is invalid
         _ecm.RemoveComponent<components::WorldPoseCmd>(entity);
                                                              ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:773:10: error: parse error in template argument list
     _ecm.Each<components::Link, components::Pose, components::ParentEntity>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:775:13: error: reference to ‘components’ is ambiguous
             components::Link* /*_link*/,
             ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:776:13: error: reference to ‘components’ is ambiguous
             components::Pose* _pose,
             ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:777:19: error: reference to ‘components’ is ambiguous
             const components::ParentEntity* _parent) -> bool {
                   ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:933:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:933:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:945:10: error: parse error in template argument list
     _ecm.Each<components::Pose, components::WorldPose, components::ParentEntity>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:947:19: error: reference to ‘components’ is ambiguous
             const components::Pose* _pose,
                   ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:960:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:960:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:963:10: error: parse error in template argument list
     _ecm.Each<components::Pose, components::WorldLinearVelocity, components::ParentEntity>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:965:19: error: reference to ‘components’ is ambiguous
             const components::Pose* _pose,
                   ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:980:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:980:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:983:10: error: parse error in template argument list
     _ecm.Each<components::Pose, components::AngularVelocity, components::ParentEntity>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:985:19: error: reference to ‘components’ is ambiguous
             const components::Pose* _pose,
                   ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1004:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1004:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1007:10: error: parse error in template argument list
     _ecm.Each<components::Pose, components::LinearAcceleration, components::ParentEntity>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1009:19: error: reference to ‘components’ is ambiguous
             const components::Pose* _pose,
                   ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1027:11: error: expected ‘{’ before ‘;’ token
         });
           ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1027:11: error: expected ‘)’ before ‘;’ token
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1030:10: error: parse error in template argument list
     _ecm.Each<components::JointPositionReset>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1031:36: error: reference to ‘components’ is ambiguous
         [&](const Entity& _entity, components::JointPositionReset*) -> bool {
                                    ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1032:18: error: parse error in template argument list
             _ecm.RemoveComponent<components::JointPositionReset>(_entity);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1032:73: error: no matching function for call to ‘ignition::gazebo::v2::EntityComponentManager::RemoveComponent<<expression error> >(const Entity&)’
     _ecm.RemoveComponent<components::JointPositionReset>(_entity);
                                                                 ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:171:20: note: candidate: template<class ComponentTypeT> bool ignition::gazebo::v2::EntityComponentManager::RemoveComponent(ignition::gazebo::v2::Entity)
               bool RemoveComponent(Entity _entity);
                    ^~~~~~~~~~~~~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:171:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1032:73: error: template argument 1 is invalid
     _ecm.RemoveComponent<components::JointPositionReset>(_entity);
                                                                 ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1034:10: error: no matching function for call to ‘ignition::gazebo::v2::EntityComponentManager::Each<<expression error> >(gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const::<lambda(const Entity&, int*)>)’
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, const ComponentTypeTs* ...)> >::type) const
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1034:10: error: template argument 1 is invalid
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, ComponentTypeTs* ...)> >::type)
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1034:10: error: template argument 1 is invalid
         });
          ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1036:10: error: parse error in template argument list
     _ecm.Each<components::JointVelocityReset>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1037:36: error: reference to ‘components’ is ambiguous
         [&](const Entity& _entity, components::JointVelocityReset*) -> bool {
                                    ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1038:18: error: parse error in template argument list
             _ecm.RemoveComponent<components::JointVelocityReset>(_entity);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1038:73: error: no matching function for call to ‘ignition::gazebo::v2::EntityComponentManager::RemoveComponent<<expression error> >(const Entity&)’
     _ecm.RemoveComponent<components::JointVelocityReset>(_entity);
                                                                 ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:171:20: note: candidate: template<class ComponentTypeT> bool ignition::gazebo::v2::EntityComponentManager::RemoveComponent(ignition::gazebo::v2::Entity)
               bool RemoveComponent(Entity _entity);
                    ^~~~~~~~~~~~~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:171:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1038:73: error: template argument 1 is invalid
     _ecm.RemoveComponent<components::JointVelocityReset>(_entity);
                                                                 ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1040:10: error: no matching function for call to ‘ignition::gazebo::v2::EntityComponentManager::Each<<expression error> >(gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const::<lambda(const Entity&, int*)>)’
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, const ComponentTypeTs* ...)> >::type) const
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1040:10: error: template argument 1 is invalid
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, ComponentTypeTs* ...)> >::type)
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1040:10: error: template argument 1 is invalid
         });
          ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1043:10: error: parse error in template argument list
     _ecm.Each<components::JointForceCmd>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1044:28: error: reference to ‘components’ is ambiguous
         [&](const Entity&, components::JointForceCmd* _force) -> bool {
                            ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1045:31: error: request for member ‘Data’ in ‘* _force’, which is of non-class type ‘int’
             std::fill(_force->Data().begin(), _force->Data().end(), 0.0);
                               ^~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1045:55: error: request for member ‘Data’ in ‘* _force’, which is of non-class type ‘int’
             std::fill(_force->Data().begin(), _force->Data().end(), 0.0);
                                                       ^~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1047:10: error: no matching function for call to ‘ignition::gazebo::v2::EntityComponentManager::Each<<expression error> >(gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const::<lambda(const Entity&, int*)>)’
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, const ComponentTypeTs* ...)> >::type) const
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1047:10: error: template argument 1 is invalid
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, ComponentTypeTs* ...)> >::type)
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1047:10: error: template argument 1 is invalid
         });
          ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1049:10: error: parse error in template argument list
     _ecm.Each<components::ExternalWorldWrenchCmd>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1050:28: error: reference to ‘components’ is ambiguous
         [&](const Entity&, components::ExternalWorldWrenchCmd* _wrench) -> bool {
                            ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1051:22: error: request for member ‘Data’ in ‘* _wrench’, which is of non-class type ‘int’
             _wrench->Data().Clear();
                      ^~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1053:10: error: no matching function for call to ‘ignition::gazebo::v2::EntityComponentManager::Each<<expression error> >(gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const::<lambda(const Entity&, int*)>)’
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, const ComponentTypeTs* ...)> >::type) const
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1053:10: error: template argument 1 is invalid
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, ComponentTypeTs* ...)> >::type)
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1053:10: error: template argument 1 is invalid
         });
          ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1055:10: error: parse error in template argument list
     _ecm.Each<components::JointVelocityCmd>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1056:28: error: reference to ‘components’ is ambiguous
         [&](const Entity&, components::JointVelocityCmd* _vel) -> bool {
                            ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1057:29: error: request for member ‘Data’ in ‘* _vel’, which is of non-class type ‘int’
             std::fill(_vel->Data().begin(), _vel->Data().end(), 0.0);
                             ^~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1057:51: error: request for member ‘Data’ in ‘* _vel’, which is of non-class type ‘int’
             std::fill(_vel->Data().begin(), _vel->Data().end(), 0.0);
                                                   ^~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1059:10: error: no matching function for call to ‘ignition::gazebo::v2::EntityComponentManager::Each<<expression error> >(gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const::<lambda(const Entity&, int*)>)’
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, const ComponentTypeTs* ...)> >::type) const
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1059:10: error: template argument 1 is invalid
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, ComponentTypeTs* ...)> >::type)
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1059:10: error: template argument 1 is invalid
         });
          ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1062:10: error: parse error in template argument list
     _ecm.Each<components::Joint, components::JointPosition>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1064:13: error: reference to ‘components’ is ambiguous
             components::Joint*,
             ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1065:13: error: reference to ‘components’ is ambiguous
             components::JointPosition* _jointPos) -> bool {
             ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1068:28: error: request for member ‘Data’ in ‘* _jointPos’, which is of non-class type ‘int’
                 _jointPos->Data().resize(jointIt->second->GetDegreesOfFreedom());
                            ^~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1070:32: error: request for member ‘Data’ in ‘* _jointPos’, which is of non-class type ‘int’
                     _jointPos->Data()[i] = jointIt->second->GetPosition(i);
                                ^~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1074:10: error: no matching function for call to ‘ignition::gazebo::v2::EntityComponentManager::Each<<expression error> >(gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const::<lambda(const Entity&, int*, int*)>)’
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, const ComponentTypeTs* ...)> >::type) const
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1074:10: error: template argument 1 is invalid
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, ComponentTypeTs* ...)> >::type)
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1074:10: error: template argument 1 is invalid
         });
          ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1077:10: error: parse error in template argument list
     _ecm.Each<components::Joint, components::JointVelocity>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1079:13: error: reference to ‘components’ is ambiguous
             components::Joint*,
             ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1080:13: error: reference to ‘components’ is ambiguous
             components::JointVelocity* _jointVel) -> bool {
             ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1083:28: error: request for member ‘Data’ in ‘* _jointVel’, which is of non-class type ‘int’
                 _jointVel->Data().resize(jointIt->second->GetDegreesOfFreedom());
                            ^~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1085:32: error: request for member ‘Data’ in ‘* _jointVel’, which is of non-class type ‘int’
                     _jointVel->Data()[i] = jointIt->second->GetVelocity(i);
                                ^~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1089:10: error: no matching function for call to ‘ignition::gazebo::v2::EntityComponentManager::Each<<expression error> >(gympp::plugins::Physics::Impl::UpdateSim(ignition::gazebo::v2::EntityComponentManager&) const::<lambda(const Entity&, int*, int*)>)’
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, const ComponentTypeTs* ...)> >::type) const
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1089:10: error: template argument 1 is invalid
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, ComponentTypeTs* ...)> >::type)
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1089:10: error: template argument 1 is invalid
         });
          ^
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateCollisions(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1097:32: error: reference to ‘components’ is ambiguous
     if (!_ecm.HasComponentType(components::ContactSensorData::typeId))
                                ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1102:50: error: reference to ‘components’ is ambiguous
     Entity worldEntity = _ecm.EntityByComponents(components::World());
                                                  ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1143:10: error: parse error in template argument list
     _ecm.Each<components::Collision, components::ContactSensorData>(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1145:13: error: reference to ‘components’ is ambiguous
             components::Collision*,
             ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1146:13: error: reference to ‘components’ is ambiguous
             components::ContactSensorData* _contacts) -> bool {
             ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In lambda function:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1149:30: error: reference to ‘components’ is ambiguous
                 *_contacts = components::ContactSensorData();
                              ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1168:26: error: reference to ‘components’ is ambiguous
             *_contacts = components::ContactSensorData(contactsComp);
                          ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:110:52: note: candidates are: namespace components = ignition::gazebo::v2::ignition::gazebo::v2::components;
 namespace components = ignition::gazebo::components;
                                                    ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:35:0,
                 from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/Entity.hh:44:15: note:                 namespace ignition::gazebo::v2::components { }
     namespace components {}
               ^~~~~~~~~~
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp: In member function ‘void gympp::plugins::Physics::Impl::UpdateCollisions(ignition::gazebo::v2::EntityComponentManager&) const’:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1171:10: error: no matching function for call to ‘ignition::gazebo::v2::EntityComponentManager::Each<<expression error> >(gympp::plugins::Physics::Impl::UpdateCollisions(ignition::gazebo::v2::EntityComponentManager&) const::<lambda(const Entity&, int*, int*)>)’
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, const ComponentTypeTs* ...)> >::type) const
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:330:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1171:10: error: template argument 1 is invalid
         });
          ^
In file included from /usr/include/ignition/gazebo2/ignition/gazebo/System.hh:23:0,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.h:29,
                 from /home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:26:
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note: candidate: template<class ... ComponentTypeTs> void ignition::gazebo::v2::EntityComponentManager::Each(typename ignition::gazebo::v2::EntityComponentManager::identity<std::function<bool(const long unsigned int&, ComponentTypeTs* ...)> >::type)
               void Each(typename identity<std::function<
                    ^~~~
/usr/include/ignition/gazebo2/ignition/gazebo/EntityComponentManager.hh:347:20: note:   template argument deduction/substitution failed:
/home/kammo/repos/gym-ignition/plugins/Physics/Physics.cpp:1171:10: error: template argument 1 is invalid
         });
          ^
plugins/Physics/CMakeFiles/PhysicsSystem.dir/build.make:62: recipe for target 'plugins/Physics/CMakeFiles/PhysicsSystem.dir/Physics.cpp.o' failed
make[2]: *** [plugins/Physics/CMakeFiles/PhysicsSystem.dir/Physics.cpp.o] Error 1
CMakeFiles/Makefile2:503: recipe for target 'plugins/Physics/CMakeFiles/PhysicsSystem.dir/all' failed
make[1]: *** [plugins/Physics/CMakeFiles/PhysicsSystem.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Implement Domain Randomization

Quick TODO list of quantities to randomize:

Physics Engine

  • Gravity
  • (Lights)

Model

  • Inertial parameters (inertia matrix, mass)
  • Joint friction
  • Contacts parameters
  • External forces
  • Link geometry

Singletons and plugins: dlclose affects singleton state

As described already in #7, the combo singleton plus plugins (plus python) is quite delicate. I am facing a very subtle problem when multiple environment are sequentially created in python in the same process. Take as example the following pytest, that creates 2 identical environments, overriding the first env variable and hence closing the resources of the first one:

import gym
import gym_ignition
from gym_ignition.utils import logger


# Set gym verbosity
logger.set_level(gym.logger.WARN)


def test_create_cpp_environment():
     # Environment #1
    env = gym.make("CartPoleIgnition-v0")
    assert env, "Failed to create CartPoleIgnition-v0 environment"

    action = env.action_space.sample()
    assert isinstance(action, int), "The sampled action is empty"

    observation = env.observation_space.sample()
    assert observation.size > 0, "The sampled observation is empty"

    observation = env.reset()
    assert observation.size > 0, "The observation is empty"

    state, reward, done, _ = env.step(action)
    assert state.size > 0, "The environment didn't return a valid state"

    # Environment #2
    env = gym.make("CartPoleIgnition-v0")
    assert env, "Failed to create CartPoleIgnition-v0 environment"

    action = env.action_space.sample()
    assert isinstance(action, int), "The sampled action is empty"

    observation = env.observation_space.sample()
    assert observation.size > 0, "The sampled observation is empty"

    observation = env.reset()
    assert observation.size > 0, "The observation is empty"

    state, reward, done, _ = env.step(action)
    assert state.size > 0, "The environment didn't return a valid state"

In this case the system allocates two different IgnitionEnvironment objects containing the gazebo server, which under the hood dlopens the same plugin library. This means that two instances of the plugin are loaded in the same time. Beyond this, there's a EnvironmentCallbacksSingleton object, contained in a shared library, that stores resources of the plugins.

It can be expected that the shared library containing the singleton stays loaded for the entire lifecycle of both plugins. However, when the first one is deleted, the dlclose also calls the singleton destructor (which is a very weird behavior, singleton should not be destroyed by design). This behaviour breaks the second environment, which is still alive, and the entire application segfaults. Worth to note is that this happens only in Release. The compilation in Debug is not affected by this behaviour.

Solution: Remove the pimpl pattern from the EnvironmentCallbacksSingleton such that the destructor can be called without causing harm, and preserve the state even after possible destructor call by converting all the private attributes to static (there's just one).

cc @traversaro Not sure if you want to add any detail, particularly about you investigation on cxa_atexit

Package a PyPI Wheel

In order to simplify the user installation and the deployment for training in cloud resources, having a PyPi package that contains a binary installation of gym-ignition would be highly beneficial.

In the beginning we can limit the support to manylinux x86_64, and slowly extend it by need.

The main problem is still how to install dependencies. For what concern ignition, most of the libraries can be installed from the official repository. The only exception is ign-gazebo since we still rely to a forked version. We should consider to polish the patch and open an upstream PR to add the additional components we need.

Limit symbols visibility

I spent quite a lot of time solving a segmentation fault during termination due to the existence in two different shared library of the same symbol, defined in both cpp files (one was Buffers). It is a typical example of name clashing caused by the naive approach of exporting all symbols by default.

Talking to @traversaro, I discovered quite a lot about the ELF format, such as the existence of weak and strong symbols. Likely, this was the problem I faced.

Since debugging these kind of problems might be quite painful, we should take advantage of the current relatively small C++ code size to properly implement all the tooling to limit symbols visibility.

Resources:

Insert a model in Gazebo with fixed pose

In Gazebo Classic we could fix a model to the world by using an imported model from URI and a scoped joint (example icub_fixed_no_hands.sdf). I didn't manage to make this solution work with Ignition Gazebo. Maybe there's no support of scoped links / joints outside the original <model> element.

Since now we have the support of adding and removing model during runtime (#50), maybe we could set the base type (floating / fixed) directly in the ECM by adding a fixed joint entity during model creation.

If this works, we should add a bool fixed argument in one of the two following spots:

bool insertModel(const gympp::gazebo::ModelInitData& modelData,
const gympp::gazebo::PluginData& pluginData = {});

struct gympp::gazebo::ModelInitData
{
std::string sdfString;
std::string modelName = "";
std::array<double, 3> position = {0, 0, 0};
std::array<double, 4> orientation = {1, 0, 0, 0};

Profile Ignition Gazebo to debug slow iCubGenovaV2_5 simulation

As reported in #90, simulating with the default DART physics engine the iCubGenovaV2_5 model is quite slow.

The cause might be reside in one of the following places:

  • Model: Meshes are too heavy? Sensors elements are too many (do we even need them at the moment?
  • Ignition Gazebo: this is unlikely since I don't think that a complex model would affect the ECM / SimulationRunner etc.
  • DART physics plugin: a layer below Gazebo, there's this plugin. It wraps DART and exposes unified interfaces to the simulator. Similarly to the previous point, I don't think it is itself the problem. Though, since it is the responsible of inserting the mesh files into the physics engine, maybe understanding the logic might help.
  • DART: I do not want to exclude at this stage that DART does not like that much the mesh files we use for iCub (store in icub-models).

Ignition Gazebo already has profiling support, introduced in ignitionrobotics/ign-gazebo#121. There's also a nice tutorial.

Unmet dependencies for JointForce.hh, JointPosition.hh

While compiling I got this unmet dependencies however I have the libignition-gazebo installed, I checked also in the different branches of the repository libignition-gazebo and couldn't find the files.

Which version of libignition are you using ?

Bind the EntityComponentManager

This issue is mostly a placeholder / reminder for this approach that might be considered in the future.

At the moment we are able to operate on the ECM from everywhere because we have a plugin that stores the pointer to the ECM in a singleton. Thanks to our single-process architecture, we can access the singleton throughout the program.

In particular, the class that provides the C++ Robot interface (IgnitionRobot) uses this resource to set and get the components handled in the ECM.

I realized that complete bindings to Ignition Gazebo could take this idea and extend it to all the components, not only those specific to the robot. However, since the API of the EntityComponentManager class are not very Python-friendly, creating helper classes that abstract the access to entities and component seems convenient. It is an approach that is already used upstream, for instance Model.hh. Though, the upstream helpers provide only limited functionality for our scope, we could think to create more complete ECM wrappers and expose them directly to Python.

Together with the GazeboWrapper class, these new ECM wrappers would provide a complete set of APIs to expose the simulator to other languages. Given that the ECM is the main entrypoint to simulated data, this is for sure the most generic approach we could find. In order to use it from other project (even C++), we should export properly this component as standalone. I would not like to split this component to another repo for maintainability discomfort.

I read upstream (cannot find where) that there's the idea to return the pointer to the ECM directly from the Server object. If it will be implemented, we can remove the need to use a dedicated plugin to gather its address.

cc @traversaro

Dump and inspect Ignition Gazebo data

For debugging purpose, it would extremely beneficial being able to dump data from the simulator and inspect the simulated values.

I would expect to have (WIP):

  • Joint values (position, velocity, acceleration, force)
  • Joint references (either position, velocity, or force)
  • Link poses
  • Contacts
  • ...

A possible implementation already exists upstream, introduced in ign-gazebo#181. We might use this dump and convert it to a more user-friendly format (e.g. .mat) which can be opened by python, matlab, etc with existing libraries. The objective is to plot easily the values to inspect simulation details.

Restore feature parity of C++ and Python robot interfaces

Due to a different pace of development and different requirements, the Python robot interfaces are now much more complete than the C++ interfaces.

As a reference, compare:

Ignition Gazebo still does not have all the components (in the sense of its ECM) to support all the features we defined in #33. Though, at least having the links and the base frame interfaces would be a positive move to start simulating floating-base robots.

Finalizing this task might be the right occasion to open an upstream PR in ign-gazebo proposing the inclusion of the missing components.


  • Links
  • Contacts
  • Base Frame

Docker Demo not showing GUI

Hi, I started having a look at the code and tried running the Docker demo from the readme out of the box without GPU on Ubuntu 18.04.

It generates the following text output:

gym-ignition_demo_out.txt

It also opens a Gazebo windows which remains black and closes after ~1s.

A non-exhaustive list of possibly related outputs I found in the verbose output are:


[...]

libGL error: No matching fbConfigs or visuals found

[...]

libGL error: failed to load driver: swrast

[...]

Aborted (core dumped)

[...]

Questions for @diegoferigo :

  1. Is the rest of the execution running as it should from what you can see from the log?
  2. How should the visuals look like? What could the problem be?

Thanks.

World files need to be updated after Ignition Blueprint release

We should start using the model:// URI that now seems supported and check if SDF_FILES is still required. The error reported is:

dferigo@iiticublap110:~/git/ign-gazebo ~> ign gazebo /home/dferigo/git/gym-ignition/models/worlds/iCubGazeboV2_5.world 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-dferigo'
[Err] [Server.cc:189] Error Code 11 Msg: Unable to find uri[iCubGazeboV2_5]
[Err] [Server.cc:189] Error Code 10 Msg: Invalid uri[iCubGazeboV2_5]. Should be model://iCubGazeboV2_5

From an preliminary test this was not enough, I still have to dig into the code, probably I have to export a new environment variable.

Allow registering user plugins

Even if it is still preliminary, users can create environment plugins and store them in an external project. In order to import them from python, the GymFactory class should allow to register new plugin metadata, similarly to the registration capability of OpenAI gym.

It should be a straightforward task. We should provide a static method in GymFactory that adds a new entry in the factory database, and bind it to python with swig. The only delicate aspect is how to handle the action and observation spaces.

Implement whole-body controllers for fixed and floating base robots

For the users of Gym-Ignition, it would be helpful having generic implementations of whole-body torque controllers. I propose to develop three controllers:

  1. Fixed base controller: canonical computed torque controller
  2. Floating base controllers:
    1. Joint Space Feedback Linearization: same as 1 but for a floating base system
    2. Constrained Inverse Dynamics: assuming the existence on holonomic constrants, control both joints and floating base projecting the torques to the null space of the contacts

  • 1) Fixed base controller
  • 2i) Joint Space Feedback Linearization
  • 2ii) Constrained Inverse Dynamics

Separate the robot from the environment

In the current architecture, environment and robot are treated as a single entity since they are described together in the sdf file. We already have two different files for the two, and the world file exploits sdf capability to import elements from another sdf file.

Referring to #12, we have few robot-related singletons in our architecture, and it affects exploiting multiple threads for parallel simulations.

Properly handling the robot and the environment separately also in gympp::IgnitionEnvironment might simplify the support of multithread. Instead of relying on sdformat to combine world and model files, gym-ignition can do it directly manipulating the individually deserialized sdf files.

Add a proper documentation

Edit: I converted this issue to be more generic. Every time we find something that still needs to be documented, we can reference this issue.


As #36 (comment) and #36 (comment), we should provide reference documentation page we can link every time we need to refer to the notation used in our code.

  • Link velocity (both linear and angular parts)
  • Link orientation
  • External forces
  • Contact forces

Ignition robotics libraries and python: plugins symbol resolution problems

This issue reports a quite tricky behavior and involves an advanced knowledge of how a C++ software is assembled. First, I try to describe briefly the sequence of operations that are executed when environments are used from python, and provide some information of the architecture of upstream Ignition Gazebo. Second, I describe the problem I encountered and an explanation that @traversaro and me though about it. Last, I present how I solved the problem and comment possible issues that we might face in the future.

Architecture overview

The current initial support to use gym-ignition from other languages, python in this case, is implemented with swig. Swig is responsible to create bindings of the C++ classes that form this project. Since the usage of the bindings is not very python-idiomatic, we also provide a gym_ignition python package that implements the gym.Env interface of OpenAI gym. In this way, the bindings are hidden to the users, and we are more free to change them accordingly to our needs (potentially also using something different than swig).

When the users use the provided class, the python module created with swig is imported, and the shared library that contains the wrapping functions is loaded in memory. These wrapping functions then directly call the C++ classes of gympp.

If the aim is to use the environments running inside Gazebo (the only implementation currently available), the dynamic loader of the operating system at one point has to load the libraries that form ignition robotics in memory. This should be clear and straightforward. What's important to know for what follows is that the architecture implemented in Gazebo for adding Systems to a simulation exploits a plugin-based pattern (shared libraries loaded during runtime, e.g. using dlopen on GNU/Linux and macOS). The environments provided by gym-ignition are implemented as gazebo plugins.

Problem description

Calling the same code that creates and uses a gympp::Environment object works if called from a C++ executable, but fails if called from python.

The failure is related to a portion of code of the ignition libraries where a singleton is involved (particularly about the creation of the storage of a component of the ECM that involves a Factory class). Unfortunately, the coupling of singleton and plugins is extremely delicate.

I found out that, when called from python, the instance of this factory, that should be global ( i.e. shared by the whole program) was instead local to the plugins. In other words, the pointer to this factory object was not unique. This creates many problems and breaks the logic of components registration.

Ignition plugins are handled by ign-plugin. They use dlopen(path, RTLD_LAZY | RTLD_LOCAL) to load plugins, but despite the LOCAL resolution, in C++ everything works fine.

The only difference of the code executed from C++ and python is that the executable in the first case links directly against the ignition libraries, which are loaded before that execution starts (and, consequently, before the plugins are loaded). In the second case, instead, the ignition libraries are loaded by swig. Now, even though I'm not 100% sure of what follows, swig from python loads the bindings library using RTLD_LOCAL (not sure it due to the default python behavior or hardcoded somewhere). This means that the ignition libraries which are transitively loaded, have a local resolution. Then, later on during the execution of the environment, when gympp loads the plugins, dlopen re-loads the ignition libraries, since they were not global in the first place. And this might explain why the factory object is not shared.

Solution

If the ignition libraries were already loaded in memory as global before the plugins are loaded, dlopen would directly use them and it would not attempt to load them again. Changing the default behavior dlopen in python is possible using setdlopenflags, and this workaround does the trick 🎉 More in detail, we should alter the flags before loading the gympp python module of the swig bindings:

sys.setdlopenflags(sys.getdlopenflags() | os.RTLD_GLOBAL)

Sources:

Implement Continuous Integration pipeline

We should add Travis CI support. In this case though it is not a trivial task since there are a lot of dependencies from sources (mainly the ignition libraries).

On the long run we can use their binary packages, but at the current stage the best solution would exploit a docker image.

Simulate complex robots

During the first phase of development, we mainly tested the framework with toy environments such as the CartPole and the Pendulum.

For the first stable release, we want to achieve simulating complex multi-DoF floating-base robots, whose models might contain meshes.

In #4, we included models of the iCub humanoid robot, but after the first experiments we never used them for real development. We should start again that activity and finalize their usage in simulated environments.

We can use this issue to report the problems and bottlenecks we encounter. To begin:

  • Simulating iCubGazeboV2_5 (model, world) is extremely slow. I get a RTF ~ 4%. We should run a profiler (#91) to understand where is the bottleneck (Is the problem DART or Gazebo?).

Note that the model still has rendering problems, as reported in #31.

When inserting multiple robots, few models are only partially loaded

I am experiencing a quite strange behaviour when adding multiple (complex) models in a single simulation. In few cases (on average 2/3 models over 10 totally) the recognized joints are not complete. For examples, models with 41 joints would show only 25. When this happens, the numbers are consistent and do not change.

The culprit is this function call, that for some reason fails to find all the joints:

ecm.Each<ignition::gazebo::components::Joint,
ignition::gazebo::components::Name,
ignition::gazebo::components::JointType,
ignition::gazebo::components::ParentEntity>(
[&](const ignition::gazebo::Entity& entity,
ignition::gazebo::components::Joint* /*joint*/,
ignition::gazebo::components::Name* name,
ignition::gazebo::components::JointType* type,
ignition::gazebo::components::ParentEntity* parentEntityComponent) -> bool {
// Skip all the joints not belonging to this model
if (parentEntityComponent->Data() != pImpl->model.Entity()) {
return true;
}
gymppDebug << " Found joint: " << pImpl->model.Name(ecm) << "::" << name->Data()
<< " [" << entity << "]" << std::endl;

I already checked and it seems that, when inserting the model in the ECM in the first place, the entities and components are all there:

// Create the model entity. It will create a model with the name specified in the SDF.
modelEntity = sdfEntityCreator->CreateEntities(modelSdfRoot.ModelByIndex(0));

What's strange in that the above method of the IgnitionRobot class is called just few lines after the creation of entities and components, in:

auto ignRobot = std::make_shared<gympp::gazebo::IgnitionRobot>();
if (!ignRobot->configureECM(modelEntity, modelSdfRoot.Element(), *ecm)) {
gymppError << "Failed to configure the Robot interface" << std::endl;
return false;
}

Finalize the RealTimeRuntime class

We should finalize the implementation of the RealTimeRuntime python class, that allows stepping the Tasks ensuring that the agent rate is respected.

It should be fairly easy taking inspiration of the existing logic of the PyBulletRuntime:

def _enforce_rtf(self):
if self._now is not None:
# Compute the actual elapsed time from last cycle
elapsed = time.time() - self._now
# Nominal timestep with the desired RTF
expected_dt = 1.0 / self.agent_rate / self._rtf
# Compute the amount of sleep time to match the desired RTF
sleep_amount = expected_dt - elapsed - self._bias
# Sleep if needed
real_sleep = 0
if sleep_amount > 0:
now = time.time()
time.sleep(sleep_amount)
real_sleep = time.time() - now
# We use a low-filtered bias to compensate delays due to code running outside
# the step method
self._bias = \
0.01 * (real_sleep - np.max([sleep_amount, 0.0])) +\
0.99 * self._bias
# Update the time for the next cycle
self._now = time.time()

MacOs Mojave 10.14.6 Compilation

Trying to compile gym-ignition on macOS Mojave 10.14.6

Installed gazebo-ignition via homebrew by following https://ignitionrobotics.org/docs/latest/install.

brew install ignition-blueprint

Needed to unlink sdformta6

brew unlink sdformat6

for using sdformat8

Installed gcc-8

brew install gcc@8

and exported

export CC=gcc-8
export CXX=g++-8

Cloned the repository, inside the repository, configure and make

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build .

CMakeWarning

  Could not find a configuration file for package "DART" that is compatible
  with requested version "6.10.0".

  The following configuration files were considered but not accepted:

    /usr/local/share/dart/cmake/DARTConfig.cmake, version: 6.9.2

Compilation Error

[ 17%] Linking CXX shared library ../lib/libgympp.dylib
Undefined symbols for architecture x86_64:
  "ignition::common::Logger::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)", referenced from:
      gympp::spaces::Discrete::contains(gympp::data::Sample const&) const in Space.cpp.o
      gympp::spaces::Box::contains(gympp::data::Sample const&) const in Space.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

By putting to false (not solving the problem since ignition-common3 is present in the system)

if(ignition-common3_FOUND))
    target_compile_definitions(gympp PUBLIC USE_IGNITION_LOGS)
    target_link_libraries(gympp PUBLIC
        ignition-common3::ignition-common3)
endif()

The compilation continued

[ 20%] Building CXX object ignition/CMakeFiles/RobotSingleton.dir/src/RobotSingleton.cpp.o
/Users/csartore/gym-ignition/ignition/src/RobotSingleton.cpp: In member function 'std::weak_ptr<gympp::Robot> gympp::gazebo::RobotSingleton::getRobot(const string&) const':
/Users/csartore/gym-ignition/ignition/src/RobotSingleton.cpp:56:5: error: 'assert' was not declared in this scope
     assert(pImpl->robots.at(robotName));
     ^~~~~~
/Users/csartore/gym-ignition/ignition/src/RobotSingleton.cpp:56:5: note: 'assert' is defined in header '<cassert>'; did you forget to '#include <cassert>'?
/Users/csartore/gym-ignition/ignition/src/RobotSingleton.cpp:11:1:
+#include <cassert>

/Users/csartore/gym-ignition/ignition/src/RobotSingleton.cpp:56:5:
     assert(pImpl->robots.at(robotName));
     ^~~~~~

By adding the include asked

Undefined symbols for architecture x86_64:
  "google::protobuf::MessageLite::ParseFromIstream(std::basic_istream<char, std::char_traits<char> >*)", referenced from:
      ignition::gazebo::v2::serializers::VectorDoubleSerializer::Deserialize(std::basic_istream<char, std::char_traits<char> >&, std::vector<double, std::allocator<double> >&) in IgnitionRobot.cpp.o
  "ignition::math::v6::PID::Update(double, std::chrono::duration<double, std::ratio<1l, 1l> > const&)", referenced from:
      gympp::gazebo::IgnitionRobot::update(std::chrono::duration<double, std::ratio<1l, 1l> >) in IgnitionRobot.cpp.o
  "ignition::common::env(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)", referenced from:

I have cheked and google::protobuf::MessageLite::ParseFromIstream exists in the related header located in /usr/local/Cellar/protobuf/3.10.0/include/google/protobuf/message_lite.h

Statically compiled ign-gazebo fails to find all exported components

If I install all the Ignition Robotics libraries from their ppa except ign-gazebo which is statically compiled from source, in downstream code the command:

find_package(ignition-gazebo2 COMPONENTS all)

Fails with the following error:

CMake Warning at /usr/share/cmake-3.15/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  Found package configuration file:

    /usr/lib/x86_64-linux-gnu/cmake/ignition-gazebo2-ign/ignition-gazebo2-ign-config.cmake

  but it set ignition-gazebo2-ign_FOUND to FALSE so package
  "ignition-gazebo2-ign" is considered to be NOT FOUND.  Reason given by
  package:

  The following imported targets are referenced, but are missing:
  ignition-gazebo2::ignition-gazebo2-gui

Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/ignition-gazebo2-all/ignition-gazebo2-all-config.cmake:91 (find_dependency)
  /usr/share/cmake-3.15/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
  /usr/lib/x86_64-linux-gnu/cmake/ignition-gazebo2/ignition-gazebo2-config.cmake:215 (find_dependency)
  CMakeLists.txt:109 (find_package)


CMake Warning at /usr/share/cmake-3.15/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  Found package configuration file:

    /usr/lib/x86_64-linux-gnu/cmake/ignition-gazebo2-all/ignition-gazebo2-all-config.cmake

  but it set ignition-gazebo2-all_FOUND to FALSE so package
  "ignition-gazebo2-all" is considered to be NOT FOUND.  Reason given by
  package:

  ignition-gazebo2-all could not be found because dependency
  ignition-gazebo2-ign could not be found.

Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/ignition-gazebo2/ignition-gazebo2-config.cmake:215 (find_dependency)
  CMakeLists.txt:109 (find_package)


CMake Warning at CMakeLists.txt:109 (find_package):
  Found package configuration file:

    /usr/lib/x86_64-linux-gnu/cmake/ignition-gazebo2/ignition-gazebo2-config.cmake

  but it set ignition-gazebo2_FOUND to FALSE so package "ignition-gazebo2" is
  considered to be NOT FOUND.  Reason given by package:

  ignition-gazebo2 could not be found because dependency ignition-gazebo2-all
  could not be found.

If, instead, I do the following, the target is found:

find_package(ignition-gazebo2-gui)
find_package(ignition-gazebo2 COMPONENTS all)

I suspect that there's a problem in the exported targets of ign-gazebo.

Implement Environment to test robot controllers

In order to support the development of robot controllers (#88) we might benefit having an environment with the following characteristics:

  • Action: joint and base references
  • Observation: joint and base positions
  • Reward: none

It should take as kwargs the controller type.

Double free if statically compiled

For the PyPI distribution, all the C++ libraries of Gym-Ignition are statically compiled. When the user installs the sdist package, the installed shared library of the SWIG bindings includes all the other components [1].

Everything seems to work just fine, and tests pass correctly. Though, during resource deallocation, only when the project is compiled as static there's a double free or corruption segmentation fault. More details in the valgrind analysis.

I temporarily disabled the check of pytest in the PyPI CD pipeline in 886676d.


[1] The Gazebo plugins are an exception, they are installed separately.

Investigate color support in mesh files

As reported in #4, the colors are not properly displayed in our iCub models.

Despite this rendering problem, the models are loaded correctly and both links and joints are detected.

Here below an example with iCubGazeboV2_5:

ignition_gazebo

Develop an example to compare Runtime classes

At the moment the supported runtimes are the following:

  • GazeboRuntime
  • PyBulletRuntime (almost ready in #40)

It would be nice comparing simple environments like the existing CartPole, or an even simpler Pendulum. Without contacts, the two physics engines behaviors should mostly match.

Distributed simulations

This issue is somehow related to #12 about parallel simulations. The aim of #12 is exploiting multiple threads (or processes) running inside the same machine, here we focus more on exploiting multiple machines.

The obvious problem when executing distributed computations is synchronization between workers. The best solution that in the same time minimizes our effort (considering our current workforce) while maximizes the result is relying on ignition gazebo features:

Currently these features are still not mature, but there are already working demos (distributed and distributed levels).

To be honest, in order to be able to scale a simulation horizontally (i.e. spawn transparently many parallel workers), probably the parallel simulations of #12 can be treated in the same way of distributed simulations running on a single machine. This would greatly simplify their maintenance. The tradeoff is that in this way #12 would be implemented as multi-process instead of multi-thread.

Define v1.0beta2 features (Biro)

EDIT: A more detailed task breakdown in Milestone v1.0.


Gym-Ignition will be presented at SII2020. I want to have here a sort of list of features we'd like to have in the first stable release v1.0, which will be released before the conference. We can use this issue for proposals and discussion.

Edit: We've delayed the first stable release due to a big C++ refactoring that is tracked in #155. We presented the first beta version (codename Aloha) at SII2020. I converted this issue to contain the features of the second beta release (codename Biro).

  • C++ and Python feature parity of Robot interfaces (#65)
  • Finalize the RealTimeRuntime (#94)
  • Insert a model in Gazebo with fixed pose (#80)
  • Implement generic whole-body controllers (#88)
  • Implement a new task for controlling fixed and floating base robots (test bench for low-level and high-level controllers) (#89)
  • Simulating with Ignition Gazebo complex robots with many DoFs and meshes (as iCub) (#90)
  • Fix meshes rendering (#31)
  • Structure better the kwargs of Runtime objects (#49)

cc @traversaro @raffaello-camoriano @anqingd @eleramp @CarlottaSartore

Windows support

This is a classic Bug#1. At the moment the development is focused on GNU/Linux. It should be compatible also with other operating systems but currently we do not provide any direct support.

Create entities in Ignition Gazebo during runtime

Currently the GazeboWrapper, in order to load a world and a model stored in separated files, needs to parse both files and insert the model section in the XML of the world sdf.

This is a dirty implementation that was due to the missing support of inserting object in Ignition Gazebo during runtime. This feature was added few months ago, and using this method would drastically clean the GazeboWrapper class.

Furthermore:

  • We could instantiate multiple models on-the-fly in the same simulation
  • The reset of an environment could just delete the old model and insert a new new, instead of resetting the state of the simulation (which btw would not work for floating base robots).

Implement new PyBullet backend for benchmarking purpose

The current architecture can be recapped as follows:

  • Robot: abstracts getting and setting robot values and references
  • Task: works on a generic Robot object and implements the environment logic (how to process the action, how to form the observation, computes the reward)
  • Task Wrapper (e.g. GazeboEnv): wraps the Task and steps the physics with the simulator

Pybullet is probably the main open-source alternative to the Mujoco simulator. There's a quite big community for robotic applications that chose pybullet. Waiting that Ignition Gazebo supports bullet as a backend (coming! 🎉), it might be a good idea adding the support of pybullet for benchmarking purpose. Only two components need to be developed:

  1. PyBulletRobot: A new implementation of the Robot interface to interface with the bullet simulator
  2. PyBulletEnv: A Task Wrapper that steps the physics using pybullet

If everything is developed correctly, the Tasks object should work on both simulators.

Protobuf error executing gym-ignition from gym-ignition:latest image

Executing the example launch_cartpole.py from the minimal image diegoferigo/gym-ignition:latest (#77) fails with the following error:

root@3fd84b6f0e1f:/# python -O /github/examples/python/launch_cartpole.py 
pybullet build time: Oct 11 2019 21:23:09
INFO: Making new env: CartPoleDiscrete-Gazebo-v0
[Msg] Loading SDF string. File path not available.
[libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: peer_info.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:1164] CHECK failed: generated_database_->Add(encoded_file_descriptor, size): 
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: generated_database_->Add(encoded_file_descriptor, size): 
Aborted (core dumped)

The image follows the User Setup described in the README, that installs gym-ignition from the bdist distribution. I suspect that the linking ign-gazebo statically in the bindings shared library during the wheel creation might be the responsible. @traversaro

Add GitHub Actions support

We should add two workflows:

  • Cron build for the docker image used in CI #48
  • C++ and Python tests from source #48
  • C++ and Python tests from PyPy package #55

Simulation rate tests are failing in Travis CI

CI on the master branch are currently failing while testing the following configuration:

========

Testing:

========

RTF = 10

Agent rate = 100

Physics rate = 2000

Elapsed time = 0.5395810604095459

Average step time = 0.0028877513392739722

Number of actions: = 200.0

Physics iteration per simulator step = 20.0

----------------

ASSERTION FAILED

----------------

#1=0.0028877513392739722

#2=0.001

Error=0.0018877513392739722

Tolerance=0.0014438756696369861

We should disable testing simulatiosn with a physics rate > 1000 in CI, they are too demanding for the CPU and increasing the tolerance is a pointless workaround.

The CartPole environments fail to seed the spaces

On both the CartPoleIgnition-v0 and CartPoleIgnitionPython-v0 environments I get this error while running a simple test.

/usr/local/lib/python3.6/dist-packages/gym_ignition/envs/base/ignition_python_env.py in seed(self, seed)
    169 
    170         # Seed the spaces
--> 171         self.action_space.seed(seed)
    172         self.observation_space.seed(seed)
    173 

AttributeError: 'Discrete' object has no attribute 'seed'

To add more context, I am trying to run gym-ignition on google colaboratory. On my local machine everything works fine, looking for differences in the setups.

Allow multiple parallel simulations

At this early stage, only one concurrent simulation is currently possible. Though, many RL algorithms achieve their best performance only when many agents / workers are exploited.

We should think how to address this constraint.

From my point of view, for what concerns ignition gazebo, this can be can addressed in two ways:

  1. We can launch many independent instances of gazebo::Server, and each of them load the same sdf world.
  2. We can exploit the possibility of simulating multiple worlds in parallel.

The first solution would have problems when the GUI is involved. Which one of the parallel worlds should be rendered? I suspect that if we have this option running, due to the current ignition architecture (messages exchanged between server and gui) the rendered world would be the combination of all the running instances.

For what the second solution, instead, I guess that upstream they will provide a way to synchronize the gui only on one of them. However, the multiple world support still has to be finalized.

Though, even if today we would have option 2) running, gym-ignition has some limitations that prevent concurrent simulations. Particularly:

  • Reading data from a simulated <model> is performed through a plugin that interfaces with a singleton. Then, environment plugins such as the CartPole access the data through the singleton. The model is registered with its name, and if two worlds are simulated, since they operate on the same sdf, they would try to register the same entry inside the singleton. If we want to keep this architecture, we should figure out a workaround to store and retrieve from the singleton different entries for different environment plugins.
  • [...] (anything else?)

cc @traversaro

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.