|
The workflow of the data interaction interface is shown here.
While initializing the interface, we need to create a data space Domain and Domain Participants on both receiving and sending ends. According to the DDS specification, we should encapsulate the data that needs to be interacted into a unified data structure and create corresponding Topics. The sender creates a Publisher and corresponding DataWriters for different Topics. The receiver creates Subscribers and corresponding DataReaders, and creates Listeners to listen to data in the Domain.
After the simulation starts, each module encapsulates the data to be sent into a specific structure, and then calls the corresponding data sending function, and uses DataWriter to send the data to the Domain.
The Listener will keep listening to the global data space. While new data is arriving, it will judge the type of data, and call the corresponding DataReader of Subscriber to receive the data. At last, it will call the corresponding data processing function to parse and process the data.
|