custom msg in pub/sub node
Want to implement user defined msg in nodes I edited CMakeLists.txt to include rosbuild_genmsg().
In the publisher/subscriber node, do I have to include it like in the case of std_msg? (i.e. #include "msg/custom_msg.h" or something?)
Will this correspond to the following change: ros::Publisher chatter_pub = n.advertise<msg::custom_msg>("chatter", 1000);
Further, I want to create a subscriber node, and publish messages to it manually, should the corresponding callback method be modified as:
void chatterCallback(const msg::custom_msg::ConstPtr& msg) { ROS_INFO("I heard: [%s]", msg->data.c_str()); }
Thanks a lot, really appreciate your help.