ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.22k stars 9.72k forks source link

"apollo.common.StatusPb.error_code" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto". #14911

Open yongjay opened 1 year ago

yongjay commented 1 year ago

System information

Steps to reproduce the issue:

hi all: First,I have compiled cyberRT independently on my host computer,and I use bridge in the container to communicate with the host computer, and use bridge module to send ADCTrajectory, which is the default sending type of bridge. 3、I moved the bridge to the host machine and compiled it, so I got bridge_receive_test.And receiving ADCTrajectory data on the host using bridge_receive_test was successful.

Next, I wanted to send perception data, and based on bridge's README, I added some code and configuration files as follows: In udp_bridge_sender_component.h 2023-04-24 16-31-27 In udp_bridge_sender_component.cc 2023-04-24 16-33-39

add udp_bridge_sender_perception.pb.txt : 2023-04-24 16-35-29 which content is :

remote_ip: "here is my host ip"
remote_port: 8902
proto_name: "PerceptionObstacles"

In bridge_sender.dag

module_config {
    module_library: "/opt/apollo/neo/packages/bridge-dev/latest/lib/libudp_bridge_sender_component.so"
    components {

        class_name: "UDPBridgeSenderComponent<planning::ADCTrajectory>"
        config {
            name: "bridge_sender_ADCTrajectory"
            config_file_path: "/apollo/modules/bridge/conf/udp_bridge_sender_adctrajectory.pb.txt"
            readers {
              channel: "/apollo/planning"
            }
      }
   }

    components {

        class_name: "UDPBridgeSenderComponent<localization::LocalizationEstimate>"
        config {
            name: "bridge_sender_LocalizationEstimate"
            config_file_path: "/apollo/modules/bridge/conf/udp_bridge_sender_localization.pb.txt"
            readers {
              channel: "/apollo/localization/pose"
            }
      }
   }

      components {

        class_name: "UDPBridgeSenderComponent<perception::PerceptionObstacles>"
        config {
            name: "bridge_sender_PerceptionObstacles"
            config_file_path: "/apollo/modules/bridge/conf/udp_bridge_sender_perception.pb.txt"
            readers {
              channel: "/apollo/perception/obstacles"
            }
      }
   }
}

then ,I recompile the bridge in container workspace: buildtool build -p ./modules/bridge refer link to start perception . and start bridge component: cyber_launch start /apollo/modules/bridge/launch/bridge_sender.launch

I got this error.

