I am using webots 2022b inside of a docker container. In my vs code, it runs fine, but when I try to run the command straight from the docker container, I am running into an issue where the controller program instantly exits with code-11 but no output or error message.

[ERROR] [driver-2]: process has died [pid 66, exit code -11, cmd '/opt/ros/galactic/lib/webots_ros2_driver/driver __log_level:=debug --log-level debug --ros-args --params-file /tmp/launch_params_ec8xrm55'].

With rclcpp print statements, I have narrowed the crash down to occur on this line:

keyboard_ = node_->robot()->getKeyboard();

I've been stuck on this for a couple days now; I have a couple directions the solution may go: either enable some lower level of logging that will let me see an error message I can work with (I have tried adding arguments=[('__log_level:=debug'), '--log-level', 'debug'] to the driver node in the launch file but those don't seem to work),

or alternatively maybe there is some setting in docker I can give to pass the keyboard through to the container in a way that webots expects? I have tried a couple things like using docker run -it to give terminal emulation.

  • 1
    $\begingroup$ If it crashes at the line you indicate, it probably means that node_->robot() returns NULL. Can you check if it is the case? $\endgroup$ Commented Dec 6, 2022 at 11:02
  • $\begingroup$ @OlivierMichel I don't think so, in previous lines I have several things like camera_ = node_->robot()->getCamera("CAM"); which work fine. However, I will explicitly check for you $\endgroup$
    – Rugnir
    Commented Dec 6, 2022 at 11:35
  • $\begingroup$ @OlivierMichel Yep I checked an it is not == nullptr, I can also rclcpp output node_->robot()->getName() and get a correct result (in this case our companyname+robot) $\endgroup$
    – Rugnir
    Commented Dec 6, 2022 at 11:54
  • $\begingroup$ That's very odd since the getKeyboard method is extremely simple and cannot crash normally... So, I would suspect that you compiled with a version of libController and you are executing it with a different version. Could it be the case? $\endgroup$ Commented Dec 6, 2022 at 12:58
  • 1
    $\begingroup$ It seems you are using both a Webots docker and the webots_ros2 package. Are they running inside the same docker? I am still convinced that there may be a version mismatch between Webots (you are using Webots R2022b) and the ROS 2 package webots_ros2 for galactic which is currently version 2023.0.0 corresponding to Webots R2023a. Could you please better explain how you put together Webots and webots_ros2? Can you share your Dockerfiles if any? $\endgroup$ Commented Dec 7, 2022 at 12:42

1 Answer 1


It turns out that as Oliver Michel had said, there was a version mismatch between the compiling version of webots and the executing. In this case, it was as simple as I was colcon building in a window of vs code that I had opened weeks ago, and as such was still using webots 2022a, even though I had long since updated the dockerfile to force using 2022b.

Compiling with one version and running against another perhaps predictably caused these unusual errors. Rebuilding my vscode container so I could colcon build in the newer version solved my problem.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.