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

Compiled protobufs from custom ROS message throw errors when included in separate ROS package #17

Open
davidsturrock opened this issue Mar 22, 2023 · 1 comment

Comments

@davidsturrock
Copy link

Setup

Ubuntu 20.04
ROS2 Foxy (apt install)
eCal v5.12.0-nightly-26-ga57825bd8 (07.03.2023) (built from source from master branch)
rmw_ecal master
rosidl_typesupport_protobuf master
protoc --version = libprotoc 3.6.1

I've made a ROS2 package with a custom 'Num.msg' ROS message and successfully built it with colcon. In the workspace's install directory I can see the generated proto file and compiled header files.

Including 'num.hpp' in a simple ROS publisher script, I can run
RMW_IMPLEMENTATION=rmw_ecal_dynamic_cpp ros2 run cpp_pubsub talker
And the script works as expected. Running
RMW_IMPLEMENTATION=rmw_ecal_proto_cpp ros2 run cpp_pubsub talker
returns
terminate called after throwing an instance of 'std::runtime_error' what(): Unsupported type support.
I assume this is because I need to include Num.pb.h? However, when I include this in my project, the build fails, due to syntax errors in the pb.h file.

I believe closed #19 may be related.
I have built the two packages in the same workspace and sourced the message package before building the publisher package.
I've also built the latest version of protobuf from source as recommended and the errors still occur.

Is there any updated advice on this issue please?

@FlorianReimold
Copy link
Member

If I recall correctly, the Num.pb.h should be included by the rosidl_typesupport_protobuf. Your own application should only use the standard ros message.
Have you build and sourced the typesupport, before you built your application? To me it sounds like the rosidl_typesupport_protobuf is not sourced correctly. Do other builtin messages work for you? you need to check those out as well and build the typesupport along with the builtin_messages.

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

2 participants