Autostarting MAVROS

I’m experimenting with using MAVROS on your latest Raspberry Pi Ubuntu image, but have run into a problem autostarting MAVROS.

My preferred approach is to create a systemctl mavros service . The service starts on boot, but the mavros node crashes and restarts in an 80 second cycle.

I have also tried inserting roslaunch mavros px4.launch & in /usr/sbin/magni-base. After boot up, rostopic list indicates the mavros topics have been registered, but they are not being published.

I feel like I must be missing something extremely obvious, so any help would be appreciated!

Can you roslaunch from the command line after login? If yes, it is probably an environment issue. If it is still failing, are there warnings or errors in the log files? If so, this may give you some indication of the issue.

Check the logs for the service for why it is crashing. Sounds like something in MAVROS is not happy about being started early in the boot process.

systemctl status SERVICE_NAME

you may also want to try

journalctl -u SERVICE NAME

Thanks for the response! So yes, roslaunch runs fine from the terminal. I’ll check out the logs and get back…

Any updates on this? If there is a bug please report it here:

If it all works great please let us know what you did to make that happen.


Apologies for the tardy response. I have worked around the problem by disabling the services in the Ubiquity startup sequence and using Robot Upstart instead.

Awesome! I am glad you were able to make it work!