Skip to content

Instantly share code, notes, and snippets.

@donghee
Last active September 22, 2022 06:40
Show Gist options
  • Save donghee/da039cdd7aab306ffb6e100ece7e42a2 to your computer and use it in GitHub Desktop.
Save donghee/da039cdd7aab306ffb6e100ece7e42a2 to your computer and use it in GitHub Desktop.
install mavproxy service

mavproxy 설치하기

  1. 다음 파일을 /home/agx 디렉토리에 복사
  • mavproxy.service, run-mavproxy.sh, mavproxy.sh

mavproxy.service

# /lib/systemd/system/mavproxy.service

[Unit]
Description=PX4 TELEM2 MAP TO UDP 14550
Wants=network-online.target
After=network-online.target
StartLimitIntervalSec=0

[Service]
Type=oneshot
RemainAfterExit=yes
#Type=simple
ExecStartPre=
ExecStart=/home/agx/run-mavproxy.sh
ExecStartPost=
#ExecStop=
ExecStop=/usr/bin/tmux kill-server
ExecReload=
#Restart=on-failure
User=agx
KillMode=none

[Install]
WantedBy=multi-user.targeta

run-mavproxy.sh

#!/bin/bash

tmux new-session -d -s agx 'cd /home/agx; ./mavproxy.sh'

mavproxy.sh

#!/bin/bash

sleep 10

sudo chgrp dialout /dev/ttyTHS0
sudo chmod 770 /dev/ttyTHS0

/usr/bin/python3 $HOME/.local/bin/mavproxy.py --master=/dev/ttyTHS0 --baudrate 921600 --out=udpin:0.0.0.0:14550 --daemon
  1. mavproxy 설치
sudo apt-get install python3-dev python3-opencv python3-wxgtk4.0 python3-pip python3-matplotlib python-pygame python-serial python3-lxml libxml2-dev libxslt-dev tmux git -y

pip3 install PyYAML mavproxy --user

sudo adduser $USER dialout
echo "%$USER ALL=NOPASSWD: ALL" | sudo tee -a /etc/sudoers

  1. mavproxy 자동 실행 서비스 설치
sudo cp mavproxy.service /lib/systemd/system/mavproxy.service

sudo systemctl daemon-reload
sudo systemctl enable mavproxy.service
sudo systemctl start mavproxy.service
sudo systemctl status mavproxy.service
  1. 부팅 후 mavproxy 실행 확인

다음 명령을 실행하여 mavproxy 프로세스가 실행 중인지 확인

ps aux |grep mavproxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment