Jetson XAVIER NX接上19v电源后就自动开机
写service
进入system文件夹
cd /etc/systemd/system
利用vim创建文件
sudo vim lidar.service
内容如下
[Unit]
Description=Lidar startup script
[Service]
ExeStart=/bin/bash -c '\
source /home/hatcher/.bashrc; \
/home/hatcher/boot.sh'
[Install]
WantedBy=multi-user.target
写shell启动脚本
vim boot.sh
#!/bin/bash -i
sleep 20
source /home/hatcher/.bashrc
/opt/ros/melodic/bin/roslaunch /home/hatcher/catkin_ws/src/arc_draw/launch/arc_draw.launch
上电后预热一分钟左右就可以用rosnode list命令观察launch文件是否成功启动