I've been building some code to do reinforcement learning on robots in a ros-gazebo environment, using ros2 humble and (ignition) gazebo fortress. My code is running fine on my machine, but when I build a docker image to run it on the university computing cluster I'm receiving the following error:
...
[Err] [EntityComponentManager.cc:1026] Failed to create component of type [9436740692853731264] for entity [58]. Type has not been properly registered.
[Err] [EntityComponentManager.cc:1026] Failed to create component of type [9436740692853731264] for entity [59]. Type has not been properly registered.
[Err] [EntityComponentManager.cc:1026] Failed to create component of type [9436740692853731264] for entity [60]. Type has not been properly registered.
Segmentation fault (core dumped)
My docker file looks like this:
FROM ros:humble-ros-base-jammy
RUN apt-get update
RUN apt-get install -y python3-pip wget
RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
RUN apt-get update
RUN apt-get install -y ignition-fortress
RUN apt-get install -y ros-humble-ros-gz
RUN pip install tensorflow
Could there be some dependency missing from my image?
One relevant thing may be that I'm running programatically gazebo using the following code:
#include "simulation.hh"
#include <stdexcept>
#include <ignition/gazebo/ServerConfig.hh>
#include <ignition/gazebo/Server.hh>
using namespace ignition::gazebo;
void Simulation::start() {
ServerConfig config;
config.SetSdfFile(_sdfPath);
_server = new Server(config);
};
void Simulation::step() {
if(_server)
_server->RunOnce(false);
else
throw std::runtime_error("Simulation not started: call start first!");
};
Starting gazebo in the docker container using the console seems to work fine.