eclipse-ecal / ecal

📦 eCAL - enhanced Communication Abstraction Layer. A high performance publish-subscribe, client-server cross-plattform middleware.
https://ecal.io
Apache License 2.0
842 stars 174 forks source link

When I import other proto files in the proto file and publish the data, the monitor will report the following error #978

Closed jiejieTop closed 1 year ago

jiejieTop commented 1 year ago

Problem Description

When I import other proto files in the proto file and publish the data, the monitor will report the following error:

image

image

my image proto:

syntax = "proto3";
package eon.proto.sensor;

import "eon/proto/common.proto";

message Image 
{
  eon.proto.common.Header header = 1;

   ... 
}

my common.proto file, using import public "xxx.proto";,this can't work

syntax = "proto3";
package eon.proto.common;

import public "header.proto";   // public

When I write directly in the image proto file like this, can work

syntax = "proto3";
package eon.proto.sensor;

import "header.proto";    // not public

message Image 
{
  eon.proto.common.Header header = 1;

   ... 
}

This error only occurs when proto imports an intermediate file.

How to reproduce

  1. Import other proto in a proto file
  2. compile and run
  3. run ecal monitor

How did you get eCAL?

Ubuntu PPA (apt-get)

Environment

eCAL System Information

------------------------- SYSTEM ---------------------------------
Version                  : v5.11.2 (2023-01-20 08:09:14 +0100)
Platform                 : linux

------------------------- CONFIGURATION --------------------------
Default INI              : /etc/ecal/ecal.ini

------------------------- NETWORK --------------------------------
Host name                : dev
Network mode             : local
Network ttl              : 2
Network sndbuf           : 5 MByte
Network rcvbuf           : 5 MByte
Multicast group          : 239.0.0.1
Multicast mask           : 0.0.0.15
Multicast ports          : 14000 - 14010
Multicast join all IFs   : off
Bandwidth limit (udp)    : not limited

------------------------- TIME -----------------------------------
Synchronization realtime : "ecaltime-localtime"
Synchronization replay   :
State                    :  synchronized
Master / Slave           :  Master
Status (Code)            : "everything is fine." (0)

------------------------- PUBLISHER LAYER DEFAULTS ---------------
Layer Mode INPROC        : off
Layer Mode SHM           : auto
Layer Mode TCP           : off
Layer Mode UDP MC        : auto

------------------------- SUBSCRIPTION LAYER DEFAULTS ------------
Layer Mode INPROC        : on
Layer Mode SHM           : on
Layer Mode TCP           : on
Layer Mode UDP MC        : on
Npcap UDP Reciever       : off
KerstinKeller commented 1 year ago

Hi @jiejieTop,

ok, first question: How are you sending your data? Do you have a regular eCAL::protobuf::CPublisher<eon::proto::sensor::Image> which is sending the data?

We do work a lot with nested protobuf's (see also the person example, it's distributed over 3 different proto files here), and haven't had any problems so far.

Things get a little more interesting when the proto files are also in a directory structure: We usually use this CMake function to generate the protobufs pb.h and pb.cc files.

So how (with which protoc invocation) do you generate the files?

Is it possible that you can create a minimal sample (e.g. CMakeLists.txt, main.cpp, and 2 proto files) where this occurs , so we can take a look?

FlorianReimold commented 1 year ago

Closing due to inactivity.