미국 공학박사 아빠의 코딩 연구소

ROS Terminal Commands
Want To Commands
Package Create a package Create a package dependent on other packages:

$ catkin_create_pkg my_package_name pkg1 pkg2 ...
e.g.,
catkin_create_pkg new_package std_msgs rospy roscpp

Find packages Find a package named pkg_name:

$ rospack find pkg_name

Enter into a package folder Enter the folder of a package named pkg_name:

$ roscd pkg_name

Edit files in a package Open a file in a package in a text editor:

$ rosed pkg_name file_name

Change my ROS package name 1. Change the following folders' name from my_pkg to a desired one:

- my_pkg
- my_pkg/include/my_pkg


2. Change every texts of "my_pkg" in the following files to a desired one:

- CMakeLists.txt
- CMakeLists.txt.user
- package.xml


3. Change any texts of "my_pkg" in "include(C++) or import(Python)" statements of your source files.
Topic List all topic names:

$ rostopic list


Get information of a topic named topic_name:

$ rostopic info topic_name


Print topic messages of topic_name on console:

$ rostopic echo topic_name


Manually publish a topic named topic_name:

$ rostopic pub topic_name message_type message
e.g.,
rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'
rostopic pub /turtle1/cmd_vel geometry_msgs/Twist -r 1 -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, -1.8]'

Parameter View all parameters List all parameters in ros parameter server:

$ rosparam list

Print parameter values Print the value of a parameter on the terminal:

$ rosparam get param_name

Bag Record topics Record all topics:

$ rosbag record -a


Record all topics excluding topics with a name starting by "/no_topic":

$ rosbag record -a -x "/no_topic/(.*)"

Filter topics Create a new bag file filtering some topics:

$ rosbag filter file.bag new_file.bag condition
e.g.,
rosbag filter file.bag new_file.bag "topic=='topic_name1'"
rosbag filter file.bag new_file.bag "topic!='topic_name1' and/or topic=='topic_name2'"

Play a bag file Play a recorded bag file:

$ rosbag play my_file.bag

Logging Show package name on terminal warning messages:

In "~/.bashrc" file, add
export ROSCONSOLE_FORMAT='${logger}: ${message}'






발자취

2019-09-11 "키클 코딩랩 - 미국 공학박사 아빠의 코딩 연구소"로 이름 변경
2019-06-28 코딩 교실 공개
2019-03-18 코딩 교실 제작 시작

바로가기
About
Contact
Privacy Policy
강의목록
질문하기
처음으로