Language: C++

Agent 001 and 002

We will now demonstrate how agent communication works by running both Agent 001 and 002. One will send data, and the other will receive it and display the output.

Note: If you have not set up a path to your cosmos bin folder, you will either have to set up a path (check Troubleshooting for the process) or move to the cosmos/bin folder and add ./ to the beginning of each command as follows:

$ ./agent_001

Note: If your antivirus repeatedly warns you about running a COSMOS exe, instruct your antivirus to ignore your COSMOS folder file path.

In a terminal, start agent_001

$ agent_001

In another terminal, start agent_002

$ agent_002

Verify successful communication

agent_001 should be displaying:

Received from agent_002: 16 bytes : hello 1 [OK]

agent _002 should be displaying:

agent_002 got request! response is: hello 1

Shutdown agents

In a new terminal, run the following commands to shutdown both agents.

$ agent cubesat1 001 shutdown
$ agent cubesat1 002 shutdown

Look at the agent’s other commands

Running the following command will print the commands you can run for this specific agent.

$ agent cubesat1 001

Read 4.5.1 Direct Commanding for more information on Agent Commands