至此,我们初步学习了ROS的基本工具,接下来一步步理解ROS的各个工作部件的创建和工作原理。
本文的详细文档:http://wenku.baidu.com/view/623f41b3376baf1ffd4fad7a
-
Creating a ROS msg and srv
This tutorial covers how to create and build msg and srv files as well as therosmsg, rossrv and roscp commandline tools.
msg 文件 就是用来让不同语言能产生message的一个指导性文本文件。
srv file describes a service. It is composed of two parts: a request and a response.
2. msg & srv 文件存储位置:
<workspace>/packagename/msg/
&
<workspace>/packagename/srv/
==== msg file 说明 ==== 3. msgfile 的格式和生成 生成: $ cd ~/catkin_ws/src/beginner_tutorials $ mkdir msg $ echo "int64 num" > msg/Num.msg 格式: string first_name string last_name uint8 age uint32 score 4. msgfile 添加到package.xml的dependency中 <build_depend>message_generation</build_depend> <run_depend>message_runtime</run_depend> 5. 对CMakeLists.txt文件的修改: 5.1 添加message_generation dependency到CMakeLists.txt中: mess |