Gazebo does not launch when entering the launch command
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/
Summary
=======
PARAMETERS
* /rosdistro: kinetic
* /rosversion: 1.12.14
NODES
/
gazebo (sjtu_drone/start_gzserver)
spawn_model (sjtu_drone/spawn_model)
auto-starting new master
process[master]: started with pid [4621]
ROS_MASTER_URI=http://localhost:11311
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"?>
<launch>
<!-- 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"/>
</include>
</launch>
And this is the simple.launch connect to main.launch
<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" />
-->
</launch>
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.
Asked by rookietheml on 2019-08-28 03:34:57 UTC
Answers
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)"/>
</include>
Asked by kumpakri on 2019-08-29 07:34:41 UTC
Comments
I got this to work ok. One problem though is that after controlling the drone with the teleop program it sometimes crashes, ending upside-down on the ground. I then find that in Gazebo I cannot rotate it to an upright position. I can't even move it or change its pose through the world/models panel. The drone always snaps back to the same spot. (The teleop progam is terminated at this point btw). It's as if some process still has a hold on the drone. Any idea what the problem might be here?
Asked by robusto on 2020-04-23 08:00:38 UTC
Hi,
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:
#!/bin/sh
#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-
4.0:/usr/share/gazebo_models:$GAZEBO_RESOURCE_PATH
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:
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.
Asked by Duckfrost on 2019-08-29 08:27:21 UTC
Comments
It was quite helpful. But after going through all of this.
... logging to /home/hunter/.ros/log/5b1e9488-edbd-11e9-9914-5800e38ca05f/roslaunch-hunter-Aspire-E5-575-13468.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://hunter-Aspire-E5-575:37315/
SUMMARY
PARAMETERS * /rosdistro: kinetic * /rosversion: 1.12.14
NODES / gazebo (sjtu_drone/start_gzserv
Asked by hunter on 2019-10-13 08:23:19 UTC
Can you please help me
Asked by hunter on 2019-10-13 08:23:48 UTC
auto-starting new master process[master]: started with pid [13478] ROS_MASTER_URI=http://localhost:11311
setting /run_id to 5b1e9488-edbd-11e9-9914-5800e38ca05f process[rosout-1]: started with pid [13492] started core service [/rosout] process[gazebo-2]: started with pid [13503] process[sjtu_drone_spawn_urdf-3]: started with pid [13511] SpawnModel script started [INFO] [1570973316.082966]: Loading model XML from file [INFO] [1570973316.101218]: Waiting for service /gazebo/spawn_sdf_model [INFO]
Asked by hunter on 2019-10-13 08:24:54 UTC
rosrun drone_construct start_simulation_localy.sh ... logging to /home/yogeshwar/.ros/log/3c2afab4-8cee-11ea-a845-34e8948adf8d/roslaunch-yogeshwar-Lenovo-ideapad-330-15IKB-32046.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://yogeshwar-Lenovo-ideapad-330-15IKB:46607/
SUMMARY
PARAMETERS * /rosdistro: kinetic * /rosversion: 1.12.14
NODES / gazebo (sjtu_drone/start_gzserver) sjtu_drone_spawn_urdf (gazebo_ros/spawn_model)
auto-starting new master process[master]: started with pid [32056] ROS_MASTER_URI=http://localhost:11311
setting /run_id to 3c2afab4-8cee-11ea-a845-34e8948adf8d process[rosout-1]: started with pid [32069] started core service [/rosout] process[gazebo-2]: started with pid [32072] process[sjtu_drone_spawn_urdf-3]: started with pid [32078] SpawnModel script started [gazebo-2] process has died [pid 32072, exit code 255, cmd /home/yogeshwar/parrot_ws/src/parrot_ardrone/sjtu_drone/scripts/start_gzserver /home/yogeshwar/parrot_ws/src/parrot_ardrone/drone_construct/worlds/ardrone_igniteworld.world __name:=gazebo __log:=/home/yogeshwar/.ros/log/3c2afab4-8cee-11ea-a845-34e8948adf8d/gazebo-2.log]. log file: /home/yogeshwar/.ros/log/3c2afab4-8cee-11ea-a845-34e8948adf8d/gazebo-2*.log [INFO] [1588476544.626176]: Loading model XML from file [INFO] [1588476544.627679]: Waiting for service /gazebo/spawn_sdf_model
Please help me with this error
Asked by yogiji on 2020-05-02 22:34:35 UTC
Comments