Auto-start microRTPS client/agent on FMU/NavQ
Creating a systemd service to auto-start the microRTPS agent on NavQ
Generate a start up script for the micrortps client under /usr/local/bin
sudo nano /usr/local/bin/start_micrortps_agent.shwith content
#!/bin/bash
## startup script for micro_rtps_agent
## agent will communicate to FMUK66 via UDP
## FMUK66 IPv4 addr = 10.0.0.2
##
## Author: Gerald Peklar <gerald.peklar@nxp.com>
source /opt/ros/foxy/setup.bash
source ~/px4_ros_com_ros2/install/setup.bash
# Comment out the line that you are not using:
# If you're using T1 Ethernet communication:
micrortps_agent -t UDP -i 10.0.0.2
# If you're using UART communication over the UART3 port:
micrortps_agent -d /dev/ttymxc2 -b 921600Save the file and exit nano. Make the file executable
Generate a systemd service file to start the startup script at boot
with content
Save the file and exit nano. Check if the process starts
You should see an state active (running), quit with <q> Enable the systemd service file finally to be active at boot