ROS_Kinetic_09 ROS基礎內容(四)
參考網址:
http://wiki.ros.org/cn/ROS/Tutorials/UsingRosEd
http://wiki.ros.org/cn/ROS/Tutorials/CreatingMsgAndSrv
1 rosed
~$ rosed roscpp Logger.msg
由於沒有安裝vim,出錯:

簡單修改為gedit編輯:
~$ export EDITOR='gedit'
~$ rosed roscpp Logger.msg

小技巧,使用Tab補全文件名。
2 msg
~$ cd catkin_ws/src/hello_kinetic
~/catkin_ws/src/hello_kinetic$ mkdir msg
~/catkin_ws/src/hello_kinetic$ echo "int64 num" > msg/Num.msg



具體看wiki。
rosmsg
~/catkin_ws$ rosmsg show hello_kinetic/Num
3 srv
~/catkin_ws$ roscd hello_kinetic
~/catkin_ws/src/hello_kinetic$ mkdir srv
補充roscp功能包拷貝。
~/catkin_ws/src/hello_kinetic$ roscp rospy_tutorials AddTwoInts.srv srv/AddTwoInts.srv
修改package.xml等。
rossrv
~/catkin_ws/src/hello_kinetic$ rossrv show rospy_tutorials/AddTwoInts

-End-
基礎知識結束,接著是代碼基礎。