Home | Tutorials | Wiki | Issues
Ask Your Question

Gazebo does not launch when entering the launch command

asked 2019-08-28 03:34:57 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I tried to launch a parrot ar drone locally from ROS development studio. But when I enter the command line in the following, Gazebo does not launch.

$roslaunch drone_construct main.launch

Instead, following message shows up:

... logging to /home/chirantou/.ros/log/ec39ce5c-c963-11e9-9409-84a6c8434f72/roslaunch-chirantou-4610.log
Checking log directory for disk usage. This may take awhile.

Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://chirantou:43771/



 * /rosdistro: kinetic
 * /rosversion: 1.12.14

    gazebo (sjtu_drone/start_gzserver)
    spawn_model (sjtu_drone/spawn_model)

auto-starting new master
process[master]: started with pid [4621]

setting /run_id to ec39ce5c-c963-11e9-9409-84a6c8434f72
process[rosout-1]: started with pid [4634]
started core service [/rosout]
process[gazebo-2]: started with pid [4637]
process[spawn_model-3]: started with pid [4639]
Error opening log file: "/home/chirantou/.gazebo/client-11345/default.log"
Error opening log file: "/home/chirantou/.gazebo/server-11345/gzserver.log"
Error opening log file: "/home/chirantou/.gazebo/server-11345/default.log"
[spawn_model-3] process has finished cleanly
log file: /home/chirantou/.ros/log/ec39ce5c-c963-11e9-9409-84a6c8434f72/spawn_model-3*.log

This is the launch file "main.launch"

<?xml version="1.0"?>
  <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
  <include file="$(find sjtu_drone)/launch/simple.launch">
    <arg name="world_name" value="$(find drone_construct)/worlds/ardrone_igniteworld.world"/>


And this is the simple.launch connect to main.launch

 <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="paused" value="false"/>
  <arg name="use_sim_time" value="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" value="false"/>
  <arg name="debug" value="false"/>
  <arg name="world_name" default="$(find sjtu_drone)/worlds/contest.world"/>

  <!-- start gzserver and load the map -->
  <node name="gazebo" pkg="sjtu_drone" type="start_gzserver" args="$(arg world_name)" respawn="false"/>

  <!-- Spawn simulated quadrotor uav -->
  <node name="spawn_model" pkg="sjtu_drone" type="spawn_model" respawn="false"/>

   <!-- start keyboard control ui
   <node name="drone_keyboard" pkg="sjtu_drone" type="drone_keyboard" /> 


Can anybody tell me why Gazebo is not launch? I have tried launch turtlebot2 and it works, but when I try this parrot ar drone, it doesn't work.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-08-29 08:27:21 -0500

Duckfrost gravatar image


So I worked on solving this issue. It was mainly two problems:

1) The Gazebo client wasnt being launched. Thats because this simulation version is intended for use in ROSDevelopementStudio, so by default the GUI isnt launched for performance reasons. But even if you launched the version that should open the gui, current versions of gazebo just crash, at least in Kinetic Gazebo7.

2) The Environment variables that set up where the models and plugins are in this particular simulation are set outside the ros package system, so this causes other issues, like not appearing the parrot drone mesh or not having any collisions.

All these issues are explained with detail in this video: VIDEO

The repo updated with the solution you can find it here: DRONE CONSTRUCT GIT, kinetic-gazebo7 Branch

You will also need to download this package Spawn_robot_tools: Spawn Robot Tools

To make it work, I created a script called start_simulation_localy.sh inside drone_construct/scripts that sets the local variables correctly and launched the simulation with the GUI enables and the simulation unpaused:


#find where the 'sjtu_drone' is
pack_path=$(rospack find sjtu_drone)

#export the gazebo pathes
export GAZEBO_MODEL_PATH=$pack_path/models:$GAZEBO_MODEL_PATH
export GAZEBO_RESOURCE_PATH=$pack_path:/usr/share/gazebo-3.0:/usr/share/gazebo- 
export GAZEBO_PLUGIN_PATH=$pack_path/plugins:$GAZEBO_PLUGIN_PATH

#call the client of Gazebo
roslaunch drone_construct main.launch gui:=true paused:=false

And the sjtu_drone package has been modified to use a different gazebo launch system to avoid problems localy. This is because the original simulation uses gazebo binaries to launch everything and not gazebo_ros.

So you just have to do the following and it should work:

 mkdir -p ~/parrot_ws/src;cd ~/parrot_ws/src
 git clone https://RDaneelOlivaw@bitbucket.org/theconstructcore/parrot_ardrone.git;cd parrot_ardrone;git checkout kinetic-gazebo7;~/parrot_ws/src
 git clone https://RDaneelOlivaw@bitbucket.org/theconstructcore/spawn_robot_tools.git
 cd ~/parrot_ws
catkin_make;source devel/setup.bash;rospack profile
rosrun drone_construct start_simulation_localy.sh

You should then get something like this:

image description

You can then make the drone take off and land publishing in these topics:

 rostopic pub /drone/takeoff std_msgs/Empty "{}"
 rostopic pub /drone/land std_msgs/Empty "{}"

And then move it around with this ros binary ( go up , stop and down with T , G and B keys. The other keys are the standard keyboard teleop use):

 rosrun teleop_twist_keyboard teleop_twist_keyboard.py

Hope this was usefull.

edit flag offensive delete link more

answered 2019-08-29 07:34:41 -0500

kumpakri gravatar image

updated 2019-08-29 07:36:25 -0500

Use this code to launch your gazebo world

<!-- launch empty_world.launch -->
<include file="$(find gazebo_ros)/launch/empty_world.launch" >
    <arg name="world_name" value="$(arg world_name)"/>
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-08-28 03:34:57 -0500

Seen: 52 times

Last updated: Aug 29