5. Understanding ROS Nodes
- Prerequisites
- Quick Overview of Graph Concepts
- Nodes
- Client Libraries
- roscore
- Using rosnode
- Using rosrun
1. 전제조건
sudo apt-get install ros-<distro>-ros-tutorials
2. Graph 개념에 대한 빠른 개요
Nodes : ROS를 이용해 다른 nodes와 통신하는 실행 파일
Messages : Topic을 subscribing하거나 publishing할 때 사용되는 ROS data type
Topics : Nodes는 topic에 messages를 publishing하거나 messages를 수신하기 위해 topics을 구독할 수 있다.
Master : ROS를 위한 name service (nodes가 서로를 찾도록)
rosout : stdout/stderr에 해당하는 ROS
roscore : Master + rosout + Parameter server
3. Nodes
Nodes : ROS package 내의 실행 파일일 뿐임.
4. Client Libraries
rospy = python client library
roscpp = c++ client library
5. roscore
6. Using rosnode
hyeonji@LAPTOP-309KFDKH:~$ rosnode list
/rosout
/turtlesim
hyeonji@LAPTOP-309KFDKH:~$ rosnode list
/my_turtle
/rosout
/turtlesim
hyeonji@LAPTOP-309KFDKH:~$ rosnode cleanup
ERROR: connection refused to [http://LAPTOP-309KFDKH:44449/]
Unable to contact the following nodes:
* /turtlesim
Warning: these might include alive and functioning nodes, e.g. in unstable networks.
Cleanup will purge all information about these nodes from the master.
Please type y or n to continue:
y
Unregistering /turtlesim
done
hyeonji@LAPTOP-309KFDKH:~$ rosnode list
/my_turtle
/rosout
hyeonji@LAPTOP-309KFDKH:~$ rosnode ping my_turtle
rosnode: node is [/my_turtle]
pinging /my_turtle with a timeout of 3.0s
xmlrpc reply from http://LAPTOP-309KFDKH:44427/ time=33.793211ms
xmlrpc reply from http://LAPTOP-309KFDKH:44427/ time=1.605988ms
xmlrpc reply from http://LAPTOP-309KFDKH:44427/ time=2.434731ms
xmlrpc reply from http://LAPTOP-309KFDKH:44427/ time=2.393246ms
xmlrpc reply from http://LAPTOP-309KFDKH:44427/ time=1.596212ms
xmlrpc reply from http://LAPTOP-309KFDKH:44427/ time=0.763416ms
xmlrpc reply from http://LAPTOP-309KFDKH:44427/ time=0.990391ms
xmlrpc reply from http://LAPTOP-309KFDKH:44427/ time=1.664639ms
...
^Cping average: 2.453923ms