robot-upstart 설치

$ sudo apt install ros-melodic-robot-upstart

서비스 유닛 생성 Install

rosrun robot_upstart install [옵션] <패키지명>/<패키지 하위 런치 파일 경로>

예) $ rosrun robot_upstart install -master http://#.#.#.#:11311 my_package/launch/my_package.launch

—master 옵션을 주지 않으면 localhost가 사용됨

/lib/systemd/systemd
Preparing to install files to the following paths:
  /etc/ros/melodic/jetson.d/.installed_files
  /etc/ros/melodic/jetson.d/jetson_darknet.launch
  /etc/systemd/system/multi-user.target.wants/jetson.service
  /lib/systemd/system/jetson.service
  /usr/sbin/jetson-start
  /usr/sbin/jetson-stop
Now calling: /usr/bin/sudo /opt/ros/melodic/lib/robot_upstart/mutate_files
Filesystem operation succeeded.
** To complete installation please run the following command:
 sudo systemctl daemon-reload && sudo systemctl start jetson

생성된 Unit 파일 확인

$ cat /lib/systemd/system/jetson.service

# THIS IS A GENERATED FILE, NOT RECOMMENDED TO EDIT.

[Unit]
Description="bringup jetson"
After=network.target

[Service]
Type=simple
ExecStart=/usr/sbin/jetson-start

[Install]
WantedBy=multi-user.target

서비스 구동

$ sudo systemctl daemon-reload && sudo systemctl start jetson

노드 구동 확인

$ ps -ef | grep ros

서비스 유닛 삭제(Uninstall)

$ sudo systemctl stop jetson

$ rosrun robot_upstart uninstall jetson