Topic, Publisher, Subscriber
: 프로그램 하나 하나를 노드라 하고, 메시지를 보내는 노드를 publisher, 메시지 받는 노드를 subscriber라고 함, topic은 publisher와 subscriber의 통신 경로, 예를 들어 publisher는 topic에다가 메시지를 보내고 subscriber는 같은 topic으로부터 메시지를 받음
위의 관계는 rosrun 중에 rqt_graph 로 확인 가능
실습 진행 전 workspace 만들기
// workspace 만들기
wget https://raw.githubusercontent.com/katebrighteyes/jetson_ros_melodic/master/install_catkinws.sh
chmod 777 install_catkinws.sh
./install_catkinws.sh
// home 디렉토리 아래 catkin_ws 확인
cd catkin_ws/src/
ls
ls /dev/tty*
ll /dev/ttyUSB0
sudo chmod 777 /dev/ttyUSB0
git clone https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver
ls
cd ..
catkin_make
source ./devel/setup.bash
roslaunch hls_lfcd_lds_driver view_hlds_laser.launch
ls -ltr /dev/video*
// video0은 TX2 보드 카메라, video1은 usb 카메라
cd catkin_ws/src
git clone https://github.com/bosch-ros-pkg/usb_cam
cd ..
sudo apt-get install ros-melodic-camera-info-manager libavcodec-dev libswscale-dev -y
catkin_make
source ~/catkin_ws/devel/setup.bash
rospack find usb_cam
sudo apt-get install ros-melodic-image-view
source ~/catkin_ws/devel/setup.bash
[1]
$ roslaunch usb_cam usb_cam-test.launch
// 에러나면 catkin_ws/src/usb_cam/launch에 launch 파일 video0 -> video1로 수정
[2]
$ rosrun rqt_graph rqt_graph
터미널에 rviz
add 버튼 누르고 by topic 들어가서 output/image
gazebo는 디지털 트윈같은거
설치 참고
https://github.com/katebrighteyes/jetson_ros_melodic/blob/master/next/turtlebot3_sim.txt
실행 참고
https://github.com/katebrighteyes/jetson_ros_melodic/blob/master/next/ros_gazebo_slam_ex.txt