Using google protobuf with fast-dds #2919
Unanswered
samehmohamed88
asked this question in
Q&A
Replies: 2 comments 3 replies
-
According to Protobuf documentation:
If the returned |
Beta Was this translation helpful? Give feedback.
3 replies
-
Using the IDE debugger, I was able to see the value of the serialized string as The problem is as you guys predicted. I'll examine using an |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there an already existing issue for this?
Expected behavior
I am attempting to use Google Protobuf as the message definition and serialization. I have seen an example from Baidu's Apollo CyberRT where they use a kind of UnderlayMessage which is supposed to be a generic type. In the underlay type class they provide the overloads for the
serialize
anddeserialize
required by fast-dds.They populate the underlay message's data string class member with the protobuf::SerializeToString which serializes the protobuf class to a binary represented as string.
The UnderlayMessage is then sent to the subscriber, who then uses
protobuf::ParseFromString
to recover the original message.I was able to implement this successfully when my protobuf message contains
string
orint32
, however using afloat
ordouble
results in the payload data being empty when received by the subscriber.The subscriber:
Using a debugger, I stepped through the desrialize method and the
void* data
that is passed in is empty, whereas when I am using anint32
or astring
in my protobuf class, it received the correct values.Current behavior
Described above
Steps to reproduce
Code supplied above
Fast DDS version/commit
Installed on Ubuntu 20.04 using apt package manager
Platform/Architecture
Ubuntu Focal 20.04 amd64
Transport layer
Shared Memory Transport (SHM)
Additional context
No response
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
Beta Was this translation helpful? Give feedback.
All reactions