Autostarting MAVROS


#1

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!


#2

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.


#3

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


#4

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