root@in-dev-docker:/apollo_workspace# cyber_launch start /apollo/modules/bridge/launch/bridge_sender.launch 
[cyber_launch_15458] INFO Launch file [/apollo/modules/bridge/launch/bridge_sender.launch]
[cyber_launch_15458] INFO ========================================================================================================================
[cyber_launch_15458] INFO Load module [bridge_sender] library: [udp_bridge_sender] [CYBER_DEFAULT] conf: [/apollo/modules/bridge/dag/bridge_sender.dag] exception_handler: []
[cyber_launch_15458] INFO Start process [udp_bridge_sender] successfully. pid: 15459
[cyber_launch_15458] INFO ------------------------------------------------------------------------------------------------------------------------
[udp_bridge_sender]  WARNING: Logging before InitGoogleLogging() is written to STDERR
[udp_bridge_sender]  I0424 16:42:50.669423 15459 module_argument.cc:84] []command: mainboard -d /apollo/modules/bridge/dag/bridge_sender.dag -p udp_bridge_sender -s CYBER_DEFAULT 
[udp_bridge_sender]  I0424 16:42:50.669968 15459 global_data.cc:153] []host ip: my ip
[udp_bridge_sender]  I0424 16:42:50.673650 15459 module_argument.cc:59] []binary_name_ is mainboard, process_group_ is udp_bridge_sender, has 1 dag conf
[udp_bridge_sender]  I0424 16:42:50.673694 15459 module_argument.cc:62] []dag_conf: /apollo/modules/bridge/dag/bridge_sender.dag
[udp_bridge_sender]  W0424 16:42:50.674018 15459 scheduler_factory.cc:63] [mainboard]Scheduler conf named /opt/apollo/neo/packages/cyber/conf/udp_bridge_sender.conf not found, use default.
[udp_bridge_sender]  I0424 16:42:50.674463 15464 processor.cc:42] [mainboard]processor_tid: 15464
[udp_bridge_sender]  I0424 16:42:50.674697 15465 processor.cc:42] [mainboard]processor_tid: 15465
[udp_bridge_sender]  I0424 16:42:50.674842 15466 processor.cc:42] [mainboard]processor_tid: 15466
[udp_bridge_sender]  I0424 16:42:50.675455 15467 processor.cc:42] [mainboard]processor_tid: 15467
[udp_bridge_sender]  I0424 16:42:50.683629 15468 processor.cc:42] [mainboard]processor_tid: 15468
[udp_bridge_sender]  I0424 16:42:50.683820 15470 processor.cc:42] [mainboard]processor_tid: 15470
[udp_bridge_sender]  I0424 16:42:50.683969 15471 processor.cc:42] [mainboard]processor_tid: 15471
[udp_bridge_sender]  I0424 16:42:50.684104 15472 processor.cc:42] [mainboard]processor_tid: 15472
[udp_bridge_sender]  I0424 16:42:50.684268 15473 processor.cc:42] [mainboard]processor_tid: 15473
[udp_bridge_sender]  I0424 16:42:50.687606 15474 processor.cc:42] [mainboard]processor_tid: 15474
[udp_bridge_sender]  I0424 16:42:50.688884 15475 processor.cc:42] [mainboard]processor_tid: 15475
[udp_bridge_sender]  I0424 16:42:50.689033 15476 processor.cc:42] [mainboard]processor_tid: 15476
[udp_bridge_sender]  I0424 16:42:50.689380 15477 processor.cc:42] [mainboard]processor_tid: 15477
[udp_bridge_sender]  I0424 16:42:50.689663 15478 processor.cc:42] [mainboard]processor_tid: 15478
[udp_bridge_sender]  I0424 16:42:50.695626 15479 processor.cc:42] [mainboard]processor_tid: 15479
[udp_bridge_sender]  I0424 16:42:50.695812 15481 processor.cc:42] [mainboard]processor_tid: 15481
[udp_bridge_sender]  I0424 16:42:50.695835 15459 init.cc:113] [mainboard]Register exit handle succ.
[udp_bridge_sender]  I0424 16:42:50.695991 15459 plugin_manager.cc:204] [mainboard]scanning user plugin index path under /apollo_workspace/bazel-bin
[udp_bridge_sender]  I0424 16:42:50.781358 15459 plugin_manager.cc:217] [mainboard]load system plugin index path: /opt/apollo/neo/packages/share/cyber_plugin_index
[udp_bridge_sender]  W0424 16:42:50.781514 15459 file.cc:339] [mainboard]cannot open directory /opt/apollo/neo/packages/share/cyber_plugin_index
[udp_bridge_sender]  I0424 16:42:50.782558 15459 module_controller.cc:72] [mainboard]Start initialize dag: /apollo/modules/bridge/dag/bridge_sender.dag
[udp_bridge_sender]  I0424 16:42:50.782779 15459 class_loader.cc:37] [mainboard]Begin LoadLibrary: /opt/apollo/neo/packages/bridge-dev/latest/lib/libudp_bridge_sender_component.so
[udp_bridge_sender]  I0424 16:42:50.995002 15459 class_loader_utility.h:79] [bridge]registerclass:UDPBridgeSenderComponent<planning::ADCTrajectory>,apollo::cyber::ComponentBase,/opt/apollo/neo/packages/bridge-dev/latest/lib/libudp_bridge_sender_component.so
[udp_bridge_sender]  I0424 16:42:50.995085 15459 class_loader_utility.h:79] [bridge]registerclass:UDPBridgeSenderComponent<localization::LocalizationEstimate>,apollo::cyber::ComponentBase,/opt/apollo/neo/packages/bridge-dev/latest/lib/libudp_bridge_sender_component.so
[udp_bridge_sender]  I0424 16:42:50.995106 15459 class_loader_utility.h:79] [bridge]registerclass:UDPBridgeSenderComponent<perception::PerceptionObstacles>,apollo::cyber::ComponentBase,/opt/apollo/neo/packages/bridge-dev/latest/lib/libudp_bridge_sender_component.so
[udp_bridge_sender]  I0424 16:42:51.011683 15459 udp_bridge_sender_component.cc:34] [bridge]UDP bridge sender init, startin...
[udp_bridge_sender]  I0424 16:42:51.025056 15459 scheduler.cc:55] [mainboard]create croutine: bridge_sender_PerceptionObstacles_/apollo/perception/obstacles
[udp_bridge_sender]  I0424 16:42:51.025615 15459 scheduler.cc:55] [mainboard]create croutine: bridge_sender_PerceptionObstacles
[udp_bridge_sender]  W0424 16:42:51.237111 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.StatusPb.error_code" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237131 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.StatusPb.msg" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237136 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.StatusPb" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237141 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.OK" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237144 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "OK" must be unique within "apollo.common", not just within "ErrorCode".
[udp_bridge_sender]  W0424 16:42:51.237149 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.CONTROL_ERROR" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237151 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "CONTROL_ERROR" must be unique within "apollo.common", not just within "ErrorCode".
[udp_bridge_sender]  W0424 16:42:51.237156 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.CONTROL_INIT_ERROR" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237159 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "CONTROL_INIT_ERROR" must be unique within "apollo.common", not just within "ErrorCode".
[udp_bridge_sender]  W0424 16:42:51.237162 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.CONTROL_COMPUTE_ERROR" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237165 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "CONTROL_COMPUTE_ERROR" must be unique within "apollo.common", not just within "ErrorCode".
[udp_bridge_sender]  W0424 16:42:51.237169 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.CANBUS_ERROR" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237171 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "CANBUS_ERROR" must be unique within "apollo.common", not just within "ErrorCode".
[udp_bridge_sender]  W0424 16:42:51.237175 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.CAN_CLIENT_ERROR_BASE" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237179 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "CAN_CLIENT_ERROR_BASE" must be unique within "apollo.common", not just within "ErrorCode".
[udp_bridge_sender]  W0424 16:42:51.237182 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.CAN_CLIENT_ERROR_OPEN_DEVICE_FAILED" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237185 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "CAN_CLIENT_ERROR_OPEN_DEVICE_FAILED" must be unique within "apollo.common", not just within "ErrorCode".
[udp_bridge_sender]  W0424 16:42:51.237190 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.CAN_CLIENT_ERROR_FRAME_NUM" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237192 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "CAN_CLIENT_ERROR_FRAME_NUM" must be unique within "apollo.common", not just within "ErrorCode".
[udp_bridge_sender]  W0424 16:42:51.237196 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.CAN_CLIENT_ERROR_SEND_FAILED" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237198 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "CAN_CLIENT_ERROR_SEND_FAILED" must be unique within "apollo.common", not just within "ErrorCode".
[udp_bridge_sender]  W0424 16:42:51.237202 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] "apollo.common.CAN_CLIENT_ERROR_RECV_FAILED" is already defined in file "modules/common_msgs/basic_msgs/error_code.proto".
[udp_bridge_sender]  W0424 16:42:51.237205 15489 protobuf_factory.cc:218] [mainboard][modules/common/proto/error_code.proto] Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it.  Therefore, "CAN_CLIENT_ERROR_RECV_FAILED" must be unique within "apollo.common", not just within "ErrorCode".
.........
.....
...

It looks like error_code.proto was redefined,so I searched the container for error_code.proto and found no new ones:

2023-04-24 16-58-26

modules/common/proto/error_code.proto was not found.

any suggestions?

yongjay commented 1 year ago

Does this cause by #14777 ? @daohu527

daohu527 commented 1 year ago

I will check and feedback then

yongjay commented 1 year ago

I will check and feedback then

THX !

yongjay commented 1 year ago

I will check and feedback then

hi,Have you found the cause of the problem?

YuqiHuai commented 1 year ago

@yongjay I saw similar error messages when I mixed up Apollo 7 and Apollo 8 messages (e.g., if in the same record file there are both messages generated with A7 protobuf and messages generated with A8 protobuf). Is it possible that you somehow mixed things up as well?

yongjay commented 1 year ago

@yongjay I saw similar error messages when I mixed up Apollo 7 and Apollo 8 messages (e.g., if in the same record file there are both messages generated with A7 protobuf and messages generated with A8 protobuf). Is it possible that you somehow mixed things up as well?

I only used Apollo 8.0,and the record file is download from url , maybe the record file generated by different protobuf versions? I will try something ,thanks for your reply.

I wonder if you have solved the problem yet? how?

YuqiHuai commented 1 year ago

@yongjay can you zip the record file and upload it here? I may be able to help you to fix it. The record file may have been generated with a previous version of Apollo. I cannot access Apollo Studio for some reason. I solved my problem by using just Apollo 7.0 instead of mixing messages from 2 versions.

YuqiHuai commented 1 year ago

@yongjay I am in the US and it says it will take 2 days for me to download the entire file. I imagine there must be just one single record file with the perception messages you want to send. Can you zip just that 1 file and upload it here if it is not too big?

yongjay commented 1 year ago

@yongjay I am in the US and it says it will take 2 days for me to download the entire file. I imagine there must be just one single record file with the perception messages you want to send. Can you zip just that 1 file and upload it here if it is not too big?

Here is the record file ,look forward to your reply.

YuqiHuai commented 1 year ago

perception_fix.record.zip @yongjay I think this might work. I tried what I think would be the fix, let me know if it works!


modules/common/proto/error_code.proto
modules/common/proto/geometry.proto
modules/common/proto/error_code.proto
modules/common/proto/header.proto
modules/common/proto/pnc_point.proto
modules/map/proto/map_id.proto
modules/common/proto/geometry.proto
modules/map/proto/map_geometry.proto
modules/map/proto/map_lane.proto
modules/perception/proto/perception_obstacle.proto

These are the registered protobuf descriptors in your original record, as you can see these are all from Apollo 7 (or before)

modules/common_msgs/basic_msgs/error_code.proto
modules/common_msgs/basic_msgs/geometry.proto
modules/common_msgs/basic_msgs/error_code.proto
modules/common_msgs/basic_msgs/header.proto
modules/common_msgs/basic_msgs/pnc_point.proto
modules/common_msgs/basic_msgs/geometry.proto
modules/common_msgs/map_msgs/map_geometry.proto
modules/common_msgs/map_msgs/map_id.proto
modules/common_msgs/map_msgs/map_lane.proto
modules/common_msgs/perception_msgs/perception_obstacle.proto

These are the registered protobuf descriptor in the potential fix version, all of them are from Apollo 8 (as it says common_msgs)

yongjay commented 1 year ago

perception_fix.record.zip @yongjay I think this might work. I tried what I think would be the fix, let me know if it works!

modules/common/proto/error_code.proto
modules/common/proto/geometry.proto
modules/common/proto/error_code.proto
modules/common/proto/header.proto
modules/common/proto/pnc_point.proto
modules/map/proto/map_id.proto
modules/common/proto/geometry.proto
modules/map/proto/map_geometry.proto
modules/map/proto/map_lane.proto
modules/perception/proto/perception_obstacle.proto

These are the registered protobuf descriptors in your original record, as you can see these are all from Apollo 7 (or before)

modules/common_msgs/basic_msgs/error_code.proto
modules/common_msgs/basic_msgs/geometry.proto
modules/common_msgs/basic_msgs/error_code.proto
modules/common_msgs/basic_msgs/header.proto
modules/common_msgs/basic_msgs/pnc_point.proto
modules/common_msgs/basic_msgs/geometry.proto
modules/common_msgs/map_msgs/map_geometry.proto
modules/common_msgs/map_msgs/map_id.proto
modules/common_msgs/map_msgs/map_lane.proto
modules/common_msgs/perception_msgs/perception_obstacle.proto

These are the registered protobuf descriptor in the potential fix version, all of them are from Apollo 8 (as it says common_msgs)

It works!!! Thank you very much for your help!

YuqiHuai commented 1 year ago

@yongjay glad this is able to fix the issue!

@daohu527 I think we can confirm this being an issue caused by v7 to v8 migration. Would you be interested in knowing how to fix record files with this issue and should I start fixing other publicly available record files?