3. eCAL Samples
The eCAL installation comes with a set of ready-to-use sample applications. So, let’s start one of those to see some eCAL communication!
Note
For now, you should start everything on the same PC. We will cover communication between multiple PCs in the next section.
3.1. Basic communication
Important
eCAL exchanges data over IP multicast. If you are using some third-party firewall, you may have to turn that off.
The sample we are going to use to try out the “normal” eCAL communication is ecal_sample_person_snd. Start it!
|fa-windows| On Windows start |person_snd-path-windows|
|fa-ubuntu| On Ubuntu call
ecal_sample_person_snd
from a terminal (it should be in your PATH)
You now have a console-based application that periodically prints some text to the terminal. In the background the application created a topic person and sends data to it. So, let’s add a subscriber that receives the data!
|fa-windows| On Windows start :file:|person_rec-path-windows|
|fa-ubuntu| On Ubuntu call
ecal_sample_person_rec
from a terminal
Congratulations! You are looking at your first local eCAL communication! The subscriber subscribed to the topic person and prints all data it receives to the terminal.
Tip
Start a second publisher and a second subscriber to see what happens! Both publishers will send their data to the same topic, so all subscribers will receive the data of all publishers.