ShunjiHashimoto / tang

収穫サポートロボットTANG
2 stars 1 forks source link

ロボットを起動させるスクリプトアイコン作成 #218

Closed ShunjiHashimoto closed 1 year ago

ShunjiHashimoto commented 1 year ago

ロボットを起動するときにディスプレイを取り付け、そこに表示されたホーム画面の中の起動アイコンを実行することで、ラズパイ、jetson側でros launchを実行する。

ShunjiHashimoto commented 1 year ago
  1. vnc serverを自動起動
  2. ip address を固定化
  3. ラズパイでのスクリプトを自動化
  4. jetson側も自動化
ShunjiHashimoto commented 1 year ago

ssh でraspiに入ってパスワードを打って、roslaunchをするときに必要なもの 実装方法はこちらを参考 https://maku77.github.io/linux/io/expect.html#:~:text=ssh%20%E6%8E%A5%E7%B6%9A%E3%82%84%20rsync%20%E6%8E%A5%E7%B6%9A%E3%81%AE%E3%83%91%E3%82%B9%E3%83%AF%E3%83%BC%E3%83%89%E5%85%A5%E5%8A%9B%E3%82%92%E8%87%AA%E5%8B%95%E5%8C%96%E3%81%99%E3%82%8B

$ sudo apt-get install expect
ShunjiHashimoto commented 1 year ago

アイコン作成はこちらを参考にした https://lunaris-code.com/pc/64/ ただ、現状だとraspi側はアイコンを使って実行できたが、xavier側のlaunchコマンドがうまく実行できなかった。
原因調査中。

ShunjiHashimoto commented 1 year ago
[Desktop Entry]
Encoding=UTF-8
Terminal=true
Type=Application
Name=tang_detection
Exec=/home/hashimoto/catkin_ws/src/tang/.shellscripts/run_tang_detection.sh
Icon=/home/hashimoto/catkin_ws/src/tang/.shellscripts/realsense.jpg

を以下のように変更すればアイコン作れた。
sourceするときは絶対パスで指定する

[Desktop Entry]
Terminal=true
Type=Application
Name=tang_detection
Exec=bash -c "source /opt/ros/melodic/setup.bash && ./run_tang_detection.sh"
Icon=/home/hashimoto/catkin_ws/src/tang/.shellscripts/realsense.jpg
ShunjiHashimoto commented 1 year ago

参考 https://answers.ros.org/question/226588/how-do-i-create-a-desktop-application-for-ros/ https://techmagic.co.jp/blog-0727/