This article was original written by Jin Tian, welcome re-post, first come with https://jinfagang.github.io . but please keep this copyright info, thanks, any question could be asked via wechat:
this part, we will explore how to write our own messages. Before it, I have to mention that, in other companies such as Baidu, they prefer using Protobuf as their message library, but I don’t think this is a good idea. As ros official has a system to organize there messages. The process of create a personized message is:
- Add a
YourMsgName.msgfile in msg folder in your package;
- Add these in CMakeLists.txt;
- catkin_make and generate your message in devel folder
OK, this is it. Personize your message are so simple, but let’s see how to write it exactly:
this an example of message. By using this, you will have your own message type.
OK, let’s explore how to using this message in C++.