Hi,
I cloned the PX4 Firmware v1.7.3.
I am able to launch the jmavsim simulator with the command "make posix_sitl_default jmavsim" and it works fine.
If I run gazebo it's working fine on its own.
My gazebo version is Gazebo9 and I m working on ubuntu 16.04LTS
But when I run the command "make posix_sitl_default gazebo" I get the following error log:
[1/1] Re-running CMake...
-- Build Type: RelWithDebInfo
-- PX4 VERSION: v1.7.3
-- CONFIG: posix_sitl_default
-- Build Type: RelWithDebInfo
-- C compiler: cc (Ubuntu 5.4.0-6ubuntu116.04.9) 5.4.0 20160609
-- C++ compiler: c++ (Ubuntu 5.4.0-6ubuntu116.04.9) 5.4.0 20160609
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/build/posix_sitl_default
[7/18] Performing configure step for 'sitl_gazebo'
-- install-prefix: /usr/local
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- thread
-- signals
-- system
-- filesystem
-- program_options
-- regex
-- iostreams
-- date_time
-- chrono
-- atomic
-- Boost version: 1.58.0
-- Looking for OGRE...
-- Found Ogre Ghadamon (1.9.0)
-- Found OGRE: optimized;/usr/lib/x86_64-linux-gnu/libOgreMain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreMain.so
-- Looking for OGRE_Paging...
-- Found OGRE_Paging: optimized;/usr/lib/x86_64-linux-gnu/libOgrePaging.so;debug;/usr/lib/x86_64-linux-gnu/libOgrePaging.so
-- Looking for OGRE_Terrain...
-- Found OGRE_Terrain: optimized;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so
-- Looking for OGRE_Property...
-- Found OGRE_Property: optimized;/usr/lib/x86_64-linux-gnu/libOgreProperty.so;debug;/usr/lib/x86_64-linux-gnu/libOgreProperty.so
-- Looking for OGRE_RTShaderSystem...
-- Found OGRE_RTShaderSystem: optimized;/usr/lib/x86_64-linux-gnu/libOgreRTShaderSystem.so;debug;/usr/lib/x86_64-linux-gnu/libOgreRTShaderSystem.so
-- Looking for OGRE_Volume...
-- Found OGRE_Volume: optimized;/usr/lib/x86_64-linux-gnu/libOgreVolume.so;debug;/usr/lib/x86_64-linux-gnu/libOgreVolume.so
-- Looking for OGRE_Overlay...
-- Found OGRE_Overlay: optimized;/usr/lib/x86_64-linux-gnu/libOgreOverlay.so;debug;/usr/lib/x86_64-linux-gnu/libOgreOverlay.so
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so (Required is at least version "2.3.0")
-- Config-file not installed for ZeroMQ -- checking for pkg-config
-- Checking for module 'libzmq >= 4'
-- Found libzmq , version 4.1.4
-- Checking for module 'uuid'
-- Found uuid, version 2.27.0
-- Checking for module 'tinyxml2'
-- Found tinyxml2, version 2.2.0
-- Looking for dlfcn.h - found
-- Looking for libdl - found
-- FreeImage.pc not found, we will search for FreeImage_INCLUDE_DIRS and FreeImage_LIBRARIES
-- Checking for module 'gts'
-- Found gts, version 0.7.6
-- Checking for module 'libswscale'
-- Found libswscale, version 3.1.101
-- Checking for module 'libavdevice >= 56.4.100'
-- Found libavdevice , version 56.4.100
-- Checking for module 'libavformat'
-- Found libavformat, version 56.40.101
-- Checking for module 'libavcodec'
-- Found libavcodec, version 56.60.100
-- Checking for module 'libavutil'
-- Found libavutil, version 54.31.100
-- Checking for module 'jsoncpp'
-- Found jsoncpp, version 1.7.2
-- Checking for module 'yaml-0.1'
-- Found yaml-0.1, version 0.1.6
-- Checking for module 'libzip'
-- Found libzip, version 1.0.1
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- system
-- thread
-- timer
-- chrono
-- date_time
-- atomic
-- Building klt_feature_tracker without catkin
-- Building OpticalFlow with OpenCV
-- catkin DISABLED
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so
Gazebo version: 9.0
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- system
-- thread
-- timer
-- chrono
-- date_time
-- atomic
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/build/posix_sitl_default/build_gazebo
[15/18] Performing build step for 'sitl_gazebo'
FAILED: cd /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/build/posix_sitl_default/build_gazebo && /usr/bin/cmake --build . && /usr/bin/cmake -E touch /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/build/posix_sitl_default/external/Stamp/sitl_gazebo/sitl_gazebo-build
[1/25] Building CXX object CMakeFiles/gazebo_lidar_plugin.dir/src/gazebo_lidar_plugin.cpp.o
[2/25] Building CXX object CMakeFiles/rotors_gazebo_multirotor_base_plugin.dir/src/gazebo_multirotor_base_plugin.cpp.o
[3/25] Building CXX object CMakeFiles/rotors_gazebo_mavlink_interface.dir/src/gazebo_mavlink_interface.cpp.o
[4/25] Building CXX object CMakeFiles/rotors_gazebo_imu_plugin.dir/src/gazebo_imu_plugin.cpp.o
[5/25] Building CXX object CMakeFiles/rotors_gazebo_controller_interface.dir/src/gazebo_controller_interface.cpp.o
[6/25] Building CXX object CMakeFiles/rotors_gazebo_gimbal_controller_plugin.dir/src/gazebo_gimbal_controller_plugin.cpp.o
FAILED: /usr/bin/c++ -DLIBBULLET_VERSION=2.83 -DLIBBULLET_VERSION_GT_282 -Drotors_gazebo_mavlink_interface_EXPORTS -I/usr/include/opencv -isystem /usr/include/gazebo-9 -isystem /usr/include/bullet -isystem /usr/include/simbody -isystem /usr/include/sdformat-6.0 -isystem /usr/include/ignition/math4 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/ignition/transport4 -isystem /usr/include/ignition/msgs1 -isystem /usr/include/ignition/common1 -isystem /usr/include/ignition/fuel_tools1 -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/external/OpticalFlow/include -I/usr/include/gazebo-9/gazebo/msgs -I/usr/include/eigen3 -I. -I/usr/include/eigen3/eigen3 -I/usr/local/include/OGRE -I/usr/local/include/OGRE/Paging -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/mavlink/include -isystem /usr/include/uuid -isystem /usr/include/x86_64-linux-gnu -std=c++11 -std=c++11 -Wno-deprecated-declarations -fPIC -I/usr/include/uuid -I/usr/include/x86_64-linux-gnu -std=gnu++14 -MMD -MT CMakeFiles/rotors_gazebo_mavlink_interface.dir/src/gazebo_mavlink_interface.cpp.o -MF CMakeFiles/rotors_gazebo_mavlink_interface.dir/src/gazebo_mavlink_interface.cpp.o.d -o CMakeFiles/rotors_gazebo_mavlink_interface.dir/src/gazebo_mavlink_interface.cpp.o -c /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_mavlink_interface.cpp
In file included from /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_mavlink_interface.cpp:22:0:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/gazebo_mavlink_interface.h:35:34: fatal error: gazebo/math/Vector3.hh: No such file or directory
compilation terminated.
FAILED: /usr/bin/c++ -DLIBBULLET_VERSION=2.83 -DLIBBULLET_VERSION_GT_282 -Drotors_gazebo_multirotor_base_plugin_EXPORTS -I/usr/include/opencv -isystem /usr/include/gazebo-9 -isystem /usr/include/bullet -isystem /usr/include/simbody -isystem /usr/include/sdformat-6.0 -isystem /usr/include/ignition/math4 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/ignition/transport4 -isystem /usr/include/ignition/msgs1 -isystem /usr/include/ignition/common1 -isystem /usr/include/ignition/fuel_tools1 -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/external/OpticalFlow/include -I/usr/include/gazebo-9/gazebo/msgs -I/usr/include/eigen3 -I. -I/usr/include/eigen3/eigen3 -I/usr/local/include/OGRE -I/usr/local/include/OGRE/Paging -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/mavlink/include -isystem /usr/include/uuid -isystem /usr/include/x86_64-linux-gnu -std=c++11 -std=c++11 -Wno-deprecated-declarations -fPIC -I/usr/include/uuid -I/usr/include/x86_64-linux-gnu -std=gnu++14 -MMD -MT CMakeFiles/rotors_gazebo_multirotor_base_plugin.dir/src/gazebo_multirotor_base_plugin.cpp.o -MF CMakeFiles/rotors_gazebo_multirotor_base_plugin.dir/src/gazebo_multirotor_base_plugin.cpp.o.d -o CMakeFiles/rotors_gazebo_multirotor_base_plugin.dir/src/gazebo_multirotor_base_plugin.cpp.o -c /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_multirotor_base_plugin.cpp
In file included from /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_multirotor_base_plugin.cpp:21:0:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/gazebo_multirotor_base_plugin.h:31:34: fatal error: gazebo/math/Vector3.hh: No such file or directory
compilation terminated.
FAILED: /usr/bin/c++ -DLIBBULLET_VERSION=2.83 -DLIBBULLET_VERSION_GT_282 -Drotors_gazebo_gimbal_controller_plugin_EXPORTS -I/usr/include/opencv -isystem /usr/include/gazebo-9 -isystem /usr/include/bullet -isystem /usr/include/simbody -isystem /usr/include/sdformat-6.0 -isystem /usr/include/ignition/math4 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/ignition/transport4 -isystem /usr/include/ignition/msgs1 -isystem /usr/include/ignition/common1 -isystem /usr/include/ignition/fuel_tools1 -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/external/OpticalFlow/include -I/usr/include/gazebo-9/gazebo/msgs -I/usr/include/eigen3 -I. -I/usr/include/eigen3/eigen3 -I/usr/local/include/OGRE -I/usr/local/include/OGRE/Paging -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/mavlink/include -isystem /usr/include/uuid -isystem /usr/include/x86_64-linux-gnu -std=c++11 -std=c++11 -Wno-deprecated-declarations -fPIC -I/usr/include/uuid -I/usr/include/x86_64-linux-gnu -std=gnu++14 -MMD -MT CMakeFiles/rotors_gazebo_gimbal_controller_plugin.dir/src/gazebo_gimbal_controller_plugin.cpp.o -MF CMakeFiles/rotors_gazebo_gimbal_controller_plugin.dir/src/gazebo_gimbal_controller_plugin.cpp.o.d -o CMakeFiles/rotors_gazebo_gimbal_controller_plugin.dir/src/gazebo_gimbal_controller_plugin.cpp.o -c /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp: In member function ‘virtual void gazebo::GimbalControllerPlugin::Init()’:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:139:45: error: ‘class gazebo::physics::World’ has no member named ‘GetName’
this->node->Init(this->model->GetWorld()->GetName());
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:141:51: error: ‘class gazebo::physics::World’ has no member named ‘GetSimTime’
this->lastUpdateTime = this->model->GetWorld()->GetSimTime();
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp: In member function ‘void gazebo::GimbalControllerPlugin::OnUpdate()’:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:283:48: error: ‘class gazebo::physics::World’ has no member named ‘GetSimTime’
common::Time time = this->model->GetWorld()->GetSimTime();
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:306:29: error: ‘class gazebo::physics::Joint’ has no member named ‘GetUpperLimit’
rDirthis->rollJoint->GetUpperLimit(0).Radian(),
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:307:26: error: ‘class gazebo::physics::Joint’ has no member named ‘GetLowerLimit’
rDirthis->rollJoint->GetLowerLimit(0).Radian());
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:309:30: error: ‘class gazebo::physics::Joint’ has no member named ‘GetUpperLimit’
pDirthis->pitchJoint->GetUpperLimit(0).Radian(),
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:310:30: error: ‘class gazebo::physics::Joint’ has no member named ‘GetLowerLimit’
pDirthis->pitchJoint->GetLowerLimit(0).Radian());
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:312:28: error: ‘class gazebo::physics::Joint’ has no member named ‘GetLowerLimit’
yDirthis->yawJoint->GetLowerLimit(0).Radian(),
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:313:25: error: ‘class gazebo::physics::Joint’ has no member named ‘GetUpperLimit’
yDirthis->yawJoint->GetUpperLimit(0).Radian());
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:331:31: error: ‘class gazebo::physics::Joint’ has no member named ‘GetLowerLimit’
(pDirthis->pitchJoint->GetLowerLimit(0).Radian(),
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:332:30: error: ‘class gazebo::physics::Joint’ has no member named ‘GetLowerLimit’
rDirthis->rollJoint->GetLowerLimit(0).Radian(),
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:333:29: error: ‘class gazebo::physics::Joint’ has no member named ‘GetLowerLimit’
yDirthis->yawJoint->GetLowerLimit(0).Radian());
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:335:31: error: ‘class gazebo::physics::Joint’ has no member named ‘GetUpperLimit’
(pDirthis->pitchJoint->GetUpperLimit(0).Radian(),
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:336:30: error: ‘class gazebo::physics::Joint’ has no member named ‘GetUpperLimit’
rDirthis->rollJoint->GetUpperLimit(0).Radian(),
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:337:29: error: ‘class gazebo::physics::Joint’ has no member named ‘GetUpperLimit’
yDirthis->yawJoint->GetUpperLimit(0).Radian());
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:436:29: error: ‘class gazebo::physics::Joint’ has no member named ‘GetAngle’
ss << this->pitchJoint->GetAngle(0).Radian();
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:440:28: error: ‘class gazebo::physics::Joint’ has no member named ‘GetAngle’
ss << this->rollJoint->GetAngle(0).Radian();
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:444:27: error: ‘class gazebo::physics::Joint’ has no member named ‘GetAngle’
ss << this->yawJoint->GetAngle(0).Radian();
^
FAILED: /usr/bin/c++ -DLIBBULLET_VERSION=2.83 -DLIBBULLET_VERSION_GT_282 -Dgazebo_lidar_plugin_EXPORTS -I/usr/include/opencv -isystem /usr/include/gazebo-9 -isystem /usr/include/bullet -isystem /usr/include/simbody -isystem /usr/include/sdformat-6.0 -isystem /usr/include/ignition/math4 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/ignition/transport4 -isystem /usr/include/ignition/msgs1 -isystem /usr/include/ignition/common1 -isystem /usr/include/ignition/fuel_tools1 -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/external/OpticalFlow/include -I/usr/include/gazebo-9/gazebo/msgs -I/usr/include/eigen3 -I. -I/usr/include/eigen3/eigen3 -I/usr/local/include/OGRE -I/usr/local/include/OGRE/Paging -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/mavlink/include -isystem /usr/include/uuid -isystem /usr/include/x86_64-linux-gnu -std=c++11 -std=c++11 -Wno-deprecated-declarations -fPIC -I/usr/include/uuid -I/usr/include/x86_64-linux-gnu -std=gnu++14 -MMD -MT CMakeFiles/gazebo_lidar_plugin.dir/src/gazebo_lidar_plugin.cpp.o -MF CMakeFiles/gazebo_lidar_plugin.dir/src/gazebo_lidar_plugin.cpp.o.d -o CMakeFiles/gazebo_lidar_plugin.dir/src/gazebo_lidar_plugin.cpp.o -c /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_lidar_plugin.cpp
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_lidar_plugin.cpp: In destructor ‘virtual gazebo::RayPlugin::~RayPlugin()’:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_lidar_plugin.cpp:54:37: error: ‘class gazebo::physics::MultiRayShape’ has no member named ‘DisconnectNewLaserScans’
this->parentSensor->LaserShape()->DisconnectNewLaserScans(
^
FAILED: /usr/bin/c++ -DLIBBULLET_VERSION=2.83 -DLIBBULLET_VERSION_GT_282 -Drotors_gazebo_controller_interface_EXPORTS -I/usr/include/opencv -isystem /usr/include/gazebo-9 -isystem /usr/include/bullet -isystem /usr/include/simbody -isystem /usr/include/sdformat-6.0 -isystem /usr/include/ignition/math4 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/ignition/transport4 -isystem /usr/include/ignition/msgs1 -isystem /usr/include/ignition/common1 -isystem /usr/include/ignition/fuel_tools1 -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/external/OpticalFlow/include -I/usr/include/gazebo-9/gazebo/msgs -I/usr/include/eigen3 -I. -I/usr/include/eigen3/eigen3 -I/usr/local/include/OGRE -I/usr/local/include/OGRE/Paging -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/mavlink/include -isystem /usr/include/uuid -isystem /usr/include/x86_64-linux-gnu -std=c++11 -std=c++11 -Wno-deprecated-declarations -fPIC -I/usr/include/uuid -I/usr/include/x86_64-linux-gnu -std=gnu++14 -MMD -MT CMakeFiles/rotors_gazebo_controller_interface.dir/src/gazebo_controller_interface.cpp.o -MF CMakeFiles/rotors_gazebo_controller_interface.dir/src/gazebo_controller_interface.cpp.o.d -o CMakeFiles/rotors_gazebo_controller_interface.dir/src/gazebo_controller_interface.cpp.o -c /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_controller_interface.cpp
In file included from /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/gazebo_controller_interface.h:35:0,
from /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_controller_interface.cpp:22:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/common.h:55:28: error: ‘math’ does not name a type
double GetDegrees360(const math::Angle& angle) {
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/common.h:55:39: error: expected unqualified-id before ‘&’ token
double GetDegrees360(const math::Angle& angle) {
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/common.h:55:39: error: expected ‘)’ before ‘&’ token
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/common.h:55:41: error: expected initializer before ‘angle’
double GetDegrees360(const math::Angle& angle) {
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_controller_interface.cpp: In destructor ‘virtual gazebo::GazeboControllerInterface::~GazeboControllerInterface()’:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_controller_interface.cpp:27:3: error: ‘DisconnectWorldUpdateBegin’ is not a member of ‘gazebo::event::Events’
event::Events::DisconnectWorldUpdateBegin(updateConnection_);
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_controller_interface.cpp: In member function ‘void gazebo::GazeboControllerInterface::OnUpdate(const gazebo::common::UpdateInfo&)’:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_controller_interface.cpp:69:30: error: ‘class gazebo::physics::World’ has no member named ‘GetSimTime’
common::Time now = world_->GetSimTime();
^
FAILED: /usr/bin/c++ -DLIBBULLET_VERSION=2.83 -DLIBBULLET_VERSION_GT_282 -Drotors_gazebo_imu_plugin_EXPORTS -I/usr/include/opencv -isystem /usr/include/gazebo-9 -isystem /usr/include/bullet -isystem /usr/include/simbody -isystem /usr/include/sdformat-6.0 -isystem /usr/include/ignition/math4 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/ignition/transport4 -isystem /usr/include/ignition/msgs1 -isystem /usr/include/ignition/common1 -isystem /usr/include/ignition/fuel_tools1 -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/external/OpticalFlow/include -I/usr/include/gazebo-9/gazebo/msgs -I/usr/include/eigen3 -I. -I/usr/include/eigen3/eigen3 -I/usr/local/include/OGRE -I/usr/local/include/OGRE/Paging -I/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/mavlink/include -isystem /usr/include/uuid -isystem /usr/include/x86_64-linux-gnu -std=c++11 -std=c++11 -Wno-deprecated-declarations -fPIC -I/usr/include/uuid -I/usr/include/x86_64-linux-gnu -std=gnu++14 -MMD -MT CMakeFiles/rotors_gazebo_imu_plugin.dir/src/gazebo_imu_plugin.cpp.o -MF CMakeFiles/rotors_gazebo_imu_plugin.dir/src/gazebo_imu_plugin.cpp.o.d -o CMakeFiles/rotors_gazebo_imu_plugin.dir/src/gazebo_imu_plugin.cpp.o -c /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp
In file included from /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/gazebo_imu_plugin.h:32:0,
from /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:21:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/common.h:55:28: error: ‘math’ does not name a type
double GetDegrees360(const math::Angle& angle) {
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/common.h:55:39: error: expected unqualified-id before ‘&’ token
double GetDegrees360(const math::Angle& angle) {
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/common.h:55:39: error: expected ‘)’ before ‘&’ token
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/common.h:55:41: error: expected initializer before ‘angle’
double GetDegrees360(const math::Angle& angle) {
^
In file included from /home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:21:0:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/gazebo_imu_plugin.h:140:3: error: ‘math’ does not name a type
math::Vector3 gravity_W_;
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/include/gazebo_imu_plugin.h:141:3: error: ‘math’ does not name a type
math::Vector3 velocity_prev_W_;
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp: In constructor ‘gazebo::GazeboImuPlugin::GazeboImuPlugin()’:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:34:7: error: class ‘gazebo::GazeboImuPlugin’ does not have any field named ‘velocity_prev_W_’
velocity_prev_W_(0,0,0)
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp: In destructor ‘virtual gazebo::GazeboImuPlugin::~GazeboImuPlugin()’:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:39:3: error: ‘DisconnectWorldUpdateBegin’ is not a member of ‘gazebo::event::Events’
event::Events::DisconnectWorldUpdateBegin(updateConnection_);
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp: In member function ‘virtual void gazebo::GazeboImuPlugin::Load(gazebo::physics::ModelPtr, sdf::ElementPtr)’:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:97:24: error: ‘class gazebo::physics::World’ has no member named ‘GetSimTime’
last_time_ = world_->GetSimTime();
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:164:3: error: ‘gravity_W_’ was not declared in this scope
gravity_W_ = world_->GetPhysicsEngine()->GetGravity();
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:164:24: error: ‘class gazebo::physics::World’ has no member named ‘GetPhysicsEngine’
gravity_W_ = world_->GetPhysicsEngine()->GetGravity();
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp: In member function ‘void gazebo::GazeboImuPlugin::OnUpdate(const gazebo::common::UpdateInfo&)’:
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:241:40: error: ‘class gazebo::physics::World’ has no member named ‘GetSimTime’
common::Time current_time = world_->GetSimTime();
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:246:3: error: ‘math’ has not been declared
math::Pose T_W_I = link_->GetWorldPose(); //TODO(burrimi): Check tf.
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:247:3: error: ‘math’ has not been declared
math::Quaternion C_W_I = T_W_I.rot;
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:251:22: error: ‘C_W_I’ was not declared in this scope
orientation->set_x(C_W_I.x);
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:274:3: error: ‘math’ has not been declared
math::Vector3 acceleration_I = link_->GetRelativeLinearAccel() - C_W_I.RotateVectorReverse(gravity_W_);
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:277:3: error: ‘math’ has not been declared
math::Vector3 angular_vel_I = link_->GetRelativeAngularVel();
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:279:41: error: ‘acceleration_I’ was not declared in this scope
Eigen::Vector3d linear_acceleration_I(acceleration_I.x,
^
/home/alexcherpi/Documents/GIT_PolyDrones/polydrones_px4/Tools/sitl_gazebo/src/gazebo_imu_plugin.cpp:282:38: error: ‘angular_vel_I’ was not declared in this scope
Eigen::Vector3d angular_velocity_I(angular_vel_I.x,
^
ninja: build stopped: subcommand failed.
ninja: build stopped: subcommand failed.
Makefile:147: recipe for target 'posix_sitl_default' failed
make: * [posix_sitl_default] Error 1
Do you know what's wrong ?
I solved my issue.
I removed gazebo using:
sudo apt-get remove '.gazebo.' '.sdformat.' '.ignition-math.' '.ignition-msgs.' '.ignition-transport.'
Then I installed ros-kinetic-desktop-full using:
sudo apt-get install ros-kinetic-desktop-full
Then I ran the bash script from px4 dev guide:
ubuntu_sim_ros_gazebo.sh
And then I was able to launch the px4-gazebo simulation:
make posix_sitl_ekf2 gazebo
Even if it s not the the ROS version. Now my gazebo version is Gazebo version 7.12.0 (before version 9) which maybe solved my issue.
And I am also able to launch px4-ros-gazebo simulation:
roslaunch px4 posix_sitl.launch
@alexcherpi With respect to your original Gazebo 9 installation, did you use a script to install that too? Ie the one linked from here: https://dev.px4.io/en/setup/dev_env_linux.html#jmavsimgazebo-simulation
(I tested that recently and it worked).
Just FYI, the other script installs ROS kinetic. ROS kinetic includes Gazebo 7 by default - when ROS update, so will we :-)
@hamishwillee Yeah the Gazebo version 9 comes with the script ubuntu_sim.sh you mentioned. Gazebo 7 comes with the ros version ubuntu_sim_ros_gazebo.sh. The issue with me (shown in the my previous comment in this issue) was with Gazebo 9. But maybe I an isolated case.
@alexcherpi Thank you. I suspect that the fixes that enabled support for Gazebo 9 came in after v1.7.3. I tested them on master.
Most helpful comment
I solved my issue.
I removed gazebo using:
sudo apt-get remove '.gazebo.' '.sdformat.' '.ignition-math.' '.ignition-msgs.' '.ignition-transport.'
Then I installed ros-kinetic-desktop-full using:
sudo apt-get install ros-kinetic-desktop-full
Then I ran the bash script from px4 dev guide:
ubuntu_sim_ros_gazebo.sh
And then I was able to launch the px4-gazebo simulation:
make posix_sitl_ekf2 gazebo
Even if it s not the the ROS version. Now my gazebo version is Gazebo version 7.12.0 (before version 9) which maybe solved my issue.
And I am also able to launch px4-ros-gazebo simulation:
roslaunch px4 posix_sitl.launch