GoodTekken

20220708-startup

Jul 19th, 2022 (edited)
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. style1:(available)
  2. gnome-session-properties
  3.  
  4. Name:StartUp
  5. Command:bash /home/r2slam/Desktop/StartUp/main.sh
  6.  
  7. ./bashrc
  8. export LD_LIBRARY_PATH=/opt/Basler_blaze/lib/gentlproducer/gtl #/ProducerBlaze.cti
  9.  
  10. =============================================
  11. style2:(start up roscore on the background)
  12. add the file(etc/rc.local)
  13. $sudo gedit ./rc.local
  14. #!/usr/bin/bash
  15.  
  16. source /opt/ros/noetic/setup.bash
  17. source /home/r2slam/catkin_ws/devel/setup.bash
  18. source /home/r2slam/catkin_ws1/devel/setup.bash
  19.  
  20. #su r2slam
  21. #roscore &
  22. #echo "$USER"
  23. #echo "success to start the bash by rc.local" > /home/r2slam/test.log
  24. #cd /home/r2slam/Desktop/StartUp
  25. #gnome-terminal -t "roscore" -- bash -c "./main.sh;exec bash;"
  26. #su r2slam
  27. #gnome-terminal -t "roscore" -- bash -c "./main.sh;"
  28. #echo "Hele me" >> /home/r2slam/test.log
  29. #echo "USER" >> /home/r2slam/test.log
  30. #echo "$USER" >> /home/r2slam/test.log
  31. #echo "$USER" >> /home/r2slam/test.log
  32. #cd /home/r2slam/Desktop/StartUp
  33. #sh ./touch.sh
  34. #sh \home\r2slam\Desktop\StartUp\main.sh
  35. exit 0
  36.  
  37.  
  38. =========================
  39. (main.sh)
  40. #!/usr/bin/bash
  41. #sleep 5 # wait 3 seconds
  42. #sh roscore.sh
  43. #echo -e ${string}
  44. #sleep 5 # wait 3 seconds
  45. #sh roscore.sh
  46. #echo -e ${string}
  47.  
  48. echo "Hello World" > /home/r2slam/Desktop/StartUp/hello.txt
  49. source /opt/ros/noetic/setup.bash
  50. source /home/r2slam/catkin_ws/devel/setup.bash
  51. source /home/r2slam/catkin_ws1/devel/setup.bash
  52. #gnome-terminal
  53. cd /home/r2slam/Desktop/StartUp
  54. #roscore &
  55. gnome-terminal -t "roscore" -- bash -c "./roscore.sh;exec bash;"
  56. #gnome-terminal -t "roscore" -- bash -c "./roscore.sh;"
  57. #sh ./roscore.sh
  58. #sh ./touch.sh
  59. sleep 100
  60. exit 0
  61. =============================
  62. (roscore.sh)
  63. #!/usr/bin/bash
  64.  
  65. echo "roscore ..."
  66. string="Hello,World!\n"
  67. sleep 5
  68. /opt/ros/noetic/bin/roscore
  69. sleep 20
  70. #sleep 3
  71.  
  72. =============================
  73. (touch.sh)
  74. #!/usr/bin/bash
  75.  
  76. touch 123.txt
Add Comment
Please, Sign In to add comment