Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

gazebo_ros compilation error caused by conflicting protoc versions (carthographer_ros) #13

Closed
robotman801 opened this issue Apr 9, 2019 · 6 comments
Assignees

Comments

@robotman801
Copy link

robotman801 commented Apr 9, 2019

I am installing gym-gazebo2 following https://github.com/AcutronicRobotics/gym-gazebo2/blob/master/INSTALL.md. The configuration of the computer is Ubuntu 18.04 + ROS2 Crystal. However, it compiled fail when I use 'colcon build --merge-install --packages-skip individual_trajectories_bridge'. The main error is listed below. Could you please tell me where it is wrong? Thanks very much.

In file included from /usr/include/gazebo-9/gazebo/msgs/MessageTypes.hh:59:0,
                 from /usr/include/gazebo-9/gazebo/msgs/msgs.hh:35,
                 from /usr/include/gazebo-9/gazebo/sensors/Sensor.hh:33,
                 from /home/tony/ros2_mara_ws/src/gazebo_ros_pkgs/gazebo_ros/include/gazebo_ros/utils.hpp:20,
                 from /home/tony/ros2_mara_ws/src/gazebo_ros_pkgs/gazebo_ros/src/utils.cpp:15:
/usr/include/gazebo-9/gazebo/msgs/link_data.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-9/gazebo/msgs/link_data.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers.  Please
  ^~~~~
/usr/include/gazebo-9/gazebo/msgs/link_data.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 /usr/include/ignition/msgs1/ignition/msgs/altimeter.pb.h:23:0,
                 from /usr/include/ignition/msgs1/ignition/msgs/MessageTypes.hh:31,
                 from /usr/include/ignition/msgs1/ignition/msgs/Utility.hh:29,
                 from /usr/include/ignition/msgs1/ignition/msgs.hh:25,
                 from /usr/include/ignition/transport4/ignition/transport/Node.hh:32,
                 from /usr/include/gazebo-9/gazebo/physics/Entity.hh:25,
                 from /home/tony/ros2_mara_ws/src/gazebo_ros_pkgs/gazebo_ros/src/gazebo_ros_state.cpp:16:
/usr/local/include/google/protobuf/arenastring.h:225:31: note: candidate: const string& google::protobuf::internal::ArenaStringPtr::GetNoArena() const
   inline const ::std::string& GetNoArena() const { return *ptr_; }
                               ^~~~~~~~~~
/usr/local/include/google/protobuf/arenastring.h:225:31: note:   candidate expects 0 arguments, 1 provided

/usr/local/include/google/protobuf/arenastring.h:225:31: note:   candidate expects 0 arguments, 1 provided
make[2]: *** [CMakeFiles/gazebo_ros_state.dir/src/gazebo_ros_state.cpp.o] Error 1
make[1]: *** [CMakeFiles/gazebo_ros_state.dir/all] Error 2
make[2]: *** [CMakeFiles/gazebo_ros_properties.dir/src/gazebo_ros_properties.cpp.o] Error 1
make[1]: *** [CMakeFiles/gazebo_ros_properties.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< gazebo_ros	[ Exited with code 2 ]
                                   
Summary: 38 packages finished [36.6s]
  1 package failed: gazebo_ros
  1 package had stderr output: gazebo_ros
  5 packages not processed
@robotman801 robotman801 added the bug Something isn't working label Apr 9, 2019
@nzlz
Copy link
Contributor

nzlz commented Apr 9, 2019

Seems like you have different versions of protobuf in your system, which is causing gazebo to have compilation issues. Did you install gazebo using the one lines installation? curl -sSL http://get.gazebosim.org | sh .

Im pretty sure you have installed another version of protobuf via other packages, which overwrites system's protobuf. Check this issue for instance. The solution is to get rid of the manually installed protobuf and try again.

@robotman801
Copy link
Author

Hi, Nestor

I installed the gazebo following the one-liner installation instruction.
The issue should be caused by google-cartographer which I installed a few days ago, following https://google-cartographer-ros.readthedocs.io/en/latest/compilation.html. The new version of protobuf is libprotoc 3.4.0. Do you know how to get rid of the manually installed protobuf? And which version of protobuf I should install? Thanks very much.

@nzlz
Copy link
Contributor

nzlz commented Apr 10, 2019

I'm afraid I can't help much here. You should try the solutions to your problem various users posted in this carthographer_ros issue. If not working, please comment the same problem you are having in that same issue or open a new one.

@nzlz nzlz changed the title gym-gazebo2 compiled fail gazebo_ros compilation error caused by conflicting protoc versions (carthographer_ros) Apr 10, 2019
@nzlz nzlz removed the bug Something isn't working label Apr 10, 2019
@robotman801
Copy link
Author

This issue is solved following this step. The method is tested on Ubuntu 18.04 + ROS2 Crytal

1.Delete the installed protobuf
cd /usr/local/include/google
sudo rm -rf protobuf
2.Recompile cartographer_ros
The cartographer is installed following https://google-cartographer-ros.readthedocs.io/en/latest/compilation.html. Before proceeding the step src/cartographer/scripts/install_proto3.sh, change the VERSION="v3.4.1" to VERSION="v3.0.0". Then do installation normally.

Now the cartographer-ros and gym-gazebo2 all works very well.

@nzlz
Copy link
Contributor

nzlz commented Apr 12, 2019

Closing since not a strictly gym-gazebo2 related issue. Feel free to open a new issue if you encounter different problems.

@nzlz nzlz closed this as completed Apr 12, 2019
@nzlz
Copy link
Contributor

nzlz commented Apr 12, 2019

Did not read the comment where you solved the issue, thanks for sharing @robotman801 !!

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

No branches or pull requests

2 participants