Apollo 10.0
自动驾驶开放平台
|
This module provides a way for other Apollo modules interactiving with process outside of Apollo by socket. It includes sender and receiver components.
In sender component, there is only one input, which is the proto struct sender handled. In receiver comonent, its input is different with others. Its input comes from UDP socket.
Sender's output is by way of UDP socket. Receiver has one output which is receiver handled.
The startup of Bridge is consistent with the startup of other modules. Bridge contains two sub-modules, other than: sender and receiver. The sender is responsible for sending the udp data, and the receiver is responsible for receiving the data packet sent by the udp client, and parsing it, and then sending it to the module that has registered to respond to the message. The start command of Sender is as follows.
The start command of Receiver is as follows:
Its configuration file: /Apollo/modules/bridge/conf/udp_bridge_receiver_chassis.pb.txt
Note: If you want to receive data from the client outside the docker, you need to do port mapping with the -p parameter when starting docker, you need to modify the docker/scripts/dev_start.sh file, as shown below.
Add a new line -p 8900:8900 after -d . This allows you to map the internal and external ports of docker, and you can accept the data sent by the external client of docker.
To send/receive new messages via udp, you can add two lines of code to the corresponding file. If you want to add the message apollo::test::PbTest, as shown below. Add a new line after the 80th line of this file udp_bridge_receiver_component.h:
Also add after 197 lines of udp_bridge_receiver_component.cc
The addition of Sender is consistent with the receiver. After the code is modified, save it, then add the corresponding configuration file, startup file, and dag file. Recompile the code and start it.
如果您在使用文档的过程中,遇到任何问题,请到我们在【开发者社区】建立的 反馈意见收集问答页面,反馈相关的问题。我们会根据反馈意见对文档进行迭代优化。