Gazebo + SITL setup EPIC FAIL

I went through the whole setup process and fail. I did a bunch of steps more than wiki has.
First, don’t try to setup Gazebo in a VirtualBox, make your life easy and do it in a native Ubuntu 14.04 installation. VM adds a lot of GPU virtualization issues, Gazebo needs OpenGL instructions not supported in VirtualBox 5.0.2 with Guest Addition 5.0.2.
The only way to run, pretty slow but it runs, Gazebo + Ubuntu 14.04 on VirtualBox is installing mesa utils and adding:
apt-get install mesa-utils
export LIBGL_ALWAYS_SOFTWARE=1
And then OpenGL error are gone. Trade off is that Gazebo don’t run with GPU acceleration. :frowning:
After that I follow the Wiki in order to setup catkin workspace for ArduCopter SITL. The issue here was a lot of missing dependencies.
Actually every time I did run catkin_make a new unresolved dependency shows up. At catkin_ws/src I did install bunch more packages and dependencies:
git clone github.com/ethz-asl/mav_comm
git clone github.com/ethz-asl/glog_catkin
git clone github.com/catkin/catkin_simple
git clone github.com/ros-controls/control_toolbox.git
git clone github.com/ros-controls/realtime_tools.git
And then others ROS packages:
sudo apt-get install ros-indigo-octomap
sudo apt-get install ros-indigo-octomap-msgs
sudo apt-get install ros-indigo-octomap-ros
After that If your are lucky catkin_make will work… or not
Other Issue I did found was that alexbuyval/rotors_simulator repo fork adds missing planning_msgs at catkin_make compilation time. In the other hand PX4/rotors_simulator original repo compiles just fine. But there is no quadX450_empty_world.launch in PX4 fork. Well I did try PX4 repo just check out if it compiles. Of course it wont work at run time because of missing adX450_empty_world.

Anyway before I could run simulator… There are a couple of missing steps:
Install pip and then MAVProxy
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
sudo pip install --upgrade pymavlink MAVProxy
Then the wiki says run:
sim_vehicle.sh -f arducopter_sitl_ros --console

But it wont work because on alexbuyval/ardupilot fork there is no auto vehicle detection based on directory in sim_vehicle.sh so you need to run instead:

sim_vehicle.sh -v ArduCopter -f arducopter_sitl_ros --console

So I’m still fighting to get this setup done.

By the way there is a VM image Ubuntu 14.04+ROS Indigo/Gazebo on internet it would be a good starting point for many of you.
nootrix.com/2014/09/ros-indigo-virtual-machine/

Been a while trying… long long time, and then

I did fix missing planning_msgs removing both refrences from rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt
seems those reference were not needed.
Now catkin_male runs up to 73% then compilation FAILS, error message:
/home/viki/catkin_ws/src/rotors_simulator/rotors_gazebo/src/waypoint_publisher.cpp:24:40: fatal error: mav_msgs/CommandTrajectory.h: No such file or directory
#include <mav_msgs/CommandTrajectory.h>

Seems like alexbuyval’s mav_comm version is different from github.com/ethz-asl/mav_comm
Mar 19 they renamed CommandTrajectory to CommandTrajectoryPositionYaw at pull #14
github.com/ethz-asl/mav_comm/pull/14
I did try downgrade ethz-asl/mav_comm to v1.0.0 where CommandTrajectory wasn’t changed yet… but it triggers a new set of compilation fails.
So I give up… I need alexbuyval’s mav_comm in order to continue
So many hours trying… :frowning:

1 Like

Well, I did clean catkin_ws, fresh start from 0

After some git cloning, got this content at catkin_src

drwxrwxr-x 5 viki viki 4096 Aug 30 10:31 arducopter_sitl_ros
drwxrwxr-x 11 viki viki 4096 Aug 30 10:32 ar_track_alvar
drwxrwxr-x 4 viki viki 4096 Aug 30 10:39 ar_track_alvar_msgs
drwxrwxr-x 5 viki viki 4096 Aug 30 10:38 catkin_simple
lrwxrwxrwx 1 viki viki 49 Aug 30 10:26 CMakeLists.txt -> /opt/ros/indigo/share/catkin/cmake/toplevel.cmake
drwxrwxr-x 5 viki viki 4096 Aug 30 10:37 glog_catkin
drwxrwxr-x 5 viki viki 4096 Aug 30 10:37 mav_comm
drwxrwxr-x 7 viki viki 4096 Aug 30 10:32 mavros
drwxrwxr-x 10 viki viki 4096 Aug 30 10:31 rotors_simulator

Running catkin_camke I got:

viki@c3po:~/catkin_ws$ catkin_make
Base path: /home/viki/catkin_ws
Source space: /home/viki/catkin_ws/src
Build space: /home/viki/catkin_ws/build
Devel space: /home/viki/catkin_ws/devel
Install space: /home/viki/catkin_ws/install

Running command: “make cmake_check_build_system” in “/home/viki/catkin_ws/build”

– Using CATKIN_DEVEL_PREFIX: /home/viki/catkin_ws/devel
– Using CMAKE_PREFIX_PATH: /opt/ros/indigo
– This workspace overlays: /opt/ros/indigo
– Using PYTHON_EXECUTABLE: /usr/bin/python
– Using Debian Python package layout
– Using empy: /usr/bin/empy
– Using CATKIN_ENABLE_TESTING: ON
– Call enable_testing()
– Using CATKIN_TEST_RESULTS_DIR: /home/viki/catkin_ws/build/test_results
– Found gtest sources under ‘/usr/src/gtest’: gtests will be built
– Using Python nosetests: /usr/bin/nosetests-2.7
– catkin 0.6.9
– BUILD_SHARED_LIBS is on
– ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
– ~~ traversing 18 packages in topological order:
– ~~ - catkin_simple
– ~~ - glog_catkin
– ~~ - mav_comm (metapackage)
– ~~ - libmavconn
– ~~ - rotors_description
– ~~ - rotors_model
– ~~ - rotors_simulator (metapackage)
– ~~ - ar_track_alvar_msgs
– ~~ - mav_msgs
– ~~ - arducopter_sitl_ros
– ~~ - rotors_control
– ~~ - rotors_joy_interface
– ~~ - mavros
– ~~ - mavros_extras
– ~~ - ar_track_alvar
– ~~ - rotors_gazebo_plugins
– ~~ - test_mavros
– ~~ - rotors_gazebo
– ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
– +++ processing catkin package: ‘catkin_simple’
– ==> add_subdirectory(catkin_simple)
– +++ processing catkin package: ‘glog_catkin’
– ==> add_subdirectory(glog_catkin)
– Marking SHARED_LIBRARY “glog_catkin” of package “glog_catkin” for installation
– +++ processing catkin metapackage: ‘mav_comm’
– ==> add_subdirectory(mav_comm/mav_comm)
– +++ processing catkin package: ‘libmavconn’
– ==> add_subdirectory(mavros/libmavconn)
– Boost version: 1.54.0
– Found the following Boost libraries:
– system
– Selected MAVLink dialect: ardupilotmega
– +++ processing catkin package: ‘rotors_description’
– ==> add_subdirectory(rotors_simulator/rotors_description)
– +++ processing catkin package: ‘rotors_model’
– ==> add_subdirectory(rotors_simulator/rotors_model)
– Eigen found (include: /usr/include/eigen3)
– +++ processing catkin metapackage: ‘rotors_simulator’
– ==> add_subdirectory(rotors_simulator/rotors_simulator)
– +++ processing catkin package: ‘ar_track_alvar_msgs’
– ==> add_subdirectory(ar_track_alvar_msgs)
– Using these message generators: gencpp;genlisp;genpy
– ar_track_alvar_msgs: 2 messages, 0 services
– +++ processing catkin package: ‘mav_msgs’
– ==> add_subdirectory(mav_comm/mav_msgs)
– Using these message generators: gencpp;genlisp;genpy
– Eigen found (include: /usr/include/eigen3)
– mav_msgs: 6 messages, 0 services
– +++ processing catkin package: ‘arducopter_sitl_ros’
– ==> add_subdirectory(arducopter_sitl_ros)
– +++ processing catkin package: ‘rotors_control’
– ==> add_subdirectory(rotors_simulator/rotors_control)
– Eigen found (include: /usr/include/eigen3)
– +++ processing catkin package: ‘rotors_joy_interface’
– ==> add_subdirectory(rotors_simulator/rotors_joy_interface)
– +++ processing catkin package: ‘mavros’
– ==> add_subdirectory(mavros/mavros)
– Using these message generators: gencpp;genlisp;genpy
– Boost version: 1.54.0
– Found the following Boost libraries:
– system
– Selected MAVLink dialect: ardupilotmega
– mavros: 12 messages, 27 services
– +++ processing catkin package: ‘mavros_extras’
– ==> add_subdirectory(mavros/mavros_extras)
– Using these message generators: gencpp;genlisp;genpy
– Selected MAVLink dialect: ardupilotmega
– mavros_extras: 2 messages, 0 services
– +++ processing catkin package: ‘ar_track_alvar’
– ==> add_subdirectory(ar_track_alvar)
– Using these message generators: gencpp;genlisp;genpy
– Eigen found (include: /usr/include/eigen3)
– +++ processing catkin package: ‘rotors_gazebo_plugins’
– ==> add_subdirectory(rotors_simulator/rotors_gazebo_plugins)
– Using these message generators: gencpp;genlisp;genpy
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:75 (find_package):
Could not find a package configuration file provided by "planning_msgs"
with any of the following names:

planning_msgsConfig.cmake
planning_msgs-config.cmake

Add the installation prefix of “planning_msgs” to CMAKE_PREFIX_PATH or set
"planning_msgs_DIR" to a directory containing one of the above files. If
"planning_msgs" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt:6 (find_package)

– Configuring incomplete, errors occurred!
See also “/home/viki/catkin_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/viki/catkin_ws/build/CMakeFiles/CMakeError.log”.
make: *** [cmake_check_build_system] Error 1
Invoking “make cmake_check_build_system” failed

FIXED!

Fix 1 - missing package planning_msgs
just remove any reference to planning_msgs from CMakeLists.txt and package.xml at rotors_simulator/rotors_gazebo_plugins/

Fix 2
Downgrade mav_comm to commit #13, just before #14 where they renamed CommandTrajectory to CommandTrajectoryPositionYaw

cd ~/catkin_ws/src/mav_comm
git reset --hard bf0bd59cad52ce31a3c1c48e37c0d350fe41c0bf

Then catkin_make runs without errors.

NEW ISSUE
When I run
sim_vehicle.sh -v ArduCopter -f arducopter_sitl_ros --console

X term shows up an error. See image.