control_node, comm_node, cam_node로 구성
노드 실행은 MAVROS_node, cam_node, control_node, comm_node 순으로 켜기
각 노드에서 하는 일
-
cam_node
캠 동작
pub : 노드 상태
srv : 캠 On/Off -
control_node
기체 제어
pub : 노드 상태, 제어 상태, 제어 명령
sub : 기체 상태
call: 제어 명령 등 -
comm_node
통신 처리 및 명령 전달
sub : 기체 상태, 노드 상태
call: 제어 명령, 캠 On/Off
-
cam_node 끄고 켜기
[Terminal 1] @ python cam_node.py
[Terminal 1] Ready to take video
[Terminal 2] @ rosservice call /cam_node/cam_power 1
[Terminal 1] resp : true
[Terminal 2] CamState : True
[Terminal 2] @ rosservice call /cam_node/cam_power 0
[Terminal 1] resp : true
[Terminal 2] CamState : False -
comm_node 통신 장비 안쓰고 메시지 보내기
[Terminal 1] @ python cam_node.py
[Terminal 2] @ python comm_node.py fake
cam_node와 comm_node는 1Hz로 캠을 끄고 켜며 캠 상태를 주고 받는다.
[Terminal 3] @ rosservice call /fake_serial/topics "test message"
[Terminal 1] remaining 100, received test messages
Refer from robot-upstart and https://roboticsbackend.com/make-ros-launch-start-on-boot-with-robot_upstart/
sudo apt-get install ros-melodic-robot-upstart
No need to run roscore
rosrun robot_upstart install <PKG_NAME> <LAUNCHFILE_NAME> --job <JOB_NAME> --symlink
After this, just run following:
sudo systemctl daemon-reload
That launch file is installed, but is not running yet.
sudo systemctl disable <JOB_NAME>.service
sudo systemctl start <JOB_NAME>.service
sudo systemctl stop <JOB_NAME>.service
cd /etc/udev/rules.d/
sudo touch local.rules
ACTION=="add", KERNEL=="dialout", MODE="0666"
##처음하는거면##
echo "# mavros_repo" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/Kimbyung-wook/mavros_repo.git
git push -u origin main
##있는거에다가 하는거면## git add . # 수정한거 다 올릴려구 git commit -m "Commentary" # 커밋한거 할 말 있으면? git push -u origin main # 가랏!
아래 주소를 따라서 소스를 빌드한 후에 https://github.com/mavlink/mavros/tree/master/mavros#source-installation catkin_ws/src 에 git clone 하면 됩니다.
Jaeyoung-Lim님의 moducdulab_ros
https://github.com/Jaeyoung-Lim/modudculab_ros
MAVROS Offboard control example
https://dev.px4.io/master/en/ros/mavros_offboard.html
mavlink/mavros의 test_mavros
https://github.com/mavlink/mavros/tree/master/test_mavros
PX4-Autopilot의 MAVROS integration Test files
https://github.com/PX4/PX4-Autopilot/tree/master/integrationtests/python_src/px4_it/mavros