Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR when make posix_sitl_default gazebo #9145

Closed
goodman110110110 opened this issue Mar 23, 2018 · 3 comments
Closed

ERROR when make posix_sitl_default gazebo #9145

goodman110110110 opened this issue Mar 23, 2018 · 3 comments

Comments

@goodman110110110
Copy link

goodman110110110 commented Mar 23, 2018

Hello, my computer is ubuntu 16.04, gazebo 7 and ros kientic.
All works ok but then i installed cartographer.

when I make posix_sitl_default gazebo, it comes some errors as follows:

ghf@ghf-A8SR:/pixhawk1.7.3/Firmware$ make posix_sitl_default gazebo
-- Build Type: RelWithDebInfo
-- PX4 VERSION: v1.7.3
-- CONFIG: posix_sitl_default
-- Build Type: RelWithDebInfo
-- The CXX compiler identification is GNU 5.4.0
-- The C compiler identification is GNU 5.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.12")
-- Found PY_jinja2: /usr/lib/python2.7/dist-packages/jinja2
-- C compiler: cc (Ubuntu 5.4.0-6ubuntu1
16.04.9) 5.4.0 20160609
-- C++ compiler: c++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ghf/pixhawk1.7.3/Firmware/build/posix_sitl_default
[161/572] Performing configure step for 'sitl_gazebo'
-- install-prefix: /usr/local
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- thread
-- signals
-- system
-- filesystem
-- program_options
-- regex
-- iostreams
-- date_time
-- chrono
-- atomic
-- Found Protobuf: /usr/local/lib/libprotobuf.a
-- Boost version: 1.58.0
-- Looking for OGRE...
-- OGRE_PREFIX_WATCH changed.
-- Checking for module 'OGRE'
-- Found OGRE, version 1.9.0
-- 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 OpenCV: /opt/ros/kinetic (found version "3.3.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
-- Found MAVLink: /home/ghf/pixhawk1.7.3/Firmware/mavlink/include (found version "2.0")
-- catkin DISABLED
-- Checking for module 'protobuf'
-- Found protobuf, version 3.4.1
Gazebo version: 7.11
-- 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/ghf/pixhawk1.7.3/Firmware/build/posix_sitl_default/build_gazebo
[568/572] Performing build step for 'sitl_gazebo'
FAILED: cd /home/ghf/pixhawk1.7.3/Firmware/build/posix_sitl_default/build_gazebo && /usr/bin/cmake --build . && /usr/bin/cmake -E touch /home/ghf/pixhawk1.7.3/Firmware/build/posix_sitl_default/external/Stamp/sitl_gazebo/sitl_gazebo-build
[1/60] Running C++ protocol buffer compiler on msgs/sonarSens.proto
[2/60] Running C++ protocol buffer compiler on msgs/MotorSpeed.proto
[3/60] Running C++ protocol buffer compiler on msgs/CommandMotorSpeed.proto
[4/60] Running C++ protocol buffer compiler on msgs/SITLGps.proto
[5/60] Running C++ protocol buffer compiler on msgs/SensorImu.proto
[6/60] Running C++ protocol buffer compiler on msgs/opticalFlow.proto
[7/60] Running C++ protocol buffer compiler on msgs/irlock.proto
[8/60] Running C++ protocol buffer compiler on msgs/Int32.proto
[9/60] Running C++ protocol buffer compiler on msgs/Float.proto
[10/60] Generating /home/ghf/pixhawk1.7.3/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf
[11/60] Running C++ protocol buffer compiler on msgs/Groundtruth.proto
[12/60] Running C++ protocol buffer compiler on msgs/lidar.proto
[13/60] Building CXX object OpticalFlow/klt_feature_tracker/CMakeFiles/klt_feature_tracker.dir/src/trackFeatures.cpp.o
[14/60] Building CXX object CMakeFiles/mav_msgs.dir/SensorImu.pb.cc.o
[15/60] Building CXX object CMakeFiles/mav_msgs.dir/lidar.pb.cc.o
[16/60] Building CXX object CMakeFiles/mav_msgs.dir/opticalFlow.pb.cc.o
[17/60] Building CXX object CMakeFiles/mav_msgs.dir/Groundtruth.pb.cc.o
[18/60] Building CXX object CMakeFiles/mav_msgs.dir/CommandMotorSpeed.pb.cc.o
[19/60] Building CXX object CMakeFiles/mav_msgs.dir/MotorSpeed.pb.cc.o
[20/60] Building CXX object CMakeFiles/mav_msgs.dir/sonarSens.pb.cc.o
[21/60] Building CXX object CMakeFiles/mav_msgs.dir/irlock.pb.cc.o

[22/60] Building CXX object CMakeFiles/mav_msgs.dir/SITLGps.pb.cc.o
[23/60] Building CXX object CMakeFiles/mav_msgs.dir/Float.pb.cc.o
[24/60] Building CXX object CMakeFiles/mav_msgs.dir/Int32.pb.cc.o
FAILED: /usr/bin/c++ -Dmav_msgs_EXPORTS -isystem /usr/include/gazebo-7 -isystem /usr/include/sdformat-4.4 -isystem /usr/include/ignition/math2 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -I/home/ghf/pixhawk1.7.3/Firmware/Tools/sitl_gazebo/include -I/home/ghf/pixhawk1.7.3/Firmware/Tools/sitl_gazebo/external/OpticalFlow/include -I/usr/include/gazebo-7/gazebo/msgs -I/usr/include/eigen3 -isystem /opt/ros/kinetic/include/opencv-3.3.1 -isystem /opt/ros/kinetic/include/opencv-3.3.1/opencv -I. -I/usr/include/eigen3/eigen3 -I/usr/local/include/OGRE -I/usr/local/include/OGRE/Paging -I/home/ghf/pixhawk1.7.3/Firmware/mavlink/include -std=c++11 -std=c++11 -Wno-deprecated-declarations -fPIC -MMD -MT CMakeFiles/mav_msgs.dir/SensorImu.pb.cc.o -MF CMakeFiles/mav_msgs.dir/SensorImu.pb.cc.o.d -o CMakeFiles/mav_msgs.dir/SensorImu.pb.cc.o -c SensorImu.pb.cc
In file included from SensorImu.pb.h:32:0,
from SensorImu.pb.cc:5:
/usr/include/gazebo-7/gazebo/msgs/quaternion.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
/usr/include/gazebo-7/gazebo/msgs/quaternion.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
/usr/include/gazebo-7/gazebo/msgs/quaternion.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
^
In file included from SensorImu.pb.h:33:0,
from SensorImu.pb.cc:5:
/usr/include/gazebo-7/gazebo/msgs/vector3d.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
/usr/include/gazebo-7/gazebo/msgs/vector3d.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
/usr/include/gazebo-7/gazebo/msgs/vector3d.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
^
In file included from SensorImu.pb.cc:5:0:
SensorImu.pb.h: In member function ‘const gazebo::msgs::Quaternion& sensor_msgs::msgs::Imu::orientation() const’:
SensorImu.pb.h:270:8: error: ‘Quaternion_default_instance’ is not a member of ‘gazebo::msgs’
&::gazebo::msgs::Quaternion_default_instance);
^
SensorImu.pb.h: In member function ‘const gazebo::msgs::Vector3d& sensor_msgs::msgs::Imu::angular_velocity() const’:
SensorImu.pb.h:346:8: error: ‘Vector3d_default_instance’ is not a member of ‘gazebo::msgs’
&::gazebo::msgs::Vector3d_default_instance);
^
SensorImu.pb.h: In member function ‘const gazebo::msgs::Vector3d& sensor_msgs::msgs::Imu::linear_acceleration() const’:
SensorImu.pb.h:422:8: error: ‘Vector3d_default_instance’ is not a member of ‘gazebo::msgs’
&::gazebo::msgs::Vector3d_default_instance);
^
SensorImu.pb.cc: In static member function ‘static void sensor_msgs::msgs::protobuf_SensorImu_2eproto::TableStruct::InitDefaultsImpl()’:
SensorImu.pb.cc:104:19: error: ‘gazebo::msgs::protobuf_quaternion_2eproto’ has not been declared
::gazebo::msgs::protobuf_quaternion_2eproto::InitDefaults();
^
SensorImu.pb.cc:105:19: error: ‘gazebo::msgs::protobuf_vector3d_2eproto’ has not been declared
::gazebo::msgs::protobuf_vector3d_2eproto::InitDefaults();
^
SensorImu.pb.cc:109:7: error: ‘internal_default_instance’ is not a member of ‘gazebo::msgs::Quaternion’
::gazebo::msgs::Quaternion::internal_default_instance());
^
SensorImu.pb.cc:111:7: error: ‘internal_default_instance’ is not a member of ‘gazebo::msgs::Vector3d’
::gazebo::msgs::Vector3d::internal_default_instance());
^
SensorImu.pb.cc:113:7: error: ‘internal_default_instance’ is not a member of ‘gazebo::msgs::Vector3d’
::gazebo::msgs::Vector3d::internal_default_instance());
^
SensorImu.pb.cc: In function ‘void sensor_msgs::msgs::protobuf_SensorImu_2eproto::{anonymous}::AddDescriptorsImpl()’:
SensorImu.pb.cc:138:19: error: ‘gazebo::msgs::protobuf_quaternion_2eproto’ has not been declared
::gazebo::msgs::protobuf_quaternion_2eproto::AddDescriptors();
^
SensorImu.pb.cc:139:19: error: ‘gazebo::msgs::protobuf_vector3d_2eproto’ has not been declared
::gazebo::msgs::protobuf_vector3d_2eproto::AddDescriptors();
^
ninja: build stopped: subcommand failed.
[568/572] Linking CXX executable px4
ninja: build stopped: subcommand failed.
Makefile:147: recipe for target 'posix_sitl_default' failed
make: *** [posix_sitl_default] Error 1

I find in the google that the "Gazebo is built against the version of protoc released to the ubuntu repos. On 16.04 that version is 2.6.1." but cartographer need 3.4.1.

How can I use gazebo and cartographer all together. How to solve the problem?
change the version of protobuf?

@dagar
Copy link
Member

dagar commented Mar 23, 2018

I'm not sure how to rectify the version difference. Could you try building newer gazebo with newer protobufs?

@goodman110110110
Copy link
Author

@dagar I have not try build new gazebo with newer protobufs. My gazebo 7 is default of ROS kientic. How to update gazebo?

@lamping7
Copy link
Member

Google is your friend... cartographer-project/cartographer_ros#625
http://answers.gazebosim.org/question/18096/this-file-was-generated-by-an-older-version-of-protoc/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants