ROS 원격 노드 통신 1

Jaewon·2021년 5월 14일
0

ROS

목록 보기
6/9
sudo gedit ~/.bashrc

명령어를 친 후, 맨 밑 부분을 다음과 같이 변경한다.

alias cm='cd ~/xycar_ws && catkin_make'
source /opt/ros/melodic/setup.bash
source ~/xycar_ws/devel/setup.bash
export ROS_MASTER_URI=http://<<<IP>>>:11311
export ROS_HOSTname=<<<IP>>>

이때
ROS_MASTER_URI = roscore가 구동되는 장치의 IP주소
ROS_HOSTname = 내 PC의 IP 주소 (ifconfig로 알 수 있다.)

rosrun turtlesim turtle_teleop_key

를 실행한다.

노드간 메시지 흐름을 확인하기 위해서는
위에서 명령어를 실행한 터미널과 다른 터미널을 연다.

 rostopic list
 rosnode info /turtlesim
 rostopic echo /turtle1/cmd_vel
 rqt_graph

등으로 확인할 수 있다.

0개의 댓글