0
$\begingroup$

Rosanswers logo

In tutorials of wikiros, roscpp, rospy and std_msgs become dependencies of our newly-created package. What I am wondering is what they provide for us.

  • For example, I am writing a node, and in this node, we create publisher and send messages to a topic. The messages are are in type of String.msg. In other words, by using std_msgs::String type, I define an msg variable and publish it via in the node. In this case, which dependency provide std_msgs::String type for us ?

Someone told me that all headers defined for messages are provided by roscpp. Dependency of std_msgs package takes role in creating a custom message. If you do not create user-defined message, you do not make std_msgs a dependency for your package. All the headers for the messages are given to you by roscpp.

Is this correct ? I cannot find a resource what these dependencies are for.


Originally posted by gktg1514 on ROS Answers with karma: 67 on 2019-09-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

by using std_msgs::String type, I define an msg variable and publish it via in the node. In this case, which dependency provide std_msgs::String type for us ?

std_msgs::String is defined in a header part of the std_msgs package.

Someone told me that all headers defined for messages are provided by roscpp. Dependency of std_msgs package takes role in creating a custom message. If you do not create user-defined message, you do not make std_msgs a dependency for your package. All the headers for the messages are given to you by roscpp.

Is this correct ?

No. This is not correct.

For your example already we require std_msgs as a dependency, as that package provides the String message type.

It also provides a number of other message types, see the index.

roscpp itself (ie: the package) only provides a few services and messages, but those are not typically used as parts of other (ie: custom) messages. See the index again.


Originally posted by gvdhoorn with karma: 86574 on 2019-09-22

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by gktg1514 on 2019-09-23:
Thank you so much. I examined your "index" links; everything is senseful right now.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.