![]() * Refs #16427. Increase cmake minimum required Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Refs #16427. Update googletest Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> * Fix tests Signed-off-by: Pablo Garrido <pablogs9@gmail.com> * Fix tests Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev> Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Co-authored-by: Pablo Garrido <pablogs9@gmail.com> |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
HelloWorld.c | ||
HelloWorld.h | ||
HelloWorld.idl | ||
README.md | ||
configurator_client.c | ||
publisher.c | ||
subscriber.c |
README.md
Deployment example
This example will show how deploy a real world Micro XRCE-DDS configuration. The goal of this example is to create a minimal publisher and subscriber that can send and receive topics from DDS world. To archive this minimal examples, it is necessary to split some logic. This implies that the publisher and subscriber will be configured previously with another application: the configurator client. The configurator client will create the necessary entities in the agent for a specific session. In order to compile this example, the following profiles should be enabled:
UCLIENT_PROFILE_UDP
Usage
-
Run an agent in a certain port, for example, 2018:
MicroXRCEAgent udp4 -p 2018
. -
Run the ConfiguratorClient example to create both, a publisher and a subscriber.
- Configure the publisher:
ConfiguratorClient --key 1000 create pub --id 1
. This will create a publisher with the session key1000
, all necessary entities to create the publisher will have1
as id. - Configure the subscriber:
ConfiguratorClient --key 2000 create sub --id 1
. This will create a subscriber with the session key2000
, all necessary entities to create the subscriber will have1
as id.
- Configure the publisher:
-
Run the Publisher example:
PublisherClient --key 1000 --id 1
. The publisher will use the configuration for key1000
and will publish by the DataWriter entity1
. -
Run the Subscriber example:
SubscriberClient --key 2000 --id 1
. The subscriber will use the configuration for key2000
and will subscribe by the DataReader entity1
.
Topic
The HelloWorld topic has the following IDL representation:
struct HelloWorld
{
unsigned long index;
string message;
};