Gazebo | Ignition | Community
Ask Your Question
0

EntityComponentManager Failed to create component - running in docker image

asked 2023-07-10 16:19:34 -0600

Lestes gravatar image

updated 2023-07-18 05:07:13 -0600

I've been building some code to run robots using Ros2 - humble and gazebo fortress. Running locally on my machine it works fine. I've built a docker image to run it on the university cluster, and when I start up gazebo I get:

...
[Msg] Found no publishers on /clock, adding root clock topic
[Dbg] [SimulationRunner.cc:496] Creating PostUpdate worker threads: 7
[Dbg] [SimulationRunner.cc:507] Creating postupdate worker thread (0)
[Dbg] [SimulationRunner.cc:507] Creating postupdate worker thread (1)
[Dbg] [SimulationRunner.cc:507] Creating postupdate worker thread (2)
[Dbg] [SimulationRunner.cc:507] Creating postupdate worker thread (3)
[Dbg] [SimulationRunner.cc:507] Creating postupdate worker thread (4)
[Dbg] [SimulationRunner.cc:507] Creating postupdate worker thread (5)
[Err] [EntityComponentManager.cc:1026] Failed to create component of type [12013502194675979273] for entity [7]. Type has not been properly registered.
[Msg] Contact system publishing on world/rl_world/model/plane/link/plane_link/sensor/touch_sensor/contact
[Dbg] [TouchPlugin.cc:216] Started touch plugin [floor]
[Err] [EntityComponentManager.cc:1026] Failed to create component of type [9436740692853731264] for entity [53]. Type has not been properly registered.
[Err] [EntityComponentManager.cc:1026] Failed to create component of type [9436740692853731264] for entity [54]. Type has not been properly registered.
[Err] [EntityComponentManager.cc:1026] Failed to create component of type [9436740692853731264] for entity [55]. Type has not been properly registered.
[Err] [EntityComponentManager.cc:1026] Failed to create component of type [9436740692853731264] for entity [56]. Type has not been properly registered.
[Err] [EntityComponentManager.cc:1026] Failed to create component of type [9436740692853731264] for entity [57]. Type has not been properly registered.
[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)

I'm running gazebo programatically using something like this:

#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!");
};

If I run it using the console command ign gazebo -s world.sdf it seems to be fine. - Though like I say, my code running it as above works fine on my machine, just not the docker image.

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 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-07-18 10:22:40 -0600

Lestes gravatar image

Ok I've got it working now. Doesn't really answer why it wasn't working, but it was taking the version of gazebo fortress installed by ros-gz rather than the one I installed directly. Building it from source and making sure my code is using that version fixed my issue.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-07-10 16:19:34 -0600

Seen: 78 times

Last updated: Jul 18 '23