Robotics StackExchange | Archived questions

protobuf error for custom messages transport tutorial

I am new to the gazebo software and was working through the transport/custom messages tutorial. I have been able to get the main section of the code working si uit displays the world map. However, when I try to execute the request_publisher code it gives me this error:

[libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: vector2d.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:1018] CHECK failed: generated_database_->Add(encoded_file_descriptor, size): 
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: generated_database_->Add(encoded_file_descriptor, size): 
Aborted (core dumped)

How can I resolve this?

thanks

Tony

Asked by tonylindsay on 2015-06-15 06:21:36 UTC

Comments

Did you find a solution to this? I'm having the same issue.

Asked by GlenH on 2016-12-22 11:49:17 UTC

I am facing the same problem. Please help

Asked by alienmon on 2017-08-19 02:02:28 UTC

Answers

I faced the same problem and finally was able to get it run. Here's how I fixed it:

In the CMakeLists.txt under msgs folder, CHANGE the following code

set (msgs
  collision_map_request.proto
  ${PROTOBUF_IMPORT_DIRS}/vector2d.proto
  ${PROTOBUF_IMPORT_DIRS}/header.proto
  ${PROTOBUF_IMPORT_DIRS}/time.proto
)

to

set (msgs
  collision_map_request.proto
)

Then remake again using cmake ../ and make

Open the map_creator.world file. Under the plugin_filename tag, make sure you specify the absolute path to the library so gazebo knows how to find it, unless the lib is at the same directory with the world. For example, in my case:

<plugin filename="/home/mon/GAZEBO Tutorial/collision_map_creator_plugin/build/libcollision_map_creator.so" name="collision_map_creator"/>

Run the gazebo in --verbose mode, just to make sure no error occurs. Note: Initially, when I ran in verbose mode , it gave me error because the filename specified is just libcollision_map_creator.so but my lib is not at the same dir as my world file, which is as instructed in the tutorial.

Lastly, don't forget to export the environment variable as suggested in the tutorial

export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:collision_map_creator_plugin/build

That works for me

Asked by alienmon on 2017-08-19 02:57:29 UTC

Comments

Yes it works. But I am stuck at "Completed calculations, writing to image". How long does it take to write the image?

Asked by CR7 on 2020-05-31 05:28:39 UTC

I also faced this issue recently. In my case, I was trying to load an SDF generated for Ignition Gazebo in Gazebo Classic. The SDF contained some plugins, and as the plugins were built for Ignition Gazebo, they pulled in different versions of ign-msgs and sdformat than Gazebo Classic uses. This mismatch then lead to the mentioned error and a segfault. To fix it, it's enough to remove the incompatible plugins from the SDF. I assume the same would happen if you'd load a Gazebo Classic SDF in Ignition Gazebo.

Asked by peci1 on 2021-03-04 10:27:27 UTC

Comments