Skip to main content

MicroXRCE DDS Agent: Setup & Installation

Installation of uxrcedds agent#

Git clone thee MicroXRCE DDS Agent git repository

note

Current version of PX4 has MicroXRCE DDS Client based on v2.x.x which supports only MicroXRCE DDS Agent version based on v2.x.x

git clone -b v2.4.3 https://github.com/eProsima/Micro-XRCE-DDS-Agent.git  
$ cd Micro-XRCE-DDS-Agent$ mkdir build && cd build
$ cmake ..$ make$ sudo make install
sudo ldconfig /usr/local/lib/

To run the MicroXRCE DDS Agent

sudo MicroXRCEAgent serial -D /dev/ttyTHS1 -b 926100
note

The above command is specific to the Aira drone, as the OBC is integrated with the flight contoller on UART1 of OBC, that has the device address /dev/ttyTHS1

MicroXRCE Agent Service#

To automate and run the MicroXRCE Agent after boot, follow the steps

sudo vim /etc/systemd/system/microxrceagent.service

Copy and paste the following lines and save the file

[Unit]Description= MicroXRCEAgent serial interface to flight controllerAfter=network.target
[Service]ExecStart=/usr/local/bin/MicroXRCEAgent serial -D /dev/ttyTHS1 -b 921600Restart=on-failureUser=root
[Install]WantedBy=multi-user.target

You could also download the microxrceagent service file and move it to /etc/systemd/system/

sudo mv /path/to/microxrceagent.service /etc/systemd/system/

Reload the daemon and enable the microxrceagent.service

sudo systemctl daemon-reexecsudo systemctl daemon-reloadsudo systemctl enable microxrceagent.service
sudo systemctl start microxrceagent.servicesudo systemctl status microxrceagent.service #to check the status of the MicroXRCEAgent status

To restart the microxrceagent.service if needed,

sudo systemctl restart microxrceagent.service
Last updated on