ROS 2 Dashing and Gazebo

Hi,
I am doing the installation of the ROS 2 Dashing and Gazebo as seen here
I am wokring on windows and have the VM installed and sucessfully have the ros_melodic_dashing_gazebov9.vmx operating.
When trying to use the worlds on my desktop, they simply open a terminal windows for a split second and then close again. It seems that they crash or Gazebo runs into issues and fails to open any of the worlds.
I have also tried this in conjunciton with the differetial drive example here . Which indicates to use
export SVGA_VGPU10=0
before opening the world, however this does not work either.
Any suggestions as to what is the problem?
Thanks,
Rob

8 Comments

Hello Rob,
I think we'll need some real error message to make any guesses. If you right-click the shortcut on the desktop, you can see the target shell-script that the shortcut runs. If you open that shell script, you can see the commands that will be run when it opens. For example, here is the Gazebo Empty shell script:
#!/bin/sh
export SVGA_VGPU10=0
export ROS_IP=$(hostname -I | tr -d [:blank:])
export ROS_MASTER_URI=http://$ROS_IP:11311
# Launch Gazebo world with TurtleBot3 Waffle Pi
gnome-terminal --title="Gazebo Empty World" -- /bin/bash -c 'export TURTLEBOT3_MODEL=burger; source /opt/ros/melodic/setup.bash; roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch '
I'd suggest running each of those commands one at a time in a newly-launched terminal, see what command gives an error, and what the error message is (since you launched the terminal separately, it shouldn't close on error). You can even break up the final command to see the issue more specifically:
export TURTLEBOT3_MODEL=burger
source /opt/ros/melodic/setup.bash
roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch
-Cam
Hi Cam,
Thank you for your reply.
I have done this and it has worked for the opening of the Gazebo Empty world, which is great!
However, I tried the same method for the Differential Drive World shortcut and the same problem occurred where the terminal ran and then closed again without opening or running Gazebo. I have a screenshot of what came up just before it closed.
I wonder has it something to do with OpenGL or the graphics of the virtual machine?
Thanks,
Rob
So what happens if you run these three commands in the terminal?
export SVGA_VGPU10=0
export GAZEBO_PLUGIN_PATH=/home/user/src/GazeboPlugin/export:$GAZEBO_PLUGIN_PATH
gazebo /home/user/src/GazeboPlugin/world/differentialDriveRobot.world --verbose
The reason the window is closing is because the "bash" command is opening a separate bash terminal. If you run it in the terminal you have open already, you should see the error message.
-Cam
Cam,
Thank you for your patience.
Unfortunately, I still receive no formal error signal or command in my terminal, when running these three commands:
Any other solutions from here?
I greatly appreciate your assistance.
Rob
The terminal simply stalled after the last command for a few seconds, without returning any gazebo program window, and then presented the usual user@ubuntu......
That is bizarre, to put it lightly. I did a little searching, but it seems like Gazebo usually gives some kind of error when crashing. This post sounded very similar to that issue though, so it may be worth trying their solution (save a backup of the file to put back in place just in case though).
It also may be telling that the Gazebo empty world worked, but the one that should have the Pioneer model did not. It could be an issue with loading the model (either a corrupted model file, or a graphics issue as you suggested). Or it could be the difference between using roslaunch and a lauch file, versus calling "gazebo" directly. Maybe try the other shortcuts on the desktop and see which ones launch correctly and which don't.
Also, what settings are you using for your VM? Memory, disk space, and processors are probably the most important for this situation.
It baffles me!
I had actually come across that forum posting, that you liked, already and it didn't work for me.
Is there other methodsof launching these shortcuts or world files that I should try?
I attempted to launch some of the other shortcuts straight off the desktop and also using the shell commands:
Gazebo Office. desktop shortcut launch:
However, using the shell commands, it launched just fine!
Then I ran it a second time with the desktop shortcut and it too launched perfectly? I am baffled hahaha
An interesting trial was with the 'Gazebo Warehouse Robot' which actually is my goal world to run as this is the model I am trying to control.
When running using the desktop shortcut, it simply flashes a terminal window for a few second and closes again.
However, using the individual shell commands, Gazebo launches for a brief moment (nothing renders) but a multitude of warnings display in the terminal:
I do not know personally, what these warnings mean.
My VM is using 4.3GB of Memory, 3 Processors, Display has been used both with accelerated 3d graphics and without and seems to perfrom better with it activated.
This is a tough problem!
Rob
Should I be worried about this?

Sign in to comment.

Answers (1)

Cam Salzberger
Cam Salzberger on 4 Dec 2020
Moved: Jagadeesh Konakalla on 8 Jul 2024
The "roscore" not found error is the correct behavior for the default terminal, actually. ROS needs to be "sourced" to put its various tools and libraries on the path, but you generally shouldn't have both ROS and ROS 2 sourced in the same terminal (except if you are going to use ros1_bridge). So if you want to access the ROS functionality, use the "ROS Melodic Terminal" shortcut instead of the default terminal, which will source the right folder for you. If you want to use ROS 2, you can call:
source /opt/ros/dashing/setup.bash
Those error messages with Gazebo are not supremely helpful either. In the Gazebo Office world output, you should be able to safely ignore the complaint about "rosdep". I see that output as well, but it has no impact. The error that Gazebo is giving just seems to be an irregular crash that some people experience more than others. I've seen a couple of similar posts here and here, so you could try their suggested workarounds.
Also, since the error is so generic, it would probably help to take a look at the log files mentioned to see if there is anything there that stands out.
At this point, you probably need more direct assistance. I'd suggest contacting Tech Support with all of the error messages (copied as text instead of images, if possible) and log files. They should be able to provide more in-depth assistance.
If you get an answer that works, though, be sure to post it back here!
-Cam

Asked:

on 2 Dec 2020

Moved:

on 8 Jul 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!