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-
基础知识结束,接着是代码基础。