chapulina / dolly

🤖🐑 It's a sheep, it's a dolly, it's a following robot. Dolly was born to be cloned.
Apache License 2.0
232 stars 65 forks source link

Assertion failure when launching dolly_gazebo demo #23

Closed ruffsl closed 3 years ago

ruffsl commented 4 years ago

Looks like the gzclient immediately crashes upon launching the dolly_gazebo demo. To reproduce: see the rocker command below using the Docker image from https://github.com/chapulina/dolly/pull/22 .

dolly_gazebo

``` $ rocker --nvidia --x11 --net=host --pulse chapulina/dolly:foxy # ros2 launch dolly_gazebo dolly.launch.py world:=dolly_empty.world [INFO] [launch]: All log files can be found below /root/.ros/log/2020-09-18-19-02-35-330746-cog-rw07-48 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [gzserver-1]: process started with pid [50] [INFO] [gzclient -2]: process started with pid [52] [INFO] [dolly_follow-3]: process started with pid [54] [INFO] [rviz2-4]: process started with pid [56] [rviz2-4] QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' [rviz2-4] [INFO] [1600480957.158976587] [rviz2]: Stereo is NOT SUPPORTED [rviz2-4] [INFO] [1600480957.159160906] [rviz2]: OpenGl version: 4.6 (GLSL 4.6) [rviz2-4] [INFO] [1600480957.390392488] [rviz2]: Stereo is NOT SUPPORTED [gzserver-1] [INFO] [1600481000.691536516] [dolly.diff_drive]: Wheel pair 1 separation set to [1.250000m] [gzserver-1] [INFO] [1600481000.692158056] [dolly.diff_drive]: Wheel pair 1 diameter set to [0.300000m] [gzserver-1] [INFO] [1600481000.693856497] [dolly.diff_drive]: Subscribed to [/dolly/cmd_vel] [gzserver-1] [INFO] [1600481000.697634516] [dolly.diff_drive]: Advertise odometry on [/dolly/odom] [gzserver-1] [INFO] [1600481000.699072195] [dolly.diff_drive]: Publishing odom transforms between [odom_demo] and [chassis] [gzclient -2] gzclient: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access::type boost::shared_ptr::operator->() const [with T = gazebo::rendering::Camera; typename boost::detail::sp_member_access::type = gazebo::rendering::Camera*]: Assertion `px != 0' failed. [gzclient -2] Aborted (core dumped) [ERROR] [gzclient -2]: process has died [pid 52, exit code 134, cmd 'gzclient ']. ^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT) [dolly_follow-3] [INFO] [1600481016.273540185] [rclcpp]: signal_handler(signal_value=2) [rviz2-4] [INFO] [1600481016.273646488] [rclcpp]: signal_handler(signal_value=2) [INFO] [dolly_follow-3]: process has finished cleanly [pid 54] [INFO] [rviz2-4]: process has finished cleanly [pid 56] [ERROR] [gzserver-1]: process has died [pid 50, exit code -2, cmd 'gzserver dolly_empty.world -s libgazebo_ros_init.so -s libgazebo_ros_factory.so ']. ```
chapulina commented 4 years ago

I think that's not a problem specific to Dolly. I built your docker image and ran with the same command as you and can reproduce the issue.

But I get the same problem when running just Gazebo:

gazebo --verbose

``` /opt/overlay_ws# gazebo --verbose Gazebo multi-robot simulator, version 11.1.0 Copyright (C) 2012 Open Source Robotics Foundation. Released under the Apache 2 License. http://gazebosim.org [Msg] Waiting for master. Gazebo multi-robot simulator, version 11.1.0 Copyright (C) 2012 Open Source Robotics Foundation. Released under the Apache 2 License. http://gazebosim.org [Msg] Waiting for master. [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [Msg] Publicized address: 192.168.1.243 No protocol specified [Err] [RenderEngine.cc:744] Can't open display: :1 [Wrn] [RenderEngine.cc:87] Unable to create X window. Rendering will be disabled [Wrn] [RenderEngine.cc:287] Cannot initialize render engine since render path type is NONE. Ignore this warning ifrendering has been turned off on purpose. [Wrn] [SystemPaths.cc:459] File or path does not exist [""] [worlds/empty.world] [Err] [Server.cc:392] Could not open file[worlds/empty.world] [Wrn] [Server.cc:351] Falling back on worlds/empty.world [Wrn] [SystemPaths.cc:459] File or path does not exist [""] [worlds/empty.world] [Err] [Server.cc:392] Could not open file[worlds/empty.world] [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [Msg] Publicized address: 192.168.1.243 No protocol specified [Err] [RenderEngine.cc:744] Can't open display: :1 [Wrn] [RenderEngine.cc:87] Unable to create X window. Rendering will be disabled [Wrn] [RenderEngine.cc:287] Cannot initialize render engine since render path type is NONE. Ignore this warning ifrendering has been turned off on purpose. No protocol specified [Wrn] [GuiIface.cc:119] could not connect to display :1 [Msg] Could not load the Qt platform plugin "xcb" in "" even though it was found. [Err] [GuiIface.cc:123] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb. ```

I don't usually use rocker, so I can't help much there. These are the scripts I use for docker development for both Gazebo and Ignition.

drfknoble commented 3 years ago

Hi there,

I know it's been a while since this question was asked; however, I just had the same issue, so I thought I'd post a solution (in case anyone else comes across it).

I found the issue was forgetting to source the Gazebo setup file as part of the Run process (https://github.com/chapulina/dolly#run), i.e. I forgot to type: ". /usr/share/gazebo/setup.sh".

Once I did, I was able to get Gazebo to show Dolly in the empty world environment.

Best regards,

Frazer

ruffsl commented 3 years ago

I found the issue was forgetting to source the Gazebo setup file as part of the Run process (https://github.com/chapulina/dolly#run), i.e. I forgot to type: ". /usr/share/gazebo/setup.sh".

@chapulina , shouldn't this gazebo setup file be transitively sourced when sourcing the ros workspace that the colcon package was compiled with; as used in https://github.com/chapulina/dolly/pull/22 here?

https://github.com/chapulina/dolly/blob/b41f4d5cd97badef86609b998a1b0d3e0db4bcaf/Dockerfile#L58-L60

chapulina commented 3 years ago

shouldn't this gazebo setup file be transitively sourced when sourcing the ros workspace that the colcon package was compiled with

That setup file is from Gazebo itself, not from any of the downstream projects that are usually compiled with colcon.

I'm closing this issue since it's not something that can be resolved in this repository. I recommend commenting on https://github.com/osrf/gazebo/issues/1949 with ideas on how the setup sourcing step can be skipped